aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/utils.go
Commit message (Collapse)AuthorAgeFilesLines
* core: merge notarySet and DKGSet (#488)Jimmy Hu2019-03-271-4/+4
| | | | | | | | | | | | | | * core: さよなら DKGSet * test logger * temporary fix before finalized * core: Sign psig on commit vote * Add syncer log * fixup
* syncer: fix issues when switching to core.Consensus (#418)Mission Liao2019-01-111-19/+0
| | | | | | | | | | | | | | | | - 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.
* simulation: add latency for gossip (#389)Mission Liao2019-01-031-0/+12
|
* core: fix stuffs (#383)Mission Liao2018-12-261-0/+19
| | | | | | * Merge core.Consensus constructors * Downgrade severity of logs * Refine logic to add blocks from pool to lattice * Add test.LaunchDummyReceiver
* utils: move authenticator to utils package (#378)Mission Liao2018-12-221-11/+22
|
* core: Add a `MPKReady` so `MasterPublicKey` cannot be added afterwards (#375)Jimmy Hu2018-12-191-0/+13
| | | | | | | | | | | | | | | | * 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
* db: cache compaction chain tip in db (#369)Mission Liao2018-12-131-0/+31
| | | | | * Replace JSON with RLP in levelDB implementation. * Make sure blocks to sync following compaction chain tip
* test: add integration test (#315)Mission Liao2018-11-111-0/+13
| | | | | | * 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
* test: make StateChangeRequest broadcast-able (#305)Mission Liao2018-11-071-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Rename repo to dexon-consensusWei-Ning Huang2018-11-021-9/+9
|
* test: add test.State (#239)Mission Liao2018-10-241-0/+14
| | | | | | | | | * 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.
* core: hide types.NodeID from full node. (#147)Mission Liao2018-09-281-0/+14
| | | | | | | | | * 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.
* Rename validator* to node* (#120)Mission Liao2018-09-201-5/+5
|
* simulation: integrate test.Transport (#99)Mission Liao2018-09-111-0/+25
| | | | | - Add marshaller for simulation by encoding/json - Implement peer server based on test.TranportServer - Remove network models, they are replaced with test.LatencyModel
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-301-2/+1
| | | | interface. (#84)
* core: tune performance (#73)Mission Liao2018-08-281-0/+26
| | | | | | | | | | | | | | | | | | | | | | - 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.
* test: refine test utility (#61)Mission Liao2018-08-151-0/+9
| | | | | * Add functionality to test.App * Add test utility to generate slices of types.ValidatorID
* core: Hash block in Consensus.PrepareBlock. (#46)Jimmy Hu2018-08-121-0/+31
* Add hash to block * Check block hash in Consensus.sanityCheck * Add hashBlockFn in block generator.go