aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/blocks-generator_test.go
Commit message (Collapse)AuthorAgeFilesLines
* 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.