aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/blocks-generator_test.go
Commit message (Collapse)AuthorAgeFilesLines
* utils: move authenticator to utils package (#378)Mission Liao2018-12-221-9/+7
|
* test: check causality (#372)Mission Liao2018-12-171-3/+3
|
* db: cache compaction chain tip in db (#369)Mission Liao2018-12-131-2/+0
| | | | | * Replace JSON with RLP in levelDB implementation. * Make sure blocks to sync following compaction chain tip
* db: rename blockdb to db (#367)Mission Liao2018-12-131-33/+35
| | | | | | | | | | * Rename blockdb package to db * Rename 'BlockDB' to 'DB' * Make all methods in db specific for ''block'. * Rename db.BlockDatabase to db.Database * Rename revealer to block-revealer * Rename test.Revealer to test.BlockRevealer
* core: Remove max block interval (#287)Jimmy Hu2018-11-021-12/+6
|
* Rename repo to dexon-consensusWei-Ning Huang2018-11-021-8/+8
|
* core: prepare empty block if null block is confirmed by BA. (#231)Jimmy Hu2018-10-231-9/+12
|
* core: total ordering flush (#212)Mission Liao2018-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement flush * Panic for all errors from total-ordering * Fix test failure All DAGs generated by blocks-generator would trigger round switching. * Add NewBlocksGeneratorConfig * Add test caes for numChains changes * Resize internal structures * Perform total ordering based on current numChains * Fix not a valid DAG checking * Comparing blocks by height is not correct * Fix blocks from future round are delivered first by revealer * Make sure only picking one candidate in one chain. Blocks on the same chain in different rounds would not have acking relation. * Fix stuffs * Fix the issue that two candidates from the same chain are picked. * Rework candidateChainMapping * Add test case for phi, k changed * Refine testing code for round change * Add breakpoints in global vector * Remove not a valid dag checking. * Adding comments * Add check to forward acking * Fix vet failure * Prepareing height record with breakpoint * Fixup: add check to make sure delivered round IDs are increasing.
* core: blocks generation supports rounds (#196)Mission Liao2018-10-141-50/+205
| | | | | | | * Block proposing based on timestamp, instead of count of blocks generated. * Add method to find tips of each round in blockdb. * Block proposing based on tips of last round found on blockdb.
* test: fix block generator (#126)Mission Liao2018-09-211-19/+24
| | | | | | | | * Generate correct hash/signature when generating blocks. * Refine naming, types. - type of chainNum should be uint32 by default - rename blockCount to blockNum - rename nodeCount to chainNum
* Rename validator* to node* (#120)Mission Liao2018-09-201-22/+22
|
* core: move blockdb into core package and minor change on governance ↵Wei-Ning Huang2018-09-171-1/+1
| | | | | | | interface (#110) Since third party apps will possibly implement their only blockdb class, it make sense for the interface to be in core. Also add GetNumShards into the governance interface.
* core: replace acks with slice (#102)Mission Liao2018-09-121-1/+1
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-031-4/+4
| | | | `Height` from `Block` (#89)
* core: tune total ordering performance (#81)Mission Liao2018-08-301-5/+10
| | | | | - Replace map with slice Compared to slice, accessing to map is slower and the memory usage is inefficient.
* core: tune performance total ordering (#66)Mission Liao2018-08-211-0/+55
| | | | | | - the checking of `internal stability` is more expensive than checking `len(ANS) == validatorCount`. So only check it when `len(ANS) != validatorCount`. - cache the result of `grade` between candidates. - cache the `acking height vector` of each candidate. - add test on total ordering with different acking frequency between blocks.
* core: Hash block in Consensus.PrepareBlock. (#46)Jimmy Hu2018-08-121-18/+1
| | | | | | | | * Add hash to block * Check block hash in Consensus.sanityCheck * Add hashBlockFn in block generator.go
* core: Add Block.IsGenesis() and set Block.ParentHash to 0 in genesis block. ↵Jimmy Hu2018-08-091-1/+18
| | | | (#37)
* test: random blocks generator (#26)Mission Liao2018-08-031-0/+108
* Add blocks generator. This helper would randomly generate blocks that forms valid DAGs. * Add revealer Revealer is an extension of blockdb.BlockIterator. The block sequence from 'Next' method would be either randomly (see RandomRevealer) or meeting some specific condition (ex. forming a DAG, see RandomDAGRevealer). * Add test for sequencer based on random blocks. * core: refine Application interface and add Governance interface (#24) Add a new Governance interface for interaction with the governance contract. Also remove the ValidateBlock call in application interface as the application should validate it before putting it into the consensus module. A new BlockConverter interface is also added. The consensus module should accept the BlockConverter interface in future implementation, and use the Block() function to get the underlying block info.