| 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
|
|
|
|
|
|
|
|
|
|
| |
* core: syncer: fix force sync
* Fix come logic
* core: syncer: fix
* fix log
|
|
|
|
|
| |
* core/crypto/dkg: add benchmark
* core/crypto/dkg: concurrent access for gpk
|
|
|
|
|
|
| |
* core: syncer: deliver pending blocks
* 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: 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
|
|
|
|
| |
* Implement Governance.GetRoundHeight
in test.Governance.
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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: 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
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* integration_test: Add a byzantine test
* test: fix flaky TestPullVote tes
|
| |
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Merge core.Consensus constructors
* Downgrade severity of logs
* Refine logic to add blocks from pool to lattice
* Add test.LaunchDummyReceiver
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update Gopkg.lock
* Fix test
* Add travisCI setting
* Print log using fmt
* Update GNUmakefile
* Use single go rountine for consensus_test
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Broadcast to set of node instead of broadcasting when attaching cache.
* Fix pull blocks
|
| |
|
| |
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
| |
This info is required when application layer needs
to do something related to the underlying DAG, not
just compaction chain.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* remove sanity check when adding blocks.
* call VerifyBlock after lattice's sanity check.
* remove checkRelation flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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 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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
`Height` from `Block` (#89)
|
| |
|
|
|
|
|
| |
* Add chainID in simulation.Validator
* Change validatorid to chainID in rbModule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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 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.
|
|
When simulating execution of core.Consensus by passing packets through golang-channel or real-socket, we need to utilize time.Sleep and time.Now to simulate the required network/proposing latency. It's problematic when we try to test a simulation with long network latency.
Instead, Scheduler would try to execute the event with minimum timestamp, thus time.Sleep is replaced with Scheduler.nextTick, and time.Now is replaced with Event.Time.
Changes:
- Add test.Scheduler.
- Add test.Stopper interface to provide encapsulate different stop conditions for scheduler.
- Add a reference implementation for test.Stopper, it will stop scheduler when all validators confirmed X blocks proposed from themselves.
- Add a test scenario on core.Consensus that all validators are not byzantine.
|