| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add v3 enum
* Add BA leader calculation
* Fast BA
* Add unittest for Fast BA
* Add comment
* Select leader in notarySet
|
| |
|
|
|
|
|
|
|
| |
* Remove block recycling mechanism
* Return directly when previous DKG is not finished.
* Adjust some logging level
* Skip pulling when hashes to pull is empty
|
| |
|
| |
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* simulation: add benchmark features
* tmp
* simulation: modify Debug interface
* Added BlockReceived and BlockReady function to Debug interface.
* Added Benchmark features.
* fix
* fix typos
|
| |
|
|
|
|
|
|
| |
- 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]
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Process randomness result in finalized block if missed
* Add test for missing block randomness
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* BA should not start if governance is out-of-sync
* Should not do sync BA if consensus is not started
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
- also add missing logs when calling Application.BlockDelivered.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Lock entire ProcessBlock
* Lock Consensus.processBlock
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
| |
* remove sanity check when adding blocks.
* call VerifyBlock after lattice's sanity check.
* remove checkRelation flag.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
* Register DKG after CRS is proposed
* Change round at only one place
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* Sync dMoment for all consensus core
* App check for randomness ignore round 0
|
|
|
|
|
| |
* No randomness for round 0
* Ignore round 0 randomness
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* Extract types.FinalizationResult
* Change interface:
- Application.BlockConfirmed returns whole block.
- Application.BlockDelivered returns partial result.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Update data model:
1) Remove witness ack.
2) Add round to block.
3) Update governance interface.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
- BlockDeliver -> BlockDelivered
- TotalOrderingDeliver -> TotalOrderingDelivered
- WitnessAckDeliver -> WitnessAckDelivered
- VerifyPayload -> VerifyPayloads
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
| |
A shard is basically DEXON v1 components,
except the strongly acked part, including:
- maintaining lattice structure
- total ordering
- generate consensus timestamp
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
- With context, we don't need stopChan
- Remove core.BlockChain.
- Remove unused variable.
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
- Add marshaller for simulation by encoding/json
- Implement peer server based on test.TranportServer
- Remove network models, they are replaced with test.LatencyModel
|
| |
|
| |
|
| |
|
|
|
|
| |
`Height` from `Block` (#89)
|
| |
|
| |
|
|
|
|
| |
interface. (#84)
|
|
|
|
|
| |
* Add chainID in simulation.Validator
* Change validatorid to chainID in rbModule
|
|
|
|
|
| |
- Replace map with slice
Compared to slice, accessing to map is slower and
the memory usage is inefficient.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Add hash to block
* Check block hash in Consensus.sanityCheck
* Add hashBlockFn in block generator.go
|
| |
|
| |
|
| |
|
|
* 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.
|