aboutsummaryrefslogtreecommitdiffstats
path: root/core/total-ordering_test.go
Commit message (Collapse)AuthorAgeFilesLines
* core: total-ordering: add test TestRunFromNonGenesis (#226)Haoping Ku2018-10-221-0/+79
| | | | * core: total-ordering: add test TestRunFromNonGenesis
* core: total-ordering: change early flag to mode (#227)Haoping Ku2018-10-191-12/+12
| | | * core: total-ordering: change early flag to mode
* core: total ordering flush (#212)Mission Liao2018-10-181-87/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: check if flush is required when round switching in total-ordering (#197)Mission Liao2018-10-151-26/+106
|
* core: blocks generation supports rounds (#196)Mission Liao2018-10-141-24/+22
| | | | | | | * 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.
* core: latticeData supports config change (#190)Mission Liao2018-10-121-17/+10
| | | | | | | | | | | | | | | * Add test for num of chains changes. * Return error in latticeData.prepareBlock * Compare two positions * Modify chainStatus from height-based to index-based. * Fix consensus to use round variable * Remove sanity check in chainStatus * Fixup: refine sanity check - verify if round switching is required or not by chainTip's config. - make the logic in sanity check more clear - pospone acking relationship checking, they are more expensive to check.
* test: Short test applied to some long running tests (#168)Jimmy Hu2018-10-041-2/+6
|
* core: publish round based config (#165)Mission Liao2018-10-031-10/+17
|
* test: fix block generator (#126)Mission Liao2018-09-211-24/+25
| | | | | | | | * 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-91/+91
|
* 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-119/+45
|
* core: total ordering with chain ID (#100)Mission Liao2018-09-121-239/+212
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-031-66/+156
| | | | `Height` from `Block` (#89)
* core: tune total ordering performance (#81)Mission Liao2018-08-301-234/+232
| | | | | - Replace map with slice Compared to slice, accessing to map is slower and the memory usage is inefficient.
* core: tune performance (#73)Mission Liao2018-08-281-26/+36
| | | | | | | | | | | | | | | | | | | | | | - Avoid using recursive function in critical path. - Do not write through when using levelDB. Things put to levelDB would be safe from panic even we didn't force to write through every time. - Dump count of confirmed blocks proposed by self. - Avoid allocating variables in loop. - Return length of acking node set, we only need that when total ordering. - Fix potential bug: make sure win records updated when acking height vectors of candidates are changed. - Keep dirty validators in slice. - Add cache for objects to ease the pressure to garbage collector. - Cache global acking status when total ordering. - Add method to recycle blocks. - Marshal JSON should be called once for each broadcast. - Make updateWinRecord called in parallel. - Log average / deviation of latencies when simulation finished.
* core: tune performance total ordering (#66)Mission Liao2018-08-211-248/+281
| | | | | | - 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.
* test: refine test utility (#61)Mission Liao2018-08-151-20/+8
| | | | | * Add functionality to test.App * Add test utility to generate slices of types.ValidatorID
* core: Hash block in Consensus.PrepareBlock. (#46)Jimmy Hu2018-08-121-1/+1
| | | | | | | | * Add hash to block * Check block hash in Consensus.sanityCheck * Add hashBlockFn in block generator.go
* Fix the bug preventing us from testing large group when using TCP-Local (#42)Mission Liao2018-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | * Fix the issue that processing genesis block twice. - Restore the mechanism to avoid sending block to proposer. * Fix the 'keep-alive' not working Quote from comments of net/http/request For client requests, setting this field prevents re-use of TCP connections between requests to the same hosts, as if Transport.DisableKeepAlives were set. * Remove useless field * Fix the test bug: I should provide '3' when test K=3 * Fixup: the parent hash of genesis block should be zero
* core: Add Block.IsGenesis() and set Block.ParentHash to 0 in genesis block. ↵Jimmy Hu2018-08-091-60/+30
| | | | (#37)
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-081-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make Sequencer return slice of blocks. * Fix naming issue The function 'getHeightVecto' would return ackingStatusVector. * Fix comment error. * Add methods to collect info when proposing blocks. * Add test.App * Add test.Gov * Move this type to core.types to avoid cyclic import. * Add core.Consensus * Move getMedianTime, interpoTime to util These functions are not depending on members of core.consensusTimestamp and is required when testing core.Consensus. * Make sure types.Block.Clone would copy critical fields. * Remove core.blocklattice * Define 'infinity' in core/total-ordering This definition is defined in core/blocklattice originally. * Fix a bug when processing the same block twice. * Integrate simulation with core.Consensus core.Consensus is a replacement of core.Blocklattice * Fix the comment to use sigular form. * Move lock mechanism to sub modules. * phi should be 2*fmax+1 * Fixup: should aborting when the validator is added * Fix for new block fields * Fix the bug that the total ordering sequence is wrong.
* Rename names of struct and filesMission Liao2018-08-061-0/+996
Rename these files: - core/sequencer[_test].go -> core/total-ordering[_test].go - core/acking[_test].go -> core/reliable-broadcast[_test].go - core/timestamp[_test].go -> core/consensus-timestamp[_test].go Rename these structs: - core.sequencer -> core.totalOrdering - core.acking -> core.reliableBroadcast - core.timestamp -> core.consensusTimestamp