aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus.go
Commit message (Collapse)AuthorAgeFilesLines
* utils: fix logic to trigger round events (#575)Mission Liao2019-04-191-33/+2
| | | | | Merge the code to check if DKG valid in: - trigger next round event - check if resetting DKG is required
* core: add whether to report to VerifyPSig (#572)Jimmy Hu2019-04-151-7/+8
| | | | | | * core: add whether to report to VerifyPSig * fixup
* core: start next BA only when previous block delivered (#571)Jimmy Hu2019-04-151-0/+4
|
* core: Add DKGSuccess (#569)Jimmy Hu2019-04-151-0/+16
| | | | | | * core: Add DKGSuccess * core: reset if not enough of dkg success
* core: add log to verify psigJimmy Hu2019-04-131-0/+10
|
* core: add report bad peer interface to network (#559)Jimmy Hu2019-04-121-12/+30
|
* core: change CRSSignature with bls (#563)Jimmy Hu2019-04-111-0/+8
|
* core: priority process self message (#557)Jimmy Hu2019-04-091-5/+17
| | | | | | | | * core: priority process self message * fix * fixup
* core: remove payload from reportForkBlock (#555)Jimmy Hu2019-04-091-1/+5
|
* core: refine VerifyAgreementResult (#553)Mission Liao2019-04-081-1/+5
| | | | | | | | * Pass notary set directly to VerifyAgreementResult * Fix core.Consensus * Fix syncer
* core: run TSig forever when ForceSync (#554)Jimmy Hu2019-04-081-1/+5
|
* core, core: crypto: dkg: fix concurrent access bug (#551)Jimmy Hu2019-04-061-1/+6
| | | | | | * core: crypto: dkg: fix concurrent access bug * core: fix concurrent bug
* core: optimize message handle (#542)Jimmy Hu2019-04-021-20/+65
| | | | | | | | * core: optimize for handling agremenet result * core: disable clone vote * core: touch npks
* core: fix 'round not change' bug in receiver (#538)Jimmy Hu2019-04-021-63/+18
| | | | | | * core: remove round and round change height in recv * fixup
* core: clean TODOs (#539)Mission Liao2019-04-011-35/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * core: fix block timestamp (#529) * Remove TODO dMoment is still required when the block timestamp of the genesis block is still need to be verified. * Refine timestamp when preparing blocks * Add timestamp checking in sanity check * Revert code to patch position when preparing * Remove TODOs that seems meaningless now * Remove TODOs related to refactoring * core: remove finalization (#531) - Remove types.FinalizationResult, randomness field would be moved to `types.Block` directly. - Add a placeholder for types.Block.Randomness field for blocks proposed from round < DKGDelayRound. (refer to core.NoRand) - Make the height of the genesis block starts from 1. (refer to types.GenesisHeight) - The fullnode's behavior of core.Governance.GetRoundHeight is (assume round-length is 100): - round: 0 -> 0 (we need to workaround this) - round: 1 -> 101 - round: 2 -> 201 - test.Governance already simulate this behavior, and the workaround is wrapped at utils.GetRoundHeight. * core: fix issues (#536) fixing code in these condition: - assigning position without initializing them and expected it's for genesis - compare height with 0
* core: touch node cache even in reset (#537)Jimmy Hu2019-04-011-3/+0
|
* core: Fix invalid block height when triggering init round event (#533)Mission Liao2019-03-291-12/+1
|
* core: run dkg by height (#527)Jimmy Hu2019-03-291-4/+12
| | | | | | | | * core: run dkg by height * core: check cc.dkgCtx before running each dkg phases * fix
* core: reset DKG if to less qualified nodes (#528)Jimmy Hu2019-03-291-2/+6
|
* core: fix issues (#525)Mission Liao2019-03-281-15/+10
| | | | | * Refine the logic to append config * Potential fix for round not increase when fast syncing
* core: workaround for GetRoundHeight (#526)Jimmy Hu2019-03-281-2/+10
|
* core: add log for restarting BA (#524)Jimmy Hu2019-03-281-0/+1
| | | | | | * core: add log for restart BA * Add log for changing round
* core: workaround for GetRoundHeight (#523)Jimmy Hu2019-03-271-2/+4
| | | | | | | | * core: workaround for GetRoundHeight * update gopkg.lock * x
* core: fix issues (#522)Jimmy Hu2019-03-271-1/+4
| | | | | | | | * required vote calculation * fix agreement result * core: fix initRound issue of BA
* core: sign block hash for empty block (#517)Jimmy Hu2019-03-271-3/+111
| | | | | | * core: sign block hash for empty block * run force synced empty block at startup
* core: bring back agreement result (#515)Jimmy Hu2019-03-271-19/+29
| | | | | | | | | | * core: bring back agreement result * add logger * Fix * fixup
* core: Remove agreement result (#514)Jimmy Hu2019-03-271-42/+93
| | | | | | | | | | | | * core: remove agreement result for round with randomness * remove agr test in syncer * fixup * remove randomness field from agreement result * modify test
* core: merge notarySet and DKGSet (#488)Jimmy Hu2019-03-271-202/+181
| | | | | | | | | | | | | | * core: さよなら DKGSet * test logger * temporary fix before finalized * core: Sign psig on commit vote * Add syncer log * fixup
* core: refine DKG aborting (#512)Mission Liao2019-03-231-8/+11
| | | | | | | | | | | | | | | | | | * Avoid aborting the DKG protocol registered later Although that DKG protocol would be registered after 1/2 round, both of them are triggered in separated go routine and we shouldn't assuem their execution order. * Capitalize logs * Add test * Return aborted when not running * Log DKG aborting result * Remove duplicated DKG abort
* core: remove initRoundBeginHeight paramenterMission Liao2019-03-221-13/+11
| | | | * Implement Governance.GetRoundHeight in test.Governance.
* core: abort hang DKG (#508)Mission Liao2019-03-221-12/+12
| | | | | | | | | | | | | | | | | | | | | | | * Capitalize log * Fix DKG aborting hangs Make sure reset cc.dkg to nil in runDKG * Remember to purge tsig verfier too * Replace abortCh with context.Context * Fix obvious bug * Fixup: forever blockin at Wait method when runDKG is not called * Fixup: fix corner case If the Add(1) moved to runDKG under cc.dkgLock, we may not catch it after unlocking cc.dkgLock. * fixup
* core: height event handlers are not called (#509)Mission Liao2019-03-221-47/+54
| | | | | | | * Make utils.RoundEvent.ValidateNextRound non-blocking * Make NotifyHeight called blockingly * Trigger all height event handlers that should be triggered by initBlock * Fixup: forget the syncer part
* core: reset DKG (#502)Mission Liao2019-03-201-10/+110
| | | | | | | | | | | | | | * Allow utils.NodeSetCache to purge by rounds. * Purge utils.NodeSetCache when DKG reset. * Add a utils.RoundEvent handler to abort all previous running DKG * Fix test.App hangs in BlockDelivered when utils.RoundEvent is attached. ValidateNextRound is a blocking call and would block test.App.BlockDelivered.
* core: remove round from addDKG fuction (#501)Jimmy Hu2019-03-191-4/+4
|
* core: snapshot DKG protocol struct when finish any phase (#496)bojie2019-03-181-5/+1
|
* test: try to mitigate flaky tests (#498)Mission Liao2019-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add assertion to make sure all nodes are synced. * Retry round event with BA's interval We are about to modify lambdaDKG with block height, instead of timing. Therefore, the last interval we could use is BA's interval. * Check ctx in inifite loop * Disable this panic temporary If a fast sync triggered by receiving types.AgreementResult from later position, this panic would be triggered 100%, ex. current-round: 1, change-notary-height: 120, agreeemnt-result from round:2 height:121 However, I don't have easy way to fix it temporary. * Lower down the test size for TCP * Fix typo * Fixup: revert the removed panic
* dkg: add reset field (#492)Mission Liao2019-03-171-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | * Add Reset fields to DKG types * Fix crypto part after adding Reset field * Prohibit DKG messages with different resetCount * Add TODO * Add reset parameter to dkgProtocol constructor * Add TODO * Fix inconsist hash to prepare CRS * Add reset parameter when runnning DKG * Fix test for utils.RoundEvent * Add dummy test to prohibit DKG messages with unexpected reset count * Fix test.App
* core, syncer: integrate utils.RoundEvent (#490)Mission Liao2019-03-161-185/+146
|
* core/syncer: add force sync (#468)Jimmy Hu2019-03-151-61/+80
| | | | | | | | | | | | | * core: Add Recovery Interface * core/syncer: modify recovery interface * core: fix Recovery interface * core/syncer: rename terminator to watchcat (#491) * core/syncer: rename terminator to watchcat * Add error log * Rename Pat to Feed * core/syncer: add force sync * run prepareRandomness if round >= DKGDelayRound * Add test for Forcsync
* core: recover DKG master private shares (#487)bojie2019-03-131-1/+5
|
* utils: add RoundEvent (#482)Mission Liao2019-03-131-2/+2
| | | | | * Move core.roundBasedConfig to core/utils * Refine utils.RoundBasedConfig * Add utils.RoundEvent
* core: touch tsigVerifier in blockchain module (#486)Jimmy Hu2019-03-121-0/+4
|
* core: move some dkg utils (#476)Mission Liao2019-03-111-1/+1
| | | | | | * Move core.getDKGThreshold to core.utils.GetDKGThreshold * Move core.DKGGroupPublicKey to typesDKG.GroupPublicKey
* core: reduce blockrandomness message (#477)Jimmy Hu2019-03-101-0/+3
| | | | | | * core: reduce blockchain randomness msg * add test
* core: fix empty parent not found (#470)Mission Liao2019-03-081-1/+9
| | | | * Do not panic when empty block is unable to propose * Make blockChain able to handle pulled empty block
* core: Only accept block from nodeset (#467)Jimmy Hu2019-03-071-0/+8
|
* core: PreparePayload/Witness for genesis block (#465)Jimmy Hu2019-03-071-5/+0
|
* core: touch nodeSetCache (#466)Jimmy Hu2019-03-071-0/+10
|
* core: only check block hash and signature for pulled baConfirmed block (#464)Jimmy Hu2019-03-061-7/+5
|
* core: first few round will not have DKG (#455)Jimmy Hu2019-03-041-33/+22
| | | | | | | | | | | | | | * core: Add DKGDelayRound constant * core: use constant value * core, utils: set DKGDelayRound for utils. * test: add dkgDelayRound to state * core: do not run dkg and crs for round < DKGDelayRound * fix test
* core: Change RoundInterval to RoundLength (#453)Jimmy Hu2019-02-261-7/+7
|
* core: switch round by block height (#450)Mission Liao2019-02-201-113/+111
|
* core: fix stuffs (#448)Jimmy Hu2019-02-191-16/+21
| | | | | | | | | | * Add log * core: delay first dkg * Fix test * core: only runDKG in prepare at round 0
* big-bang: single chain (#446)Mission Liao2019-02-191-192/+109
|
* core: Optimize message processing (#434)Jimmy Hu2019-01-261-41/+48
| | | | | | | | | | | | | | | | * core: more strict with 'first' agreement result * core: Fast filter randomness result and agreement result * Optimize touchAgreementResult * core: remove lock in checking first block randomness * psig to go routine * polish * core: polish
* core: Reduce rebroadcast BA result (#433)Jimmy Hu2019-01-251-3/+12
| | | | | | | | | | * core: reduce processing duplicated agreement result * 放這邊應該比較好 * 放這邊才對 * Add TODO
* core: reduce rand result rebroadcast (#432)Jimmy Hu2019-01-241-0/+5
|
* core: Add vote filter (#430)Jimmy Hu2019-01-241-1/+1
| | | | | | | | | | | | * core: ignore usless vote * core: export SkipBlockHash and NullBlockHash * core: add VoteFilter * Add test * New VoteFilter for each round
* core: remove Governance.NotifyRoundHeight (#431)Mission Liao2019-01-241-12/+5
|
* core: optimize core (#428)Jimmy Hu2019-01-231-13/+26
| | | | | | | | | | | | | | * core: Use a channel to process ba confirmed block * change the implementation of done() to react faster * Fix restart * Wait tipRound to change * fix corner case * Check for context
* core: fix issue (#427)Mission Liao2019-01-211-3/+0
| | | | | | | | * Dropped block should not be added to db - Here "dropped" means a block is older than current tip of that chain. * "Acking blocks doesn't exist" should be treated as an error when adding a block
* core: Fix stuffs (#422)Jimmy Hu2019-01-181-8/+0
| | | | | | * core: reduce syncing ba msg * core: fix checking period of agreement result
* core: find confirmed block in pending set and candidate set (#419)Mission Liao2019-01-161-1/+1
|
* core: Fix BA3.0 (#420)Jimmy Hu2019-01-151-1/+2
| | | | | | | | | | | | | | | | | | * Add Restart to Ticker * Change pre allocated size * Return NextTime from lattice * Few hacky fixes for BA * PullVote in FastRollback state * Add shallowBlock for agreementResult * Extend period * Fixup
* syncer: fix issues when switching to core.Consensus (#418)Mission Liao2019-01-111-10/+119
| | | | | | | | | | | | | | | | - when confirmed blocks passed to core.Consensus aren't continuous in position in some chain, the pulling would skip those missing blocks. - fix: when some block is missing, avoid adding it and all blocks after it to core.Consensus. - we need to avoid the receive channel of network module full. - fix: during switching to core.Consensus, we need to launch a dummy receiver to receive from receive channel of network module. - fix: between the period during core.Consensus created and before running, a dummy receiver is also required to receive from receive channel of network module.
* core: fix issues in consensus core (#415)Jimmy Hu2019-01-101-6/+21
|
* core: panic after no blocks delivered for 1 minute (#414)Jimmy Hu2019-01-091-16/+40
|
* core: report fork (#409)Mission Liao2019-01-081-0/+8
|
* core: BA 3.0 (#408)Jimmy Hu2019-01-071-6/+9
| | | | | | | | | | | | | | * Add v3 enum * Add BA leader calculation * Fast BA * Add unittest for Fast BA * Add comment * Select leader in notarySet
* core: remove useless branching code (#403)wmin02019-01-071-6/+2
|
* core: fix stuffs (#401)Mission Liao2019-01-051-2/+5
| | | | | | | * Remove block recycling mechanism * Return directly when previous DKG is not finished. * Adjust some logging level * Skip pulling when hashes to pull is empty
* Fix TODO (#390)Mission Liao2019-01-021-6/+9
|
* core: Polish randomness (#385)Jimmy Hu2018-12-261-4/+2
|
* core: fix stuffs (#383)Mission Liao2018-12-261-116/+65
| | | | | | * Merge core.Consensus constructors * Downgrade severity of logs * Refine logic to add blocks from pool to lattice * Add test.LaunchDummyReceiver
* core: pull block random (#384)Jimmy Hu2018-12-261-16/+40
| | | | | | | | * Add PullRandomness to interface * Add pendingBlocksWithoutRandomness to compactionChain * Pull randomness every 1 second
* core: fix issues found when testing syncing. (#379)Mission Liao2018-12-241-12/+30
| | | | | | | | * Avoid panic when stopping multiple times. * Fix syncer panic when round switching * Add getCurrentConfig to total-ordering, and panic with more info * Avoid infinite loop.
* core: simulation: add throughput and block event monitoring (#380)haoping-ku2018-12-221-1/+33
| | | | | | | | | | | * core: simulation: add throughput and block event monitoring Added throughput and block event monitoring in TCP-local network. These data is collected by nodes and reported to peer server. * fix issues * fix sent time of throughput issue
* utils: move authenticator to utils package (#378)Mission Liao2018-12-221-21/+21
|
* core: Add TODOJimmy Hu2018-12-201-0/+1
|
* core: Add VerifyDKGMPKReadySignature (#377)Jimmy Hu2018-12-201-1/+1
| | | | | | * core: Add VerifyDKGMPKReadySignature * Fix typo
* core: deliver finalized blocks upon receiving randomness results. (#376)Mission Liao2018-12-201-9/+24
|
* core: Add a `MPKReady` so `MasterPublicKey` cannot be added afterwards (#375)Jimmy Hu2018-12-191-1/+11
| | | | | | | | | | | | | | | | * Add type DKGReady * Add DKGReady to interface and state * DKG will wait for MPK to be ready before running * Modify test * Check if self's MPK is registered * Add test for delay add MPK * Rename Ready to MPKReady
* misc: panic not ready (#374)Mission Liao2018-12-181-34/+15
| | | | | | | | | | | | | | | | * Panic when config/crs not ready For those calls to Governace.Configuration and Governance.CRS without checking returns, replace those calls with these newly added helpers: - utils.GetConfigurationWithPanic - utils.GetCRSWithPanic They would check returns, and panic directly if not ready yet. * Fix a bug that config is not ready when syncing
* syncer: fix stuffs (#373)Mission Liao2018-12-181-1/+6
| | | | | | | | | | | | * Add a new method: GetSyncedConsensus This method avoids calling BlockDelivered in SyncBlocks methods, which avoid potential deadlock. * Add a method to stop the syncer before synced * Enable nonBlockingApp for synced Consensus instance.
* core: cache dkg's private key in db (#371)Mission Liao2018-12-161-3/+4
|
* db: cache compaction chain tip in db (#369)Mission Liao2018-12-131-7/+11
| | | | | * Replace JSON with RLP in levelDB implementation. * Make sure blocks to sync following compaction chain tip
* core: check if CRS is proposed before running CRS (#368)Jimmy Hu2018-12-131-9/+12
|
* db: rename blockdb to db (#367)Mission Liao2018-12-131-6/+6
| | | | | | | | | | * 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
* syncer: fix stuffs (#366)Mission Liao2018-12-121-28/+48
| | | | | | | | | | * 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: fix bugs found when node-set is not equal to notary-set (#362)Mission Liao2018-12-071-32/+51
|
* Haoping fix simulation (#356)haoping-ku2018-12-051-5/+16
| | | | | | | | | | | | | | | * simulation: add benchmark features * tmp * simulation: modify Debug interface * Added BlockReceived and BlockReady function to Debug interface. * Added Benchmark features. * fix * fix typos
* core: log the last pending block in compaction chain (#355)Mission Liao2018-12-041-2/+3
|
* core: Fix stuffs (#354)Jimmy Hu2018-12-041-0/+9
| | | | | | - Add common.CustomLogger - CRS will wait for DKG to finish - Fix core.agreementMgr.processAgreementResult
* core: construct consensus from syncer (#352)Mission Liao2018-12-041-39/+142
|
* core: Fix stuffs (#351)Jimmy Hu2018-11-301-1/+1
| | | | | | * Use non-blocking app in consensus core * Prevent panic when getting nextHeight
* core: remove finalized from compaction-chain module (#350)Mission Liao2018-11-301-33/+3
| | | | | | | | | | | | * 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]
* core: syncer: add syncer (#346)haoping-ku2018-11-291-37/+2
|
* core: Fix stuffs (#342)Jimmy Hu2018-11-271-2/+53
|
* core: support NumChains change for BA modules (#339)Mission Liao2018-11-201-199/+87
|
* core: Block randomness will be processed again in finalized block (#338)Jimmy Hu2018-11-201-20/+4
| | | | | | * Process randomness result in finalized block if missed * Add test for missing block randomness
* core, test: Fix various issues (#337)Jimmy Hu2018-11-191-1/+3
|
* core: Handle issues if DKG/CRS is already finished (#334)Jimmy Hu2018-11-181-33/+10
|
* core: Fix various syncing issue. (#331)Jimmy Hu2018-11-161-18/+25
|
* core: Fix issues in syncing mode (#329)Jimmy Hu2018-11-151-0/+6
|
* core: Fix syncing issues (#326)Jimmy Hu2018-11-141-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 Liao2018-11-141-3/+4
|
* core: Integrate totalOrdering syncer (#322)Jimmy Hu2018-11-131-0/+2
|
* core: expose implicit round shift (#321)Mission Liao2018-11-131-10/+5
|
* core: Reduce call to Application.VerifyBlock (#317)Jimmy Hu2018-11-131-2/+1
|
* test: add integration test (#315)Mission Liao2018-11-111-4/+0
| | | | | | * 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
* simulation: use test.Governacne in simulation (#311)Mission Liao2018-11-081-1/+2
| | | | | | | | | | | | * 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: revert the revert for broken commit and fix (#309)Mission Liao2018-11-081-67/+78
| | | | | | | | * 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 Hu2018-11-081-10/+34
|
* Revert "core: unbind global round in Consensus (#304)" (#306)Mission Liao2018-11-081-59/+57
| | | This reverts commit 3714ebf2f1054d9984d37b89cf17e885a5856532.
* core: unbind global round in Consensus (#304)Mission Liao2018-11-061-57/+59
|
* core: Run DKG stuffs only if the node is in DKG set (#302)Jimmy Hu2018-11-061-15/+46
|
* core: lattice-data: fix details and add test (#299)haoping-ku2018-11-061-1/+1
|
* core: Fix deadlock (#298)Jimmy Hu2018-11-051-0/+9
|
* core: notify consensus height for genesis rounds (#296)Mission Liao2018-11-051-1/+7
| | | | * Add notifyGenesisRounds * Log round for types.Vote and types.Block
* core: Fix dkg and CRS signature (#294)Jimmy Hu2018-11-051-3/+3
|
* core: Fix BA stuffs (#293)Jimmy Hu2018-11-051-1/+4
|
* core: Fix fork vote (#290)Jimmy Hu2018-11-031-4/+4
|
* core: reset CRS in leader selector by round (#286)Mission Liao2018-11-021-14/+10
|
* core: block deliver with position (#289)Mission Liao2018-11-021-1/+1
| | | | | 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 Hu2018-11-021-0/+3
|
* Rename repo to dexon-consensusWei-Ning Huang2018-11-021-10/+10
|
* core: Fix various locking issues (#285)Jimmy Hu2018-11-021-17/+23
|
* core: fix possible fork vote (#283)Jimmy Hu2018-11-011-1/+1
|
* core: Add PullVotes to Network. (#281)Jimmy Hu2018-10-311-0/+6
|
* core: fix NotifyRoundHeight is not called when processing blocksMission Liao2018-10-311-10/+16
| | | - also add missing logs when calling Application.BlockDelivered.
* core: Fix goroutine leaks (#270)Jimmy Hu2018-10-291-0/+1
|
* core: Unit test for BA sync (#265)Jimmy Hu2018-10-261-0/+13
|
* core: sync BA (#264)Jimmy Hu2018-10-261-15/+40
|
* core: Pull block (#263)Jimmy Hu2018-10-261-23/+65
|
* core: Leader selector will retry sanityCheck (#261)Jimmy Hu2018-10-261-3/+8
|
* core: Lock entire lattice.ProcessBlock (#259)Jimmy Hu2018-10-261-0/+4
| | | | | | * Lock entire ProcessBlock * Lock Consensus.processBlock
* core: lattice sync (#257)Jimmy Hu2018-10-251-9/+6
|
* core: Move dkg in types to types/dkg. (#253)Jimmy Hu2018-10-251-7/+8
|
* core: fix stuffs (#250)Mission Liao2018-10-241-2/+2
| | | | | | | | * 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.
* core: disable nonblocking temporarily (#249)Mission Liao2018-10-241-9/+5
|
* core: reduce calls to Application.VerifyBlock (#247)Mission Liao2018-10-241-2/+2
| | | | | | * 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 Liao2018-10-241-0/+4
|
* core: notify fullnode to snapshot configs when round change. (#243)Mission Liao2018-10-231-8/+19
|
* core: add round parameter to ProposeCRS method (#244)Wei-Ning Huang2018-10-231-2/+2
| | | | | | | | 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 Hu2018-10-231-10/+5
|
* core: Change dkg timing (#241)Jimmy Hu2018-10-231-12/+17
| | | | | * Register DKG after CRS is proposed * Change round at only one place
* core: remove duplicate BroadcastRandomnessResult call (#240)Wei-Ning Huang2018-10-231-6/+1
|
* core: prepare empty block if null block is confirmed by BA. (#231)Jimmy Hu2018-10-231-6/+35
|
* core: fix uninitialized variable in configuration chain (#238)Wei-Ning Huang2018-10-221-1/+1
|
* core: Handling self proposed DKG private share (#236)Jimmy Hu2018-10-221-11/+22
|
* core: fix logging for SendDKGPrivateShare (#234)Wei-Ning Huang2018-10-201-1/+2
|
* Start Run() until dMoment. (#233)Jimmy Hu2018-10-201-0/+2
|
* core: initial commit for logger (#228)Mission Liao2018-10-191-36/+107
| | | | | | | | | | | | | * 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
* core: Append all config till Initial block (#225)Jimmy Hu2018-10-181-0/+7
|
* core: sync compaction chain (#222)Jimmy Hu2018-10-181-1/+19
|
* core: Add init block to Run() (#221)Jimmy Hu2018-10-181-1/+2
|
* core: Some sync functions (#220)Jimmy Hu2018-10-171-4/+20
|
* core: Rebroadcast agreement and randomness result. (#218)Jimmy Hu2018-10-171-18/+28
|
* core: Add stop function to all components (#216)Jimmy Hu2018-10-171-4/+11
|
* core: New dexon ba (#210)Jimmy Hu2018-10-161-5/+16
|
* core: Change First round dkg timing (#209)Jimmy Hu2018-10-161-4/+5
|
* core: Change threshold (#205)Jimmy Hu2018-10-151-1/+1
|
* Remove duplicated dMoment in Consensus.Run (#206)Jimmy Hu2018-10-151-2/+4
|
* core: Change DKG threshold (#204)Jimmy Hu2018-10-151-2/+2
|
* core: Fix simulation errors. (#202)Jimmy Hu2018-10-151-28/+32
|
* core: fix simulation error (#201)Jimmy Hu2018-10-151-2/+2
| | | | | * Sync dMoment for all consensus core * App check for randomness ignore round 0
* core: No randomness for round 0 (#198)Jimmy Hu2018-10-151-0/+6
| | | | | * No randomness for round 0 * Ignore round 0 randomness
* core: latticeData supports config change (#190)Mission Liao2018-10-121-8/+8
| | | | | | | | | | | | | | | * 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 Liao2018-10-111-6/+3
| | | | | | | * Extract types.FinalizationResult * Change interface: - Application.BlockConfirmed returns whole block. - Application.BlockDelivered returns partial result.
* core: Add round to DKG methods in gov. Change network interface name (#185)Jimmy Hu2018-10-091-4/+4
|
* core: Add DKG final message. (#181)Jimmy Hu2018-10-091-0/+9
|
* core: update config variable name grammar and remove configuration (#184)Wei-Ning Huang2018-10-081-5/+7
|
* core: Remove round from gov.ProposeCRS (#183)Jimmy Hu2018-10-081-1/+1
|
* core: Add block randomness in compaction-chain module (#179)Jimmy Hu2018-10-081-3/+13
|
* core: Block randomness generation. (#178)Jimmy Hu2018-10-081-3/+66
|
* core: General tsig (#177)Jimmy Hu2018-10-051-2/+61
|
* core: find block in db (#174)Mission Liao2018-10-051-1/+4
| | | | | | | | | | | | | | | | | | | | * 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 Hu2018-10-041-40/+44
|
* core: publish round based config (#165)Mission Liao2018-10-031-1/+1
|
* core: Add unit test for DKG CRS in consensus (#163)Jimmy Hu2018-10-031-0/+5
|
* core: remove shard (#161)Mission Liao2018-10-021-11/+11
|
* core: replace reliable-broadcast with shard (#159)Mission Liao2018-10-021-171/+50
|
* core: run DKG and CRS at background. (#155)Jimmy Hu2018-10-021-16/+71
|
* core: update data model to reflect new model (#157)Wei-Ning Huang2018-10-011-64/+2
| | | | | | Update data model: 1) Remove witness ack. 2) Add round to block. 3) Update governance interface.
* core: check block timestamp (#156)Jimmy Hu2018-10-011-0/+10
|
* core: use notarySet for BA module. (#153)Jimmy Hu2018-10-011-32/+36
|
* core: integrate authenticator (#150)Mission Liao2018-09-301-45/+31
|
* core: remove legacy mode (#149)Mission Liao2018-09-281-25/+9
|
* core: hide types.NodeID from full node. (#147)Mission Liao2018-09-281-89/+50
| | | | | | | | | * 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.
* core: update governance interface and config (#145)Wei-Ning Huang2018-09-271-6/+11
| | | | | | 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.
* crypto: sigtopub to crypto package. remove SigToPubFn (#141)Jimmy Hu2018-09-261-14/+5
|
* core: move crypto to core/crypto (#140)Mission Liao2018-09-261-1/+1
| | | | | | | | | - 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
* core: configuration chain test (#137)Jimmy Hu2018-09-261-1/+1
|
* core: run TSIG for first configuration block at startup (#135)Jimmy Hu2018-09-261-42/+35
|
* core: update governance interface to consider genesis state (#136)Wei-Ning Huang2018-09-251-52/+70
|
* Fix naming of methods (#134)Mission Liao2018-09-251-3/+3
| | | | | | - BlockDeliver -> BlockDelivered - TotalOrderingDeliver -> TotalOrderingDelivered - WitnessAckDeliver -> WitnessAckDelivered - VerifyPayload -> VerifyPayloads
* core: add debug (#133)Mission Liao2018-09-251-15/+13
| | | | | | | | | | | | | | | | | | | | | * 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: run first DKG at startup. (#129)Jimmy Hu2018-09-231-21/+163
|
* core: add shard (#127)Mission Liao2018-09-211-9/+9
| | | | | | | A shard is basically DEXON v1 components, except the strongly acked part, including: - maintaining lattice structure - total ordering - generate consensus timestamp
* core: refactor witness data processing flow (#124)Wei-Ning Huang2018-09-201-10/+42
| | | | | | | | | | | 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.
* Rename validator* to node* (#120)Mission Liao2018-09-201-24/+24
|
* core: rename Notary (Acks) to Witness (#118)Wei-Ning Huang2018-09-191-15/+15
|
* core: refine governance interface to reduce Get* methods (#114)Wei-Ning Huang2018-09-181-15/+19
| | | | | 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 NewConsensusMission Liao2018-09-181-8/+6
| | | | | | | | | - 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 Huang2018-09-171-8/+8
| | | | | | | 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.
* cleanup (#109)Mission Liao2018-09-171-27/+24
| | | | | | - With context, we don't need stopChan - Remove core.BlockChain. - Remove unused variable.
* core: Fix BA Fork issues (#104)Jimmy Hu2018-09-131-16/+16
|
* core: replace acks with slice (#102)Mission Liao2018-09-121-1/+0
|
* core: types: use []byte for block Payload type (#101)Wei-Ning Huang2018-09-121-2/+2
| | | | | 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 Liao2018-09-121-1/+1
|
* simulation: integrate test.Transport (#99)Mission Liao2018-09-111-1/+0
| | | | | - 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 Hu2018-09-111-8/+3
|
* misc: Polish BA. (#94)Jimmy Hu2018-09-051-5/+6
|
* core: BA-based consensus core. (#93)Jimmy Hu2018-09-041-27/+220
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-031-6/+10
| | | | `Height` from `Block` (#89)
* Add methods to Application interface. (#86)Jimmy Hu2018-08-311-0/+1
|
* Use Network in Consensus core (#85)Jimmy Hu2018-08-311-0/+94
|
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-301-13/+8
| | | | interface. (#84)
* core: Change the lattice key from validatorID to chainID. (#83)Jimmy Hu2018-08-301-0/+1
| | | | | * Add chainID in simulation.Validator * Change validatorid to chainID in rbModule
* core: tune total ordering performance (#81)Mission Liao2018-08-301-1/+5
| | | | | - 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-0/+4
| | | | | | | | | | | | | | | | | | | | | | - 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 Hu2018-08-281-0/+5
|
* core: Notary ack application. (#70)Jimmy Hu2018-08-221-0/+4
|
* core: Notary ack (#69)Jimmy Hu2018-08-211-35/+13
|
* core: NotaryAck interfaces. (#67)Jimmy Hu2018-08-201-6/+22
|
* core: Remove notary ack. (#64)Jimmy Hu2018-08-161-22/+25
|
* Verify consensus info and the acking's signature (#63)Jimmy Hu2018-08-161-3/+29
|
* core: Add compaction chain module. (#60)Jimmy Hu2018-08-161-0/+9
|
* core: Add a nonBlockingApplication. (#62)Jimmy Hu2018-08-151-1/+1
|
* core: Prepare Genesis block. (#54)Jimmy Hu2018-08-141-8/+45
|
* core: Sign block in Consensus.PrepareBlock. (#50)Jimmy Hu2018-08-131-2/+33
|
* core: Hash block in Consensus.PrepareBlock. (#46)Jimmy Hu2018-08-121-0/+22
| | | | | | | | * Add hash to block * Check block hash in Consensus.sanityCheck * Add hashBlockFn in block generator.go
* core: Modify Consensus interface (#45)Jimmy Hu2018-08-101-3/+21
|
* core: update governance interface and move K into config (#40)Wei-Ning Huang2018-08-101-5/+2
|
* core: Deliver only Hash to Application. (#43)Jimmy Hu2018-08-101-2/+6
|
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-081-0/+130
* 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.