Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | syncer: fix stuffs (#366) | Mission Liao | 2018-12-12 | 6 | -72/+153 |
| | | | | | | | | | | * return delivered blocks when processing finalized blocks * check deliver sequence when processing finalized blocks * skip delivery of finalized blocks * remove duplicated calls to BlockConfirmed * add numChains change in test scenario * fix the bug that restartNotary is triggered by older block than current aID. | ||||
* | core: Longer lambda for TravisCI (#365) | Jimmy Hu | 2018-12-10 | 2 | -1/+16 |
| | | | | | | * Longer time for TravisCI. * Update CI setting for PR | ||||
* | ci: Add TravisCI setting. (#363) | Jimmy Hu | 2018-12-08 | 2 | -46/+122 |
| | | | | | | | | | | | | | | * Update Gopkg.lock * Fix test * Add travisCI setting * Print log using fmt * Update GNUmakefile * Use single go rountine for consensus_test | ||||
* | core: fix bugs found when node-set is not equal to notary-set (#362) | Mission Liao | 2018-12-07 | 7 | -62/+106 |
| | |||||
* | ci: some change to circleci (#360) | Jimmy Hu | 2018-12-06 | 2 | -3/+3 |
| | | | | | | | | * CircleCI: change to go1.11 * fix gofmt * Reduce test size | ||||
* | test: allow to log in test.State (#359) | Mission Liao | 2018-12-06 | 11 | -52/+120 |
| | |||||
* | Haoping fix simulation (#356) | haoping-ku | 2018-12-05 | 4 | -6/+31 |
| | | | | | | | | | | | | | | | * simulation: add benchmark features * tmp * simulation: modify Debug interface * Added BlockReceived and BlockReady function to Debug interface. * Added Benchmark features. * fix * fix typos | ||||
* | core: fix agreement sync issue. (#358) | Jimmy Hu | 2018-12-05 | 1 | -2/+3 |
| | |||||
* | core: syncer: fix round finding process (#357) | haoping-ku | 2018-12-05 | 1 | -3/+3 |
| | | | | | | * core: syncer: fix round finding process * Fix comment | ||||
* | core: log the last pending block in compaction chain (#355) | Mission Liao | 2018-12-04 | 3 | -20/+25 |
| | |||||
* | core: Fix stuffs (#354) | Jimmy Hu | 2018-12-04 | 2 | -2/+11 |
| | | | | | | - Add common.CustomLogger - CRS will wait for DKG to finish - Fix core.agreementMgr.processAgreementResult | ||||
* | core: construct consensus from syncer (#352) | Mission Liao | 2018-12-04 | 5 | -63/+225 |
| | |||||
* | core: Fix stuffs (#351) | Jimmy Hu | 2018-11-30 | 3 | -2/+10 |
| | | | | | | * Use non-blocking app in consensus core * Prevent panic when getting nextHeight | ||||
* | core: remove finalized from compaction-chain module (#350) | Mission Liao | 2018-11-30 | 3 | -345/+57 |
| | | | | | | | | | | | | * Remove extractFinalizedBlock * Fix/Remove tests related to extractFinalizedBlocks * Remove unused function * Provide randomness result from finalized blocks, nothing more. * Make init block matched with pendingBlocks[0] | ||||
* | test: Fix for state (#349) | Jimmy Hu | 2018-11-29 | 1 | -3/+23 |
| | | | | | | * Only apply each requests once * Sort by time | ||||
* | core: syncer: add syncer (#346) | haoping-ku | 2018-11-29 | 15 | -118/+1034 |
| | |||||
* | core: remove StronglyAcked (#347) | Mission Liao | 2018-11-29 | 8 | -90/+39 |
| | |||||
* | core: Fix stuffs (#342) | Jimmy Hu | 2018-11-27 | 6 | -160/+124 |
| | |||||
* | core: support NumChains change for BA modules (#339) | Mission Liao | 2018-11-20 | 12 | -317/+659 |
| | |||||
* | core: Add function alias (#341) | Jimmy Hu | 2018-11-20 | 1 | -0/+4 |
| | |||||
* | core: Block randomness will be processed again in finalized block (#338) | Jimmy Hu | 2018-11-20 | 3 | -78/+165 |
| | | | | | | * Process randomness result in finalized block if missed * Add test for missing block randomness | ||||
* | core, test: Fix various issues (#337) | Jimmy Hu | 2018-11-19 | 2 | -2/+4 |
| | |||||
* | core: Fix data race (#335) | Jimmy Hu | 2018-11-19 | 1 | -0/+2 |
| | |||||
* | core: Handle issues if DKG/CRS is already finished (#334) | Jimmy Hu | 2018-11-18 | 3 | -38/+28 |
| | |||||
* | core: Fix various syncing issue. (#331) | Jimmy Hu | 2018-11-16 | 4 | -19/+32 |
| | |||||
* | core: Add timeout to TSig (#330) | Jimmy Hu | 2018-11-15 | 2 | -1/+49 |
| | |||||
* | test: fix network (#328) | Mission Liao | 2018-11-15 | 4 | -81/+181 |
| | | | | * Broadcast to set of node instead of broadcasting when attaching cache. * Fix pull blocks | ||||
* | core: Fix issues in syncing mode (#329) | Jimmy Hu | 2018-11-15 | 3 | -0/+32 |
| | |||||
* | core: Fix syncing issues (#326) | Jimmy Hu | 2018-11-14 | 1 | -2/+9 |
| | | | | | | * BA should not start if governance is out-of-sync * Should not do sync BA if consensus is not started | ||||
* | utils: add utils package (#327) | Mission Liao | 2018-11-14 | 7 | -25/+18 |
| | |||||
* | core: sync logger with dex (#325) | Mission Liao | 2018-11-14 | 5 | -9/+11 |
| | |||||
* | core: Integrate totalOrdering syncer (#322) | Jimmy Hu | 2018-11-13 | 2 | -21/+29 |
| | |||||
* | core: expose implicit round shift (#321) | Mission Liao | 2018-11-13 | 13 | -55/+54 |
| | |||||
* | core: Fix data race. (#320) | Jimmy Hu | 2018-11-13 | 1 | -6/+8 |
| | | | Finalization.Randomness will be set at output | ||||
* | core: Fix data race (#319) | Jimmy Hu | 2018-11-13 | 1 | -0/+4 |
| | |||||
* | core: Reduce call to Application.VerifyBlock (#317) | Jimmy Hu | 2018-11-13 | 4 | -12/+61 |
| | |||||
* | core: lattice: fix test (#316) | haoping-ku | 2018-11-12 | 1 | -1/+1 |
| | |||||
* | test: add integration test (#315) | Mission Liao | 2018-11-11 | 4 | -13/+51 |
| | | | | | | * Rename NonByzantineTestSuite to WithSchedulerTestsuite * Add a method to query the latest position delivered * Add integration test for core.Consensus * Show detailed list for test cases in CI | ||||
* | test: implement pulling in network layer (#314) | Mission Liao | 2018-11-09 | 4 | -43/+580 |
| | | | | | | | * Add definition for test.PullRequest * Cache notary sets for each round in network module * Cache peers as nodeID in network module. * Implement pull blocks * Implement pull vote | ||||
* | core: Extract VoteHeader (#313) | Mission Liao | 2018-11-09 | 7 | -61/+45 |
| | |||||
* | core: consensus-timestamp: add comments (#312) | haoping-ku | 2018-11-09 | 2 | -26/+39 |
| | |||||
* | simulation: use test.Governacne in simulation (#311) | Mission Liao | 2018-11-08 | 7 | -41/+126 |
| | | | | | | | | | | | | * Move simulation.Network to test package * Use test.Governance in simulation * Pack/Apply state request in blocks payload * Add Governance.SwitchToRemoteMode This would trigger governance to broadcast pending state change requests when changes. * Allow to marshal/unmarshal packedStateChanges * Attach test.Network and test.State | ||||
* | core: Fix panic (#310) | Jimmy Hu | 2018-11-08 | 1 | -4/+11 |
| | | | | * Fix panic | ||||
* | core: lattice, total-ordering: remove newGenesisConfig (#308) | haoping-ku | 2018-11-08 | 7 | -159/+117 |
| | | | | | | * core: lattice, total-ordering: remove newGenesisConfig * fixup | ||||
* | core: revert the revert for broken commit and fix (#309) | Mission Liao | 2018-11-08 | 2 | -69/+80 |
| | | | | | | | | * Revert "Revert "core: unbind global round in Consensus (#304)" (#306)" This reverts commit 33d9311270414d8911122a4c7354773786df7f85. * Remove TODO After verified with full node, this call to VerifyBlock is not required. | ||||
* | core: Optimize core (#307) | Jimmy Hu | 2018-11-08 | 6 | -32/+60 |
| | |||||
* | Revert "core: unbind global round in Consensus (#304)" (#306) | Mission Liao | 2018-11-08 | 2 | -61/+59 |
| | | | This reverts commit 3714ebf2f1054d9984d37b89cf17e885a5856532. | ||||
* | test: make StateChangeRequest broadcast-able (#305) | Mission Liao | 2018-11-07 | 5 | -278/+445 |
| | | | | | | | | | | | | | | | | | | | | | | | | | Make `test.StateChangeRequest` behaves like tx on ethereum: - Can be broadcasted and cached in a pool. - Uniquely indexed, and be removed after applied. Changes: - Make cloneDKGx functions in test.State as utilities. - Add hash and timestamp fields to test.StateChangeRequest. - Add two methods to test.State: - PackOwnRequests would pack all pending change requests owned by this instance as byte slice, and move them to global pending requests pool. - AddRequestsFromOthers would add pending change requests from others to global pending requests pool. - The method State.PackRequests now would pack requests in global pending requests pool. - The method State.Apply would remove corresponding StateChangeRequest by hash. | ||||
* | core: lattice: add round in NewLattice() (#303) | haoping-ku | 2018-11-07 | 3 | -9/+10 |
| | |||||
* | core: unbind global round in Consensus (#304) | Mission Liao | 2018-11-06 | 2 | -59/+61 |
| | |||||
* | core: Run DKG stuffs only if the node is in DKG set (#302) | Jimmy Hu | 2018-11-06 | 9 | -26/+109 |
| | |||||
* | core: lattice-data: fix details and add test (#299) | haoping-ku | 2018-11-06 | 6 | -152/+167 |
| | |||||
* | core: Fix deadlock (#298) | Jimmy Hu | 2018-11-05 | 1 | -0/+9 |
| | |||||
* | test: move simulation.network to test package (#297) | Mission Liao | 2018-11-05 | 2 | -0/+440 |
| | |||||
* | core: notify consensus height for genesis rounds (#296) | Mission Liao | 2018-11-05 | 6 | -7/+47 |
| | | | | * Add notifyGenesisRounds * Log round for types.Vote and types.Block | ||||
* | core: Fix dkg and CRS signature (#294) | Jimmy Hu | 2018-11-05 | 4 | -19/+68 |
| | |||||
* | core: New BA (#295) | Jimmy Hu | 2018-11-05 | 2 | -5/+7 |
| | |||||
* | core: Fix BA stuffs (#293) | Jimmy Hu | 2018-11-05 | 2 | -3/+15 |
| | |||||
* | core: Copy witness for empty block (#292) | Jimmy Hu | 2018-11-05 | 1 | -0/+3 |
| | |||||
* | core: Fix fork vote (#290) | Jimmy Hu | 2018-11-03 | 3 | -16/+18 |
| | |||||
* | core: total-ordering: fix details and add sync test (#288) | Haoping Ku | 2018-11-02 | 3 | -309/+401 |
| | |||||
* | core: reset CRS in leader selector by round (#286) | Mission Liao | 2018-11-02 | 7 | -34/+28 |
| | |||||
* | core: block deliver with position (#289) | Mission Liao | 2018-11-02 | 8 | -19/+24 |
| | | | | | This info is required when application layer needs to do something related to the underlying DAG, not just compaction chain. | ||||
* | core: Remove max block interval (#287) | Jimmy Hu | 2018-11-02 | 13 | -77/+35 |
| | |||||
* | Rename repo to dexon-consensus | Wei-Ning Huang | 2018-11-02 | 89 | -682/+682 |
| | |||||
* | core: Fix various locking issues (#285) | Jimmy Hu | 2018-11-02 | 3 | -24/+40 |
| | |||||
* | core: Total Ordering syncer (#277) | Jimmy Hu | 2018-11-01 | 2 | -0/+485 |
| | | | | | | | | | | | | | | | | * Add simple processFinalizedBlock logic * processBlock * Bootstrap mode * Sort before flush * Add syncer test * Clean more data for memory * Add comments. Fix some stuffs. | ||||
* | core: core.Lattice supports config change (#276) | Mission Liao | 2018-11-01 | 6 | -30/+54 |
| | | | | | | | | | | | Besides making core.Lattice supports config change, This PR also include the first test for below scenario: - Configuration changes are registered before test running - Those changes are carried/broadcasted as payload of blocks - Only one node would initiate these changes, however, all nodes would finally receive/apply those changes to their own test.Governance instance. | ||||
* | core: fix possible fork vote (#283) | Jimmy Hu | 2018-11-01 | 2 | -15/+19 |
| | |||||
* | core: Add PullVotes to Network. (#281) | Jimmy Hu | 2018-10-31 | 7 | -71/+64 |
| | |||||
* | core: Add a repeat vote state. (#280) | Jimmy Hu | 2018-10-31 | 3 | -12/+105 |
| | |||||
* | core: fix NotifyRoundHeight is not called when processing blocks | Mission Liao | 2018-10-31 | 1 | -10/+16 |
| | | | - also add missing logs when calling Application.BlockDelivered. | ||||
* | core: fix lattice bugs (#274) | Mission Liao | 2018-10-30 | 3 | -5/+38 |
| | | | | | | | | | | | | | | | | | * 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. | ||||
* | test: integrate state to gov (#275) | Mission Liao | 2018-10-30 | 3 | -9/+113 |
| | | | | | | * Fix dummy error * Check validity before apply state changes. * Add RegisterConfigChange method to test.Governance * Add SwitchToRemoteMode method to test.State | ||||
* | core: Create an interface for TSigVerifierCache (#273) | Jimmy Hu | 2018-10-30 | 1 | -7/+24 |
| | |||||
* | core: fix consensus timestamp (#272) | Mission Liao | 2018-10-29 | 1 | -2/+12 |
| | | | | | | | | | | | * Fix panic Assume DAG would be increased to 7 chains at round 4. When encounter the first block from round 4, this module would attempt to resize its working set to the numChains in round 2 or 3. * Add a check to make sure consensus timestamps are increasing * Fix consensus timestamp rewind | ||||
* | core: Add BlockSkeleton and Verify functions (#271) | Jimmy Hu | 2018-10-29 | 6 | -3/+75 |
| | |||||
* | core: Fix goroutine leaks (#270) | Jimmy Hu | 2018-10-29 | 2 | -1/+8 |
| | |||||
* | core: Do not process vote/block in agreement if it has stopped (#269) | Jimmy Hu | 2018-10-29 | 1 | -4/+18 |
| | |||||
* | core: Fix missing fields when cloning blocks. (#268) | Mission Liao | 2018-10-27 | 2 | -4/+33 |
| | |||||
* | core: Remove atomic (#266) | Jimmy Hu | 2018-10-27 | 2 | -14/+11 |
| | |||||
* | core: Unit test for BA sync (#265) | Jimmy Hu | 2018-10-26 | 2 | -0/+86 |
| | |||||
* | core: sync BA (#264) | Jimmy Hu | 2018-10-26 | 3 | -19/+72 |
| | |||||
* | test: clone types.Config, test.Governance, test.State (#262) | Mission Liao | 2018-10-26 | 6 | -42/+608 |
| | |||||
* | core: Pull block (#263) | Jimmy Hu | 2018-10-26 | 6 | -32/+116 |
| | |||||
* | core: Leader selector will retry sanityCheck (#261) | Jimmy Hu | 2018-10-26 | 7 | -26/+117 |
| | |||||
* | core: Lock entire lattice.ProcessBlock (#259) | Jimmy Hu | 2018-10-26 | 2 | -2/+7 |
| | | | | | | * Lock entire ProcessBlock * Lock Consensus.processBlock | ||||
* | misc: Add longer timeout for test in master (#258) | Jimmy Hu | 2018-10-25 | 1 | -7/+13 |
| | |||||
* | core: lattice sync (#257) | Jimmy Hu | 2018-10-25 | 11 | -98/+492 |
| | |||||
* | core: handle round 0 randomness in processFinalizedBlock (#256) | Jimmy Hu | 2018-10-25 | 2 | -12/+26 |
| | |||||
* | test: add test.Stopper to stop by round (#255) | Mission Liao | 2018-10-25 | 2 | -32/+162 |
| | |||||
* | core: Move dkg in types to types/dkg. (#253) | Jimmy Hu | 2018-10-25 | 15 | -250/+265 |
| | |||||
* | core: fix stuffs (#250) | Mission Liao | 2018-10-24 | 8 | -50/+32 |
| | | | | | | | | * fix discontinuous finalization height * remove types.Block.Witness.Timestamp field * add field: types.Block.Finalization.ParentHash * fix log format of CRS * switch round and chain in log of types.Position. | ||||
* | test: Fix datarace in test (#251) | Jimmy Hu | 2018-10-24 | 1 | -6/+12 |
| | |||||
* | test: add test.State (#239) | Mission Liao | 2018-10-24 | 10 | -149/+1012 |
| | | | | | | | | | * separate test utility and interface implementation for test.Governance. * add test.State. * integrate test.State to test.Governance. test.State is mainly used to emulate state propagation on fullnode. | ||||
* | core: disable nonblocking temporarily (#249) | Mission Liao | 2018-10-24 | 2 | -10/+5 |
| | |||||
* | core: reduce calls to Application.VerifyBlock (#247) | Mission Liao | 2018-10-24 | 4 | -28/+24 |
| | | | | | | * remove sanity check when adding blocks. * call VerifyBlock after lattice's sanity check. * remove checkRelation flag. | ||||
* | core: fix panic when proposed block is nil (#248) | Mission Liao | 2018-10-24 | 1 | -0/+4 |
| | |||||
* | core: Change interface of Application.VerifyBlock (#246) | Jimmy Hu | 2018-10-23 | 6 | -8/+23 |
| | | | | * Change interface of Application.VerifyBlock | ||||
* | Change BLS to dexon-foundation (#245) | Jimmy Hu | 2018-10-23 | 4 | -4/+4 |
| | |||||
* | core: notify fullnode to snapshot configs when round change. (#243) | Mission Liao | 2018-10-23 | 1 | -8/+19 |
| | |||||
* | core: add equality checker for dkg related structure (#237) | Mission Liao | 2018-10-23 | 4 | -26/+379 |
| | | | | | | | | | Besides adding equality, also renaming those fields. - PublicKeyShares.shares -> shareCaches - PublicKeyShares.shareIndex -> shareCacheIndex - rlpPublicKeyShares.Shares -> ShareCaches - rlpPublicKeyShares.ShareIndexK -> ShareCacheIndexK - rlpPublicKeyShares.ShareIndexV -> ShareCahceIndexV | ||||
* | core: add round parameter to ProposeCRS method (#244) | Wei-Ning Huang | 2018-10-23 | 4 | -4/+11 |
| | | | | | | | | Since all DKG set members may ProposeCRS, but only one will get through, we need to be able to tell which round the CRS is intended for in order to skip CRS submission of the same round. Also this commit add check to make sure we have enough master public key when initializing DKGGroupPublicKey. | ||||
* | simulation: Cache network broadcasted message (#242) | Jimmy Hu | 2018-10-23 | 1 | -10/+5 |
| | |||||
* | core: Change dkg timing (#241) | Jimmy Hu | 2018-10-23 | 1 | -12/+17 |
| | | | | | * Register DKG after CRS is proposed * Change round at only one place | ||||
* | core: remove duplicate BroadcastRandomnessResult call (#240) | Wei-Ning Huang | 2018-10-23 | 1 | -6/+1 |
| | |||||
* | core: prepare empty block if null block is confirmed by BA. (#231) | Jimmy Hu | 2018-10-23 | 7 | -23/+136 |
| | |||||
* | core: fix uninitialized variable in configuration chain (#238) | Wei-Ning Huang | 2018-10-22 | 2 | -1/+2 |
| | |||||
* | core: Handling self proposed DKG private share (#236) | Jimmy Hu | 2018-10-22 | 3 | -27/+34 |
| | |||||
* | core: total-ordering: add test TestRunFromNonGenesis (#226) | Haoping Ku | 2018-10-22 | 3 | -22/+96 |
| | | | | * core: total-ordering: add test TestRunFromNonGenesis | ||||
* | crypto: dkg: implement rlp.Encoder, rlp.Decoder for PrivateKey (#235) | Sonic | 2018-10-20 | 2 | -0/+26 |
| | |||||
* | core: fix logging for SendDKGPrivateShare (#234) | Wei-Ning Huang | 2018-10-20 | 1 | -1/+2 |
| | |||||
* | Start Run() until dMoment. (#233) | Jimmy Hu | 2018-10-20 | 1 | -0/+2 |
| | |||||
* | core: types: implement rlp.Encoder and rlp.Decoder (#232) | Sonic | 2018-10-20 | 6 | -7/+379 |
| | | | | | * core: types: implement rlp.Encoder and rlp.Decoder * crypto: dkg: fix PublicKey.Bytes | ||||
* | core: initial commit for logger (#228) | Mission Liao | 2018-10-19 | 9 | -50/+184 |
| | | | | | | | | | | | | | * Replace "log.*" with logger. * Add simple logger to log with log package. * Add debug logs to all calls to these interfaces: - core.Application - core.Governance - core.Network * Add Stringer to these types: - types.DKGComplaint - types.AgreementResult - types.DKGMasterPublicKey - types.DKGFinalize | ||||
* | misc: Fix simulation error (#230) | Jimmy Hu | 2018-10-19 | 3 | -20/+30 |
| | |||||
* | core: Sync from BA and test. (#224) | Jimmy Hu | 2018-10-19 | 2 | -64/+199 |
| | |||||
* | core: total-ordering: change early flag to mode (#227) | Haoping Ku | 2018-10-19 | 10 | -49/+64 |
| | | | * core: total-ordering: change early flag to mode | ||||
* | crypto: ecdsa: make NodeID match dexon address (#229) | Sonic | 2018-10-19 | 3 | -51/+35 |
| | | | | | | | * Remove publicKey struct * PublicKey.Bytes() return uncompressed public key to match the address format of dexon (Keccak256(pubBytes[1:])[12:], where pubBytes is 65 bytes uncompressed public key.). * Rename ethcrypto to dexCrypto | ||||
* | core: Append all config till Initial block (#225) | Jimmy Hu | 2018-10-18 | 1 | -0/+7 |
| | |||||
* | core: types: implements UnmarshalJSON from DKGMasterPublicKey (#223) | Wei-Ning Huang | 2018-10-18 | 1 | -0/+8 |
| | |||||
* | core: total ordering flush (#212) | Mission Liao | 2018-10-18 | 9 | -229/+737 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: sync compaction chain (#222) | Jimmy Hu | 2018-10-18 | 6 | -27/+391 |
| | |||||
* | core: consensus-timestamp: add sync (#219) | Haoping Ku | 2018-10-18 | 3 | -29/+118 |
| | | | | | | | | | | | | | | * core: consensus-timestamp: add sync * core: consensus-timestamp: add config change * fix go comment * add config change test * fixup: add error case handling * fixup: round interleave | ||||
* | core: Add init block to Run() (#221) | Jimmy Hu | 2018-10-18 | 5 | -13/+23 |
| | |||||
* | core: Some sync functions (#220) | Jimmy Hu | 2018-10-17 | 6 | -26/+106 |
| | |||||
* | core: Rebroadcast agreement and randomness result. (#218) | Jimmy Hu | 2018-10-17 | 3 | -30/+49 |
| | |||||
* | core: genesis consensus timestamp (#217) | Mission Liao | 2018-10-17 | 4 | -29/+45 |
| | | | | | | | | | | * Refine the initial value for empty time slot. * Fix DATA RACE netowrkConnection is reset for each test, however, our Consensus instance is not stopped after one test is finished, they might continue use network interface for a while. | ||||
* | core: Add stop function to all components (#216) | Jimmy Hu | 2018-10-17 | 3 | -28/+53 |
| | |||||
* | Finalization Height starts from 1 (#215) | Jimmy Hu | 2018-10-16 | 2 | -0/+7 |
| | |||||
* | core: consensus-timestamp: modify for round change (#214) | Haoping Ku | 2018-10-16 | 1 | -4/+12 |
| | | | | | | * core: consensus-timestamp: modify for round change * core: consensus-timestamp: fix typos | ||||
* | core: New dexon ba (#210) | Jimmy Hu | 2018-10-16 | 8 | -479/+405 |
| | |||||
* | core: Fix corner cases (#211) | Jimmy Hu | 2018-10-16 | 4 | -2/+8 |
| | | | | | | * leader selector will choose smaller hash if distance to crs is the same * Set initial value of aID in BA before start | ||||
* | core: set genesis block finalization timestamp to zero time (#213) | Wei-Ning Huang | 2018-10-16 | 1 | -0/+2 |
| | |||||
* | core: Change First round dkg timing (#209) | Jimmy Hu | 2018-10-16 | 2 | -4/+6 |
| | |||||
* | core: fix block confirmed is not called when Debug is not implemented. (#208) | Mission Liao | 2018-10-16 | 2 | -3/+54 |
| | |||||
* | core: Change threshold (#205) | Jimmy Hu | 2018-10-15 | 1 | -1/+1 |
| | |||||
* | core: fix timestamp marshaling (#207) | Wei-Ning Huang | 2018-10-15 | 2 | -3/+3 |
| | |||||
* | Remove duplicated dMoment in Consensus.Run (#206) | Jimmy Hu | 2018-10-15 | 1 | -2/+4 |
| | |||||
* | core: Add NodeSetCacheInterface (#203) | Jimmy Hu | 2018-10-15 | 2 | -31/+42 |
| | |||||
* | core: Change DKG threshold (#204) | Jimmy Hu | 2018-10-15 | 3 | -6/+6 |
| | |||||
* | core: Fix simulation errors. (#202) | Jimmy Hu | 2018-10-15 | 3 | -34/+35 |
| | |||||
* | core: fix simulation error (#201) | Jimmy Hu | 2018-10-15 | 2 | -8/+13 |
| | | | | | * Sync dMoment for all consensus core * App check for randomness ignore round 0 | ||||
* | core: No randomness for round 0 (#198) | Jimmy Hu | 2018-10-15 | 3 | -1/+45 |
| | | | | | * No randomness for round 0 * Ignore round 0 randomness | ||||
* | core: check if flush is required when round switching in total-ordering (#197) | Mission Liao | 2018-10-15 | 6 | -220/+304 |
| | |||||
* | core: blocks generation supports rounds (#196) | Mission Liao | 2018-10-14 | 6 | -219/+445 |
| | | | | | | | * 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: crypto: ecdsa: add method to create PrivateKey from ecdsa.PrivateKey ↵ | Wei-Ning Huang | 2018-10-13 | 1 | -0/+9 |
| | | | | (#195) | ||||
* | core: modify interface (#194) | Mission Liao | 2018-10-12 | 7 | -16/+29 |
| | | | | * Add a new method to notify full node about round cutting. * Modify interface to return error when preparing block | ||||
* | core: latticeData supports config change (#190) | Mission Liao | 2018-10-12 | 12 | -594/+799 |
| | | | | | | | | | | | | | | | * 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: change interface (#193) | Mission Liao | 2018-10-11 | 17 | -75/+94 |
| | | | | | | | * Extract types.FinalizationResult * Change interface: - Application.BlockConfirmed returns whole block. - Application.BlockDelivered returns partial result. | ||||
* | core: Move BlockConfirmed to Application interface (#192) | Mission Liao | 2018-10-11 | 3 | -5/+5 |
| | | | | | | | | When a block is confirmed, all its txs are permitted to be executed. Therefore, exporting this method provides more and earlier information about txs to be executed, and helps application layer to process txs more efficiently. | ||||
* | core: types: fix nodeID generation (#191) | Wei-Ning Huang | 2018-10-11 | 4 | -6/+10 |
| | | | | | Use ethereum style nodeID generation (keccak on compressed public key without the first byte). | ||||
* | Fix typo in crypto (#186) | Jimmy Hu | 2018-10-09 | 2 | -2/+16 |
| | |||||
* | core: Add round to DKG methods in gov. Change network interface name (#185) | Jimmy Hu | 2018-10-09 | 7 | -29/+39 |
| | |||||
* | core: Add DKG final message. (#181) | Jimmy Hu | 2018-10-09 | 11 | -2/+140 |
| | |||||
* | core: update config variable name grammar and remove configuration (#184) | Wei-Ning Huang | 2018-10-08 | 7 | -62/+24 |
| | |||||
* | core: Fix timestamp (#182) | Jimmy Hu | 2018-10-08 | 2 | -5/+1 |
| | |||||
* | core: Remove round from gov.ProposeCRS (#183) | Jimmy Hu | 2018-10-08 | 4 | -7/+14 |
| | |||||
* | core: Check PrivateShare in DKGComplaint (#180) | Jimmy Hu | 2018-10-08 | 2 | -25/+75 |
| | |||||
* | core: Add block randomness in compaction-chain module (#179) | Jimmy Hu | 2018-10-08 | 5 | -32/+150 |
| | |||||
* | core: Block randomness generation. (#178) | Jimmy Hu | 2018-10-08 | 4 | -7/+73 |
| | |||||
* | core: General tsig (#177) | Jimmy Hu | 2018-10-05 | 12 | -73/+254 |
| | |||||
* | core: Add NotarySet and DKGSet to cache (#176) | Jimmy Hu | 2018-10-05 | 3 | -27/+94 |
| | |||||
* | types: Test block clone (#175) | Jimmy Hu | 2018-10-05 | 2 | -0/+73 |
| | |||||
* | core: find block in db (#174) | Mission Liao | 2018-10-05 | 6 | -78/+195 |
| | | | | | | | | | | | | | | | | | | | | * Make sure block pool is large enough It's safe to use a larger blockPool when the number of chains is smaller. * Construct latticeData via config. * Seek acked blocks in blockdb when unable to find them in memory cache. In previous implementation, we assume our cache in memory is enough to perform DAG's sanity check. However, it's no longer true when the number of chains might be changed between rounds. * Simplify purge. Remove the relation to purge block by chainStatus. | ||||
* | core: Use event to run DKG and CRS in Consensus. (#171) | Jimmy Hu | 2018-10-04 | 3 | -46/+52 |
| | |||||
* | core: Check sorted ack in sanity check (#173) | Jimmy Hu | 2018-10-04 | 3 | -0/+21 |
| | |||||
* | core: split lattice-data to another file (#172) | Mission Liao | 2018-10-04 | 4 | -1058/+1069 |
| | | | | | - Split latticeData to another file - Remove areAllAcksInLattice | ||||
* | core: Check Witness height. Add ConsensusTime and ConsensusHeight to block. ↵ | Jimmy Hu | 2018-10-04 | 15 | -49/+125 |
| | | | | (#170) | ||||
* | test: Short test applied to some long running tests (#168) | Jimmy Hu | 2018-10-04 | 2 | -2/+11 |
| | |||||
* | core: remove NumWitnessSet in governance config (#167) | Wei-Ning Huang | 2018-10-03 | 2 | -8/+3 |
| | | | | NumWitnessSet is no longer required as we don't have witness set in the design anymore. | ||||
* | core: export some crypto verification function (#166) | Wei-Ning Huang | 2018-10-03 | 3 | -7/+9 |
| | | | | | verifyDKGMasterPublicKeySignature and verifyDKGComplaintSignature are needed in the governance contract to verify the signature. Export than so fullnode can use it. | ||||
* | core: publish round based config (#165) | Mission Liao | 2018-10-03 | 9 | -32/+145 |
| | |||||
* | core: Add unit test for DKG CRS in consensus (#163) | Jimmy Hu | 2018-10-03 | 3 | -4/+120 |
| | |||||
* | core: Prevent duplicated nack complaint (#162) | Jimmy Hu | 2018-10-03 | 2 | -1/+14 |
| | |||||
* | core: remove shard (#161) | Mission Liao | 2018-10-02 | 6 | -676/+613 |
| | |||||
* | core: Export DKGGroupPublicKey and its verify function (#160) | Jimmy Hu | 2018-10-02 | 3 | -18/+21 |
| | |||||
* | core: replace reliable-broadcast with shard (#159) | Mission Liao | 2018-10-02 | 13 | -1447/+255 |
| | |||||
* | core: remove ProposeThresholdSignature/GetThresholdSignature (#158) | Wei-Ning Huang | 2018-10-02 | 3 | -33/+3 |
| | | | Also rename the argument name of ProposeCRS. | ||||
* | core: run DKG and CRS at background. (#155) | Jimmy Hu | 2018-10-02 | 14 | -52/+134 |
| | |||||
* | core: update data model to reflect new model (#157) | Wei-Ning Huang | 2018-10-01 | 20 | -571/+45 |
| | | | | | | Update data model: 1) Remove witness ack. 2) Add round to block. 3) Update governance interface. | ||||
* | core: check block timestamp (#156) | Jimmy Hu | 2018-10-01 | 3 | -29/+73 |
| | |||||
* | test: Non-qualified node are accepted in test. (#154) | Jimmy Hu | 2018-10-01 | 4 | -12/+25 |
| | |||||
* | core: use notarySet for BA module. (#153) | Jimmy Hu | 2018-10-01 | 7 | -70/+96 |
| | |||||
* | core: integrate authenticator (#150) | Mission Liao | 2018-09-30 | 11 | -191/+152 |
| | |||||
* | test: tcp handshake (#151) | Jimmy Hu | 2018-09-30 | 1 | -49/+175 |
| | |||||
* | core: Allow more time for DKG to finish on CircleCI machine. (#152) | Jimmy Hu | 2018-09-29 | 1 | -1/+1 |
| | |||||
* | core: remove legacy mode (#149) | Mission Liao | 2018-09-28 | 5 | -65/+42 |
| | |||||
* | core: Add sizes of various nodeSets (#148) | Jimmy Hu | 2018-09-28 | 2 | -6/+51 |
| | |||||
* | core: hide types.NodeID from full node. (#147) | Mission Liao | 2018-09-28 | 15 | -208/+503 |
| | | | | | | | | | * Refine core.Governance interface - Remove types.NodeID from interface declaration. - All parameter should be round based. * Add core.NodeSetCache * Agreement accepts map of nodeID directly. * test.Transport.Peers method return public keys. | ||||
* | types: NodeSet and Selector (#146) | Jimmy Hu | 2018-09-27 | 2 | -0/+203 |
| | |||||
* | core: update governance interface and config (#145) | Wei-Ning Huang | 2018-09-27 | 5 | -35/+37 |
| | | | | | | 1) Remove RoundHeight from config. 2) NotarySet is not from governance contract, we get Node set intead. Notary set is caculated from the NodeSet using CRS. 3) CRS is not in the governance interface. | ||||
* | core: rename crypto/eth to crypto/ecdsa (#144) | Wei-Ning Huang | 2018-09-26 | 13 | -39/+39 |
| | |||||
* | core: use dexon-foundation/dexon instead of ethereum/go-ethereum (#143) | Wei-Ning Huang | 2018-09-26 | 2 | -2/+2 |
| | |||||
* | Fix racing (#142) | Jimmy Hu | 2018-09-26 | 1 | -3/+6 |
| | |||||
* | crypto: sigtopub to crypto package. remove SigToPubFn (#141) | Jimmy Hu | 2018-09-26 | 26 | -131/+150 |
| | |||||
* | core: move crypto to core/crypto (#140) | Mission Liao | 2018-09-26 | 37 | -108/+1373 |
| | | | | | | | | | - Move key-holder to authenticator Make core.keyHolder public as core.Authenticator, it is not required to make this part an interface. - Make private when there is no need to go public. - Fix data race | ||||
* | Fix race (#138) | Jimmy Hu | 2018-09-26 | 1 | -1/+16 |
| | |||||
* | core: configuration chain test (#137) | Jimmy Hu | 2018-09-26 | 4 | -5/+225 |
| | |||||
* | core: run TSIG for first configuration block at startup (#135) | Jimmy Hu | 2018-09-26 | 11 | -58/+427 |
| | |||||
* | core: update governance interface to consider genesis state (#136) | Wei-Ning Huang | 2018-09-25 | 13 | -80/+108 |
| | |||||
* | Fix naming of methods (#134) | Mission Liao | 2018-09-25 | 9 | -74/+74 |
| | | | | | | - BlockDeliver -> BlockDelivered - TotalOrderingDeliver -> TotalOrderingDelivered - WitnessAckDeliver -> WitnessAckDelivered - VerifyPayload -> VerifyPayloads | ||||
* | core: add debug (#133) | Mission Liao | 2018-09-25 | 11 | -174/+169 |
| | | | | | | | | | | | | | | | | | | | | | * Split interface * Rename nonblocking-application to nonblocking Parts needs nonblocking gets more. * Implement core.nonBlocking based on interface split * Fix: the witness parent hash could be parent on compaction chain. * Rename Application.DeliverBlock to BlockDeliver To sync with naming of other methods. * Change methods' fingerprint - BlockConfirmed provides block hash only. - BlockDeliver provde a whole block. | ||||
* | core: add key holder (#130) | Mission Liao | 2018-09-25 | 3 | -0/+220 |
| | | | | | The purpose to add this module is to export the functionality to sign/verify data without exporting private key directly. | ||||
* | core: Fix random test failure (#131) | Jimmy Hu | 2018-09-25 | 1 | -1/+1 |
| | |||||
* | core: run first DKG at startup. (#129) | Jimmy Hu | 2018-09-23 | 9 | -40/+239 |
| | |||||
* | core: add shard (#127) | Mission Liao | 2018-09-21 | 5 | -29/+423 |
| | | | | | | | A shard is basically DEXON v1 components, except the strongly acked part, including: - maintaining lattice structure - total ordering - generate consensus timestamp | ||||
* | test: fix block generator (#126) | Mission Liao | 2018-09-21 | 6 | -76/+99 |
| | | | | | | | | * 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 | ||||
* | core: add anti-complaint and nack-complaint to dkg protocol (#123) | Jimmy Hu | 2018-09-21 | 4 | -35/+282 |
| | |||||
* | core: refactor witness data processing flow (#124) | Wei-Ning Huang | 2018-09-20 | 9 | -33/+118 |
| | | | | | | | | | | | Since witness data need to include data from application after it processed a block (e.g. stateRoot). We should make the process of witness data asynchronous. An interface `BlockProcessedChan()` is added to the application interface to return a channel for notifying the consensus core when a block is processed. The notification object includes a byte slice (witenss data) which will be include in the final witness data object. | ||||
* | core: add blockpool (#121) | Mission Liao | 2018-09-20 | 5 | -22/+190 |
| | | | | | | core.blockPool is used to cache blocks arrived out-of-order. Our consensus should retry those blocks after their acking blocks added to lattice. | ||||
* | core: add blocklattice (#117) | Mission Liao | 2018-09-20 | 2 | -0/+992 |
| | | | | | | | | | | | | | blocklattice is used to replace reliable broadcast. Aiming to fix these problems: - The mechanism related to strong ack is no longer required. - The sanity-check of one block would be passed even if its acking block doesn't exist. This commit doesn't include logic to handle out-of-order blocks. It should be done in another PR. | ||||
* | Rename validator* to node* (#120) | Mission Liao | 2018-09-20 | 42 | -916/+919 |
| | |||||
* | core: Add dkg test (#119) | Jimmy Hu | 2018-09-19 | 1 | -0/+194 |
| | |||||
* | core: rename Notary (Acks) to Witness (#118) | Wei-Ning Huang | 2018-09-19 | 15 | -218/+218 |
| | |||||
* | core: Nack Complaint (#116) | Jimmy Hu | 2018-09-19 | 2 | -11/+83 |
| | |||||
* | core:DKG and TSIG protocol (#115) | Jimmy Hu | 2018-09-19 | 5 | -5/+698 |
| | |||||
* | core: refine governance interface to reduce Get* methods (#114) | Wei-Ning Huang | 2018-09-18 | 6 | -93/+88 |
| | | | | | Since we have a bunch of static configurations in the governance contract, instead of using a Get* method for each of them, we instead implement a GetConfiguration() method to return a structure of the configurations. | ||||
* | core: remove ticker parameter from NewConsensus | Mission Liao | 2018-09-18 | 5 | -34/+97 |
| | | | | | | | | | - remove BlockProposingInterval, it's replaced by lambda. - remove ticker parameter of NewConsensus, ticker would be derived from governance. - leave a backdoor to hook the construction of ticker. - move 'Lambda' config from to consensus. | ||||
* | core: move blockdb into core package and minor change on governance ↵ | Wei-Ning Huang | 2018-09-17 | 20 | -24/+674 |
| | | | | | | | 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: DKG interface (#108) | Jimmy Hu | 2018-09-17 | 4 | -0/+102 |
| | |||||
* | cleanup (#109) | Mission Liao | 2018-09-17 | 2 | -53/+24 |
| | | | | | | - With context, we don't need stopChan - Remove core.BlockChain. - Remove unused variable. | ||||
* | core: Fix BA Fork issues (#104) | Jimmy Hu | 2018-09-13 | 4 | -69/+49 |
| | |||||
* | core: fix VerifyPayload argument (#103) | Wei-Ning Huang | 2018-09-13 | 4 | -4/+4 |
| | | | | Since we are using a byte slice for storing payload. VerifyPayload() should also accepts a byte slice. | ||||
* | core: replace acks with slice (#102) | Mission Liao | 2018-09-12 | 12 | -237/+154 |
| | |||||
* | core: types: use []byte for block Payload type (#101) | Wei-Ning Huang | 2018-09-12 | 7 | -19/+16 |
| | | | | | Change payload type to []byte instead of [][]byte to make it more generic. The user of the consensus core should marshal the payload into a byte slice by themselves. | ||||
* | core: total ordering with chain ID (#100) | Mission Liao | 2018-09-12 | 5 | -414/+363 |
| | |||||
* | simulation: integrate test.Transport (#99) | Mission Liao | 2018-09-11 | 3 | -33/+115 |
| | | | | | - Add marshaller for simulation by encoding/json - Implement peer server based on test.TranportServer - Remove network models, they are replaced with test.LatencyModel | ||||
* | core: timestamp (#98) | Jimmy Hu | 2018-09-11 | 11 | -356/+170 |
| | |||||
* | test: add transport layer (#97) | Mission Liao | 2018-09-10 | 5 | -0/+1142 |
| | | | | | | | | | | The purpose of transport layer is to abstract the way to send messages and setup connections between peers in a p2p network. The peer discovery is simulated by a hosted server: every peer sends its address to a known server. Once collecting enough peers, respond the whole peers lists to all peers. Changes: - Add test.Trasnport interface - Add test.Transport implementation by golang channel. - Add test.transport implementation by TCP connection. - Move LatencyModel to core/test package - Add Marshaller interface | ||||
* | misc: Polish BA. (#94) | Jimmy Hu | 2018-09-05 | 5 | -31/+36 |
| | |||||
* | core: BA-based consensus core. (#93) | Jimmy Hu | 2018-09-04 | 10 | -103/+592 |
| | |||||
* | Add GetChainNumber to Goverance (#92) | Jimmy Hu | 2018-09-03 | 2 | -0/+8 |
| | |||||
* | core: minor change to governance interface (#90) | Wei-Ning Huang | 2018-09-03 | 4 | -62/+30 |
| | |||||
* | core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵ | Jimmy Hu | 2018-09-03 | 20 | -215/+411 |
| | | | | `Height` from `Block` (#89) | ||||
* | Fix VerifyPayloads in nonBlockingApplication (#87) | Jimmy Hu | 2018-08-31 | 1 | -1/+1 |
| | |||||
* | Add methods to Application interface. (#86) | Jimmy Hu | 2018-08-31 | 5 | -0/+45 |
| | |||||
* | Use Network in Consensus core (#85) | Jimmy Hu | 2018-08-31 | 2 | -1/+116 |
| | |||||
* | core: Add PreparePayloads to Application and Remove blockConverter ↵ | Jimmy Hu | 2018-08-30 | 10 | -66/+57 |
| | | | | interface. (#84) | ||||
* | core: Change the lattice key from validatorID to chainID. (#83) | Jimmy Hu | 2018-08-30 | 5 | -97/+176 |
| | | | | | * Add chainID in simulation.Validator * Change validatorid to chainID in rbModule | ||||
* | core: tune total ordering performance (#81) | Mission Liao | 2018-08-30 | 9 | -443/+592 |
| | | | | | - Replace map with slice Compared to slice, accessing to map is slower and the memory usage is inefficient. | ||||
* | Copy block (#82) | Jimmy Hu | 2018-08-30 | 1 | -0/+2 |
| | |||||
* | core: Leader Selector. (#80) | Jimmy Hu | 2018-08-30 | 9 | -23/+287 |
| | |||||
* | core: Remove channel in agreement (#79) | Jimmy Hu | 2018-08-29 | 3 | -172/+111 |
| | |||||
* | crypto test for vote (#78) | Jimmy Hu | 2018-08-29 | 1 | -0/+18 |
| | |||||
* | core: Add agreement module (#77) | Jimmy Hu | 2018-08-29 | 4 | -0/+1086 |
| | |||||
* | core: tune performance (#73) | Mission Liao | 2018-08-28 | 5 | -155/+489 |
| | | | | | | | | | | | | | | | | | | | | | | - 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: Add vote type and add field to block. (#76) | Jimmy Hu | 2018-08-28 | 4 | -4/+115 |
| | |||||
* | core: Notary ack application. (#70) | Jimmy Hu | 2018-08-22 | 5 | -0/+58 |
| | |||||
* | simulation: add simulation with scheduler (#71) | Mission Liao | 2018-08-21 | 6 | -41/+76 |
| | | | | | | | | - Add new field in test.Event: HistoryIndex HistoryIndex allow us to access them by their position in event history. - Record local time in test.App when receiving events. - Add statisitics module for slices of test.Event. - add new command line utility *dexcon-simulation-with-scheduler to verify the execution time of core.Consensus. |