aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils
Commit message (Collapse)AuthorAgeFilesLines
* core: remove payload from reportForkBlock (#555)Jimmy Hu2019-04-092-1/+12
|
* core: filter vote if already processed (#552)Jimmy Hu2019-04-082-1/+20
| | | | | | * core: more aggresive vote filter * add test
* core/crypto/dkg: concurrent access for gpk (#548)Jimmy Hu2019-04-043-3/+3
| | | | | * core/crypto/dkg: add benchmark * core/crypto/dkg: concurrent access for gpk
* core: optimize message handle (#542)Jimmy Hu2019-04-021-1/+1
| | | | | | | | * core: optimize for handling agremenet result * core: disable clone vote * core: touch npks
* core: only qualified nodes can participant BA (#540)Jimmy Hu2019-04-023-40/+11
| | | | | | * core: only qualified nodes can participant BA * core: remove leader calculation from node set cache
* core: clean TODOs (#539)Mission Liao2019-04-013-34/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: reset DKG if to less qualified nodes (#528)Jimmy Hu2019-03-291-0/+5
|
* core: fix issues (#525)Mission Liao2019-03-281-0/+5
| | | | | * Refine the logic to append config * Potential fix for round not increase when fast syncing
* core: workaround for GetRoundHeight (#526)Jimmy Hu2019-03-281-1/+5
|
* core: workaround for GetRoundHeight (#523)Jimmy Hu2019-03-271-1/+2
| | | | | | | | * core: workaround for GetRoundHeight * update gopkg.lock * x
* core: merge notarySet and DKGSet (#488)Jimmy Hu2019-03-274-24/+7
| | | | | | | | | | | | | | * core: さよăȘら DKGSet * test logger * temporary fix before finalized * core: Sign psig on commit vote * Add syncer log * fixup
* core: remove initRoundBeginHeight paramenterMission Liao2019-03-221-2/+5
| | | | * Implement Governance.GetRoundHeight in test.Governance.
* core: abort hang DKG (#508)Mission Liao2019-03-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | * 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-32/+36
| | | | | | | * 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-205-1/+57
| | | | | | | | | | | | | | * 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: abort hang dkg (#500)Mission Liao2019-03-191-6/+6
|
* test: try to mitigate flaky tests (#498)Mission Liao2019-03-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-172-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | * 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-162-18/+58
|
* test: prohibit dkg (#489)Mission Liao2019-03-141-0/+6
| | | | | * Allow to prohibit DKG changes at governance layer. * Allow test.App to broadcast RoundEvent
* utils: add RoundEvent (#482)Mission Liao2019-03-133-0/+471
| | | | | * Move core.roundBasedConfig to core/utils * Refine utils.RoundBasedConfig * Add utils.RoundEvent
* core: move some dkg utils (#476)Mission Liao2019-03-111-0/+5
| | | | | | * Move core.getDKGThreshold to core.utils.GetDKGThreshold * Move core.DKGGroupPublicKey to typesDKG.GroupPublicKey
* core/utils: fix verifyDKGComplaint bug (#472)Jimmy Hu2019-03-082-3/+3
| | | | | | * core/utils: fix verifydkgcomplaint bug * fix test
* core: touch nodeSetCache (#466)Jimmy Hu2019-03-072-0/+26
|
* core: first few round will not have DKG (#455)Jimmy Hu2019-03-042-5/+14
| | | | | | | | | | | | | | * 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-262-2/+2
|
* core: remove acks (#451)Mission Liao2019-02-222-15/+0
|
* core: switch round by block height (#450)Mission Liao2019-02-204-34/+14
|
* big-bang: single chain (#446)Mission Liao2019-02-192-33/+24
|
* core: Add vote filter (#430)Jimmy Hu2019-01-242-0/+153
| | | | | | | | | | | | * core: ignore usless vote * core: export SkipBlockHash and NullBlockHash * core: add VoteFilter * Add test * New VoteFilter for each round
* core: Fix BA3.0 (#420)Jimmy Hu2019-01-152-6/+7
| | | | | | | | | | | | | | | | | | * 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-112-0/+94
| | | | | | | | | | | | | | | | - 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: BA 3.0 (#408)Jimmy Hu2019-01-072-3/+50
| | | | | | | | | | | | | | * Add v3 enum * Add BA leader calculation * Fast BA * Add unittest for Fast BA * Add comment * Select leader in notarySet
* test: allow empty change request (#398)Jimmy Hu2019-01-041-16/+0
| | | | | | * allow empty reqs * Fix license
* core: expose HashVote function for test (#400)Wei-Ning Huang2019-01-044-8/+9
|
* core/utils: Add Penalty checker and VerifyDKGComplaint (#393)Jimmy Hu2019-01-044-0/+513
| | | | | | | | | | * Add Util for checking penalty * Add VerifyDKGComplaints * Fixup and rename * Happy New Year!
* utils: move authenticator to utils package (#378)Mission Liao2018-12-224-0/+815
|
* misc: panic not ready (#374)Mission Liao2018-12-181-0/+61
| | | | | | | | | | | | | | | | * 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
* core: fix bugs found when node-set is not equal to notary-set (#362)Mission Liao2018-12-071-6/+13
|
* utils: add utils package (#327)Mission Liao2018-11-142-0/+351