aboutsummaryrefslogtreecommitdiffstats
path: root/core/total-ordering.go
Commit message (Collapse)AuthorAgeFilesLines
* core: syncer: add syncer (#346)haoping-ku2018-11-291-8/+9
|
* core: lattice, total-ordering: remove newGenesisConfig (#308)haoping-ku2018-11-081-9/+9
| | | | | | * core: lattice, total-ordering: remove newGenesisConfig * fixup
* core: total-ordering: fix details and add sync test (#288)Haoping Ku2018-11-021-295/+241
|
* Rename repo to dexon-consensusWei-Ning Huang2018-11-021-7/+7
|
* core: fix lattice bugs (#274)Mission Liao2018-10-301-1/+27
| | | | | | | | | | | | | | | | | * Fix bug: the block pool is not resized. * Fix forward acking. * Fix panic when total ordering * Fix total ordering flush hang The blocks arrived first might be not delivered before other block. Therefore, if some last block of previous round arrived before last blocks in other chains, and are not delivered when entering flush mode. Their corresponding flush-ready flag won't be turned on. * Fix bug in core.latticeData Invalid chainID is not thrown when preparing blocks.
* core: total-ordering: add test TestRunFromNonGenesis (#226)Haoping Ku2018-10-221-20/+15
| | | | * core: total-ordering: add test TestRunFromNonGenesis
* core: total-ordering: change early flag to mode (#227)Haoping Ku2018-10-191-7/+20
| | | * core: total-ordering: change early flag to mode
* core: total ordering flush (#212)Mission Liao2018-10-181-99/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-94/+77
|
* core: latticeData supports config change (#190)Mission Liao2018-10-121-5/+3
| | | | | | | | | | | | | | | * 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.
* core: publish round based config (#165)Mission Liao2018-10-031-3/+38
|
* core: replace acks with slice (#102)Mission Liao2018-09-121-2/+2
|
* core: total ordering with chain ID (#100)Mission Liao2018-09-121-167/+143
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-031-7/+7
| | | | `Height` from `Block` (#89)
* core: tune total ordering performance (#81)Mission Liao2018-08-301-199/+300
| | | | | - 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-115/+375
| | | | | | | | | | | | | | | | | | | | | | - 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-138/+235
| | | | | | - 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: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-081-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/+522
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