| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ignore test simple
* core: update voteFilter to filter old er round
* circleci: save logs
* core: move check notarySet to agrmgr
* fixup
|
| |
|
|
|
|
|
| |
* bin: polish install_dkg_dep script
* dkg: change to use BLS12_381
|
| |
|
|
|
|
|
|
| |
* core: try to recover dkg private key from db
* fixup
|
|
|
|
|
|
|
|
|
|
| |
* core: syncer: fix force sync
* Fix come logic
* core: syncer: fix
* fix log
|
|
|
|
|
|
|
|
| |
* core: priority process self message
* fix
* fixup
|
| |
|
|
|
|
|
|
|
|
| |
* Pass notary set directly to VerifyAgreementResult
* Fix core.Consensus
* Fix syncer
|
| |
|
|
|
|
|
|
| |
* core: more aggresive vote filter
* add test
|
|
|
|
|
|
| |
* core: crypto: dkg: fix concurrent access bug
* core: fix concurrent bug
|
| |
|
|
|
|
|
| |
* core/crypto/dkg: add benchmark
* core/crypto/dkg: concurrent access for gpk
|
| |
|
| |
|
|
|
|
|
|
| |
* core: syncer: deliver pending blocks
* fixup
|
|
|
|
|
|
| |
* core: fix disqualified
* fix test
|
| |
|
|
|
|
|
|
|
|
| |
* core: optimize for handling agremenet result
* core: disable clone vote
* core: touch npks
|
|
|
|
|
|
| |
* core: only qualified nodes can participant BA
* core: remove leader calculation from node set cache
|
|
|
|
|
|
| |
* core: remove round and round change height in recv
* fixup
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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: run dkg by height
* core: check cc.dkgCtx before running each dkg phases
* fix
|
| |
|
|
|
|
|
| |
* Refine the logic to append config
* Potential fix for round not increase when fast syncing
|
| |
|
|
|
|
|
|
| |
* core: add log for restart BA
* Add log for changing round
|
|
|
|
|
|
|
|
| |
* core: workaround for GetRoundHeight
* update gopkg.lock
* x
|
|
|
|
|
|
|
|
| |
* required vote calculation
* fix agreement result
* core: fix initRound issue of BA
|
|
|
|
|
|
|
|
|
|
| |
* core: fastPreCom should not propose fastCom in RBA
* add test for fix
* core: update BA
* core: fix test
|
|
|
|
|
|
| |
* core: sign block hash for empty block
* run force synced empty block at startup
|
|
|
|
|
|
|
|
|
|
| |
* core: bring back agreement result
* add logger
* Fix
* fixup
|
|
|
|
|
|
|
|
|
|
|
|
| |
* core: remove agreement result for round with randomness
* remove agr test in syncer
* fixup
* remove randomness field from agreement result
* modify test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* core: さよなら DKGSet
* test logger
* temporary fix before finalized
* core: Sign psig on commit vote
* Add syncer log
* fixup
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
* Implement Governance.GetRoundHeight
in test.Governance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
| |
confirmed (#495)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Add GetRoundHeight interface for core to query the being height of a
round.
|
|
|
|
| |
Move timeout configuration from the parameter of `Start` to NewWatchCat
so it's easier for fullnode to configure the module.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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/syncer: rename terminator to watchcat
* Add error log
* Rename Pat to Feed
|
|
|
|
|
| |
* core: Add Recovery Interface
* core/syncer: modify recovery interface
|
|
|
|
|
| |
* Allow to prohibit DKG changes at governance layer.
* Allow test.App to broadcast RoundEvent
|
| |
|
|
|
|
|
| |
* Move core.roundBasedConfig to core/utils
* Refine utils.RoundBasedConfig
* Add utils.RoundEvent
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Fix dead lock
* core/syncer: prevent selecting on a nil channel
* Remove unnecessary reader lock holding
|
|
|
|
|
|
|
|
| |
* core: add benchmark
* core: split NPKs and GPK
* Add benchmark
|
|
|
|
|
|
| |
* Move core.getDKGThreshold to
core.utils.GetDKGThreshold
* Move core.DKGGroupPublicKey to
typesDKG.GroupPublicKey
|
|
|
|
|
|
| |
* core: reduce blockchain randomness msg
* add test
|
|
|
|
|
|
| |
* core: check if self's privateShare match MPK registered
* add test
|
|
|
|
|
|
|
|
|
|
|
|
| |
One possible attack for syncer is:
- byzantine nodes periodically broadcast some very
old types.AgreementResults.
- If some syncer receive those
types.AgreementResult, they might synced
directly while still fall behind other nodes.
A quick workaround is ignore
types.AgreementResults older than the chain tip
when creating the syncer.Consensus instance.
|
|
|
|
| |
* Do not panic when empty block is unable to propose
* Make blockChain able to handle pulled empty block
|
|
|
|
|
|
| |
* core/utils: fix verifydkgcomplaint bug
* fix test
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* dkg: no need to rlp encode/decode cache related data
* fixup! dkg: no need to rlp encode/decode cache related data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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: resetDKG skeleton
* Add Equal test
* Add TestLocal
* Add TestPacking
|
| |
|
|
|
|
|
|
|
|
| |
* Fix syncer panic
We can't verify correctness for randomness result from rounds that
corresponding configurations are not ready yet.
* Fix blocks are not confirmed while they should be
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Add log
* core: delay first dkg
* Fix test
* core: only runDKG in prepare at round 0
|
| |
|
| |
|
|
|
|
|
|
| |
* integration_test: Add a byzantine test
* test: fix flaky TestPullVote tes
|
| |
|
|
|
|
|
|
|
|
| |
* core: Add an error to NewGroupPublicKey
* core: Add Delete to TSigVerifierCache
* remove duplicated check
|
|
|
|
|
|
| |
* core: fast forward faster
* core: modify unit test
|
| |
|
|
|
|
|
|
|
|
| |
* types: Add RLP Encode/Decode to DKGComplaint
* Add test
* fix state test
|
|
|
|
|
|
|
|
| |
* core: fix lock in agreement
* fix
* terminate leader go routine if agreement already restarted to new position
|
|
|
|
|
|
| |
* core: BA 3.1
* core: fix test
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 processing duplicated agreement result
* 放這邊應該比較好
* 放這邊才對
* Add TODO
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* core: ignore usless vote
* core: export SkipBlockHash and NullBlockHash
* core: add VoteFilter
* Add test
* New VoteFilter for each round
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* types: Add vote type
* core: remove stateFastRollback
* core: rename lockRound to lockIter
* core: Implement real ba3.0
* core: Add test for confirm
* Fix VoteFastCom in agreement result
* lockIter will always increase
|
| |
|
|
|
|
|
|
|
|
| |
* Add gosec to tools
* Run security check to ci
* Fix secrity issues
|
|
|
|
|
|
| |
* core: reduce syncing ba msg
* core: fix checking period of agreement result
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
|
|
|
|
|
| |
* Handshake with server dmoment
* Start simulation from dMoment
* Update k8s config
|
| |
|
|
|
|
|
|
| |
This error would always be raised when trying to
sync from consensusHeight == 0. However, this
error is mostly meaningless to fullnode, they
just need to retry it later.
|
|
|
|
|
|
| |
* simulation: fix k8s simulation stuff
* Default K to 0
|
|
|
|
|
|
|
|
|
|
| |
* Compose hashes for debugApp only
* Remove TODOs
They are already done
* Fix total ordering handing issue
|
| |
|
|
|
|
| |
NOTE: the assurance between block's hash and
block's position would be done in core.Consensus.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add v3 enum
* Add BA leader calculation
* Fast BA
* Add unittest for Fast BA
* Add comment
* Select leader in notarySet
|
|
|
|
|
|
|
|
|
| |
Besides adding logs, also include these minor
fixes:
* Accessing con.validatedChains under locking
* Access con.latticeLastRound under locking
* Fix incorrect waitGroup usage
* Remove unused parameter in startAgreement
|
| |
|
|
|
|
|
|
| |
* test: fix marshal randomness pullrequest
* Add result for witness latency
|
| |
|
|
|
|
|
|
| |
* Clean DKG instance after finished
* Fix CI failure by workaround....
|
| |
|
|
|
|
|
|
|
| |
* Remove block recycling mechanism
* Return directly when previous DKG is not finished.
* Adjust some logging level
* Skip pulling when hashes to pull is empty
|
|
|
|
|
|
| |
* allow empty reqs
* Fix license
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Check if deliverable multiple times for each added block
* Fix format
|
|
|
|
| |
Set waitGroup.Add inner go routine is not safe.
You can see the example here https://play.golang.org/p/AexsKUD-4WK
|
|
|
|
|
|
|
|
|
|
| |
* Add Util for checking penalty
* Add VerifyDKGComplaints
* Fixup and rename
* Happy New Year!
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* Merge several CRS notifications into one.
* Sync config when new CRS is found
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Merge core.Consensus constructors
* Downgrade severity of logs
* Refine logic to add blocks from pool to lattice
* Add test.LaunchDummyReceiver
|
|
|
|
|
|
|
|
| |
* Add PullRandomness to interface
* Add pendingBlocksWithoutRandomness to compactionChain
* Pull randomness every 1 second
|
| |
|
|
|
|
|
|
|
|
| |
* 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
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
|
| |
|
| |
|
|
|
|
|
|
| |
* core: Add VerifyDKGMPKReadySignature
* Fix typo
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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: Fix a bug if DKGNackComplaint is added after required time.
* Duplicated NackComplaint should be only count once.
|
|
|
|
|
| |
* Replace JSON with RLP in levelDB implementation.
* Make sure blocks to sync following compaction chain tip
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* Adding workflw
* Add name to command
* Change name
* Move format check to lint
|
|
|
|
|
|
| |
* Longer time for TravisCI.
* Update CI setting for PR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update Gopkg.lock
* Fix test
* Add travisCI setting
* Print log using fmt
* Update GNUmakefile
* Use single go rountine for consensus_test
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* CircleCI: change to go1.11
* fix gofmt
* Reduce test size
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* simulation: add benchmark features
* tmp
* simulation: modify Debug interface
* Added BlockReceived and BlockReady function to Debug interface.
* Added Benchmark features.
* fix
* fix typos
|
| |
|
|
|
|
|
|
| |
* core: syncer: fix round finding process
* Fix comment
|
| |
|
|
|
|
|
|
| |
- Add common.CustomLogger
- CRS will wait for DKG to finish
- Fix core.agreementMgr.processAgreementResult
|
| |
|
| |
|
|
|
|
|
|
| |
* Use non-blocking app in consensus core
* Prevent panic when getting nextHeight
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]
|
|
|
|
|
|
| |
* Only apply each requests once
* Sort by time
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Process randomness result in finalized block if missed
* Add test for missing block randomness
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Broadcast to set of node instead of broadcasting when attaching cache.
* Fix pull blocks
|
| |
|
|
|
|
|
|
| |
* BA should not start if governance is out-of-sync
* Should not do sync BA if consensus is not started
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Finalization.Randomness will be set at output
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
* Fix panic
|
|
|
|
|
|
| |
* core: lattice, total-ordering: remove newGenesisConfig
* fixup
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
| |
This reverts commit 3714ebf2f1054d9984d37b89cf17e885a5856532.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Add notifyGenesisRounds
* Log round for types.Vote and types.Block
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This info is required when application layer needs
to do something related to the underlying DAG, not
just compaction chain.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add simple processFinalizedBlock logic
* processBlock
* Bootstrap mode
* Sort before flush
* Add syncer test
* Clean more data for memory
* Add comments. Fix some stuffs.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|