aboutsummaryrefslogtreecommitdiffstats
path: root/simulation
Commit message (Collapse)AuthorAgeFilesLines
* simulation: add latency for gossip (#389)Mission Liao2019-01-033-23/+36
|
* simulation: support config change (#381)Mission Liao2018-12-267-70/+257
|
* core: simulation: add throughput and block event monitoring (#380)haoping-ku2018-12-224-33/+129
| | | | | | | | | | | * 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
* db: rename blockdb to db (#367)Mission Liao2018-12-131-4/+4
| | | | | | | | | | * 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
* simulation: fix concurrency issue, add lock (#361)haoping-ku2018-12-061-3/+7
|
* test: allow to log in test.State (#359)Mission Liao2018-12-061-1/+6
|
* Haoping fix simulation (#356)haoping-ku2018-12-053-9/+127
| | | | | | | | | | | | | | | * simulation: add benchmark features * tmp * simulation: modify Debug interface * Added BlockReceived and BlockReady function to Debug interface. * Added Benchmark features. * fix * fix typos
* core: construct consensus from syncer (#352)Mission Liao2018-12-041-1/+1
|
* simulation: fix confirm latency (#353)haoping-ku2018-12-032-6/+10
|
* simulation: -log to dump log to file as well (#348)Jimmy Hu2018-11-292-10/+30
|
* core: remove StronglyAcked (#347)Mission Liao2018-11-291-5/+0
|
* core: support NumChains change for BA modules (#339)Mission Liao2018-11-201-1/+1
|
* core: sync logger with dex (#325)Mission Liao2018-11-141-1/+5
|
* simulation: Fix simulation failure (#324)Mission Liao2018-11-141-0/+2
|
* core: expose implicit round shift (#321)Mission Liao2018-11-131-1/+2
|
* simulation: use test.Governacne in simulation (#311)Mission Liao2018-11-084-275/+55
| | | | | | | | | | | | * 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
* core: Run DKG stuffs only if the node is in DKG set (#302)Jimmy Hu2018-11-065-13/+38
|
* test: move simulation.network to test package (#297)Mission Liao2018-11-057-441/+84
|
* core: block deliver with position (#289)Mission Liao2018-11-021-1/+1
| | | | | This info is required when application layer needs to do something related to the underlying DAG, not just compaction chain.
* core: Remove max block interval (#287)Jimmy Hu2018-11-021-1/+0
|
* Rename repo to dexon-consensusWei-Ning Huang2018-11-0212-93/+93
|
* core: Add PullVotes to Network. (#281)Jimmy Hu2018-10-311-0/+5
|
* core: Pull block (#263)Jimmy Hu2018-10-261-0/+25
|
* core: Move dkg in types to types/dkg. (#253)Jimmy Hu2018-10-254-28/+32
|
* core: fix stuffs (#250)Mission Liao2018-10-241-2/+1
| | | | | | | | * 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.
* core: Change interface of Application.VerifyBlock (#246)Jimmy Hu2018-10-231-2/+2
| | | | * Change interface of Application.VerifyBlock
* core: add round parameter to ProposeCRS method (#244)Wei-Ning Huang2018-10-231-1/+1
| | | | | | | | 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.
* simulation: Cache network broadcasted message (#242)Jimmy Hu2018-10-231-10/+36
|
* core: initial commit for logger (#228)Mission Liao2018-10-191-1/+7
| | | | | | | | | | | | | * 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
* misc: Fix simulation error (#230)Jimmy Hu2018-10-193-4/+48
|
* core: Add init block to Run() (#221)Jimmy Hu2018-10-181-1/+1
|
* Remove duplicated dMoment in Consensus.Run (#206)Jimmy Hu2018-10-151-1/+1
|
* core: Fix simulation errors. (#202)Jimmy Hu2018-10-151-1/+1
|
* core: fix simulation error (#201)Jimmy Hu2018-10-153-4/+16
| | | | | * Sync dMoment for all consensus core * App check for randomness ignore round 0
* test_config: sync default config (#200)Wei-Ning Huang2018-10-151-1/+1
|
* core: modify interface (#194)Mission Liao2018-10-122-4/+9
| | | | * Add a new method to notify full node about round cutting. * Modify interface to return error when preparing block
* core: change interface (#193)Mission Liao2018-10-111-16/+15
| | | | | | | * Extract types.FinalizationResult * Change interface: - Application.BlockConfirmed returns whole block. - Application.BlockDelivered returns partial result.
* core: Add round to DKG methods in gov. Change network interface name (#185)Jimmy Hu2018-10-093-8/+19
|
* core: Add DKG final message. (#181)Jimmy Hu2018-10-093-0/+35
|
* core: update config variable name grammar and remove configuration (#184)Wei-Ning Huang2018-10-081-2/+2
|
* core: Remove round from gov.ProposeCRS (#183)Jimmy Hu2018-10-081-11/+17
|
* core: Add block randomness in compaction-chain module (#179)Jimmy Hu2018-10-081-0/+3
|
* core: General tsig (#177)Jimmy Hu2018-10-052-0/+33
|
* core: Check Witness height. Add ConsensusTime and ConsensusHeight to block. ↵Jimmy Hu2018-10-041-12/+34
| | | | (#170)
* core: remove NumWitnessSet in governance config (#167)Wei-Ning Huang2018-10-031-1/+0
| | | | NumWitnessSet is no longer required as we don't have witness set in the design anymore.
* core: publish round based config (#165)Mission Liao2018-10-031-1/+0
|
* core: replace reliable-broadcast with shard (#159)Mission Liao2018-10-021-6/+6
|
* core: remove ProposeThresholdSignature/GetThresholdSignature (#158)Wei-Ning Huang2018-10-021-15/+2
| | | Also rename the argument name of ProposeCRS.
* core: run DKG and CRS at background. (#155)Jimmy Hu2018-10-021-5/+8
|
* core: update data model to reflect new model (#157)Wei-Ning Huang2018-10-013-40/+6
| | | | | | Update data model: 1) Remove witness ack. 2) Add round to block. 3) Update governance interface.
* core: use notarySet for BA module. (#153)Jimmy Hu2018-10-011-12/+21
|
* core: remove legacy mode (#149)Mission Liao2018-09-282-10/+5
|
* core: Add sizes of various nodeSets (#148)Jimmy Hu2018-09-283-18/+30
|
* core: hide types.NodeID from full node. (#147)Mission Liao2018-09-284-25/+29
| | | | | | | | | * 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.
* core: update governance interface and config (#145)Wei-Ning Huang2018-09-272-19/+21
| | | | | | 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.
* core: rename crypto/eth to crypto/ecdsa (#144)Wei-Ning Huang2018-09-261-2/+2
|
* crypto: sigtopub to crypto package. remove SigToPubFn (#141)Jimmy Hu2018-09-262-5/+2
|
* core: move crypto to core/crypto (#140)Mission Liao2018-09-263-3/+3
| | | | | | | | | - 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
* core: configuration chain test (#137)Jimmy Hu2018-09-261-4/+1
|
* core: run TSIG for first configuration block at startup (#135)Jimmy Hu2018-09-264-12/+46
|
* core: update governance interface to consider genesis state (#136)Wei-Ning Huang2018-09-252-11/+12
|
* Fix naming of methods (#134)Mission Liao2018-09-251-8/+8
| | | | | | - BlockDeliver -> BlockDelivered - TotalOrderingDeliver -> TotalOrderingDelivered - WitnessAckDeliver -> WitnessAckDelivered - VerifyPayload -> VerifyPayloads
* core: add debug (#133)Mission Liao2018-09-251-64/+19
| | | | | | | | | | | | | | | | | | | | | * 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.
* core: run first DKG at startup. (#129)Jimmy Hu2018-09-235-7/+24
|
* core: refactor witness data processing flow (#124)Wei-Ning Huang2018-09-201-0/+15
| | | | | | | | | | | 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.
* test_config: update config to latest runnable version (#122)Wei-Ning Huang2018-09-201-1/+1
|
* Rename validator* to node* (#120)Mission Liao2018-09-2013-138/+138
|
* core: rename Notary (Acks) to Witness (#118)Wei-Ning Huang2018-09-193-10/+10
|
* core:DKG and TSIG protocol (#115)Jimmy Hu2018-09-193-3/+31
|
* core: refine governance interface to reduce Get* methods (#114)Wei-Ning Huang2018-09-181-56/+24
| | | | | 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.
* core: remove ticker parameter from NewConsensusMission Liao2018-09-183-16/+12
| | | | | | | | | - 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.
* core: move blockdb into core package and minor change on governance ↵Wei-Ning Huang2018-09-172-3/+8
| | | | | | | 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.
* core: DKG interface (#108)Jimmy Hu2018-09-173-4/+72
|
* cleanup (#109)Mission Liao2018-09-171-18/+15
| | | | | | - With context, we don't need stopChan - Remove core.BlockChain. - Remove unused variable.
* core: fix VerifyPayload argument (#103)Wei-Ning Huang2018-09-131-1/+1
| | | | Since we are using a byte slice for storing payload. VerifyPayload() should also accepts a byte slice.
* core: replace acks with slice (#102)Mission Liao2018-09-121-1/+1
|
* core: types: use []byte for block Payload type (#101)Wei-Ning Huang2018-09-121-3/+3
| | | | | 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.
* simulation: integrate test.Transport (#99)Mission Liao2018-09-1111-950/+468
| | | | | - Add marshaller for simulation by encoding/json - Implement peer server based on test.TranportServer - Remove network models, they are replaced with test.LatencyModel
* core: timestamp (#98)Jimmy Hu2018-09-111-1/+1
|
* misc: Polish BA. (#94)Jimmy Hu2018-09-054-22/+44
|
* core: BA-based consensus core. (#93)Jimmy Hu2018-09-043-2/+16
|
* Add GetChainNumber to Goverance (#92)Jimmy Hu2018-09-033-23/+19
|
* core: minor change to governance interface (#90)Wei-Ning Huang2018-09-031-5/+0
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-031-2/+2
| | | | `Height` from `Block` (#89)
* Add methods to Application interface. (#86)Jimmy Hu2018-08-312-92/+11
|
* Use Network in Consensus core (#85)Jimmy Hu2018-08-311-1/+4
|
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-304-7/+16
| | | | interface. (#84)
* core: Change the lattice key from validatorID to chainID. (#83)Jimmy Hu2018-08-301-0/+13
| | | | | * Add chainID in simulation.Validator * Change validatorid to chainID in rbModule
* core: Leader Selector. (#80)Jimmy Hu2018-08-303-6/+24
|
* core: Add agreement module (#77)Jimmy Hu2018-08-291-2/+13
|
* core: tune performance (#73)Mission Liao2018-08-284-37/+70
| | | | | | | | | | | | | | | | | | | | | | - 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.
* core: Add vote type and add field to block. (#76)Jimmy Hu2018-08-283-0/+19
|
* simulation: remove fake network (#74)Wei-Ning Huang2018-08-253-166/+18
|
* simulation: allow to run simulation with scheduler on k8s (#72)Mission Liao2018-08-226-0/+96
| | | | | | | | To run a simulation with scheduler on k8s: ./run_scheduler.sh 61 5 Where *61* means the simulation contains 61 validators, and *5* means the simulation utilizes 5 vCPUs and corresponding concurrent workers to run.
* core: Notary ack application. (#70)Jimmy Hu2018-08-224-0/+29
|
* core: Notary ack (#69)Jimmy Hu2018-08-211-2/+2
|
* core: NotaryAck interfaces. (#67)Jimmy Hu2018-08-201-0/+4
|
* simulation: taken network latency model into consideration in TCP mode (#68)Mission Liao2018-08-203-15/+26
| | | | | | - Clone block once for each broadcast - Add network latency model for TCPNetwork - Fix map concurrent write
* simulation: Fix port reuse error in simulation. (#65)Jimmy Hu2018-08-172-16/+71
|
* core: Prepare Genesis block. (#54)Jimmy Hu2018-08-141-7/+4
|
* Use RLock for simulation.simApp.blockByHash (#53)Jimmy Hu2018-08-131-4/+3
|
* simulation: Create Consensus core after Join. (#51)Jimmy Hu2018-08-134-32/+31
|
* simulation: fix concurrent map write (#52)Wei-Ning Huang2018-08-134-6/+15
| | | Fix concurrent map write and also change k8s settings.
* core: Sign block in Consensus.PrepareBlock. (#50)Jimmy Hu2018-08-132-5/+10
|
* simulation: kubernetes: update configWei-Ning Huang2018-08-134-11/+11
|
* core: ValidatorID.Hash is the hash of public key. (#49)Jimmy Hu2018-08-132-9/+21
|
* simulation: kubernetes: update config templateWei-Ning Huang2018-08-131-0/+4
|
* core: Modify Consensus interface (#45)Jimmy Hu2018-08-101-1/+1
|
* core: update governance interface and move K into config (#40)Wei-Ning Huang2018-08-105-89/+125
|
* Add genesis block to simulation app. (#44)Jimmy Hu2018-08-101-0/+1
|
* Fix the bug preventing us from testing large group when using TCP-Local (#42)Mission Liao2018-08-102-21/+24
| | | | | | | | | | | | | | | | | | | | * Fix the issue that processing genesis block twice. - Restore the mechanism to avoid sending block to proposer. * Fix the 'keep-alive' not working Quote from comments of net/http/request For client requests, setting this field prevents re-use of TCP connections between requests to the same hosts, as if Transport.DisableKeepAlives were set. * Remove useless field * Fix the test bug: I should provide '3' when test K=3 * Fixup: the parent hash of genesis block should be zero
* core: Deliver only Hash to Application. (#43)Jimmy Hu2018-08-102-9/+17
|
* core: Add Block.IsGenesis() and set Block.ParentHash to 0 in genesis block. ↵Jimmy Hu2018-08-091-4/+3
| | | | (#37)
* simulation: Fix k8s simulation issues. (#36)Jimmy Hu2018-08-092-9/+38
| | | | | | | | | | | | * Refine peer server * k8s ignore * Keep peer server alive on k8s * Stop validators from accepting new blocks after peer server has shut down. * Add comment
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-085-36/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* simulation: Show internal and external timestamp latency. (#30)Jimmy Hu2018-08-074-17/+193
|
* simulation: tcp-network: force http.Client to reuse connection (#33)Wei-Ning Huang2018-08-061-15/+22
| | | Force connection reuse and TCP keep alive by using the same http client for all reqeusts.
* simulation: free resource after use and misc fix for k8s mode (#31)Wei-Ning Huang2018-08-068-14/+63
|
* Remove timestamp generating function in validator (#25)Jimmy Hu2018-08-011-8/+0
|
* core: refine Application interface and add Governance interface (#24)Wei-Ning Huang2018-07-311-7/+7
| | | | | | | Add a new Governance interface for interaction with the governance contract. Also remove the ValidateBlock call in application interface as the application should validate it before putting it into the consensus module. A new BlockConverter interface is also added. The consensus module should accept the BlockConverter interface in future implementation, and use the Block() function to get the underlying block info.
* blockdb: allow to dump blocks to json-encoded fileMission Liao2018-07-312-10/+9
| | | | | | | | | | | | - Allow to dump blockdb to a json file - Compared to leveldb, a json file is easier to trace. - Add interfaces block database: - Close would be required by database that needs cleanup. - BlockIterator is required when we need to access 'all' blocks, adding a new method 'GetAll' as the constructor for iterators. - Remove GetByValidatorAndHeight from blockdb.Reader - This function is not used anywhere, to make interface minimum, remove it. - Fix typo: backend -> backed
* Print block confirm latency when Peer Server stopped. (#23)Jimmy Hu2018-07-318-26/+67
|
* Print confirmed blocks per second when Peer Server stopped. (#22)Jimmy Hu2018-07-312-0/+47
|
* Add a config that PeerServer can shutdown after receiving enough of block. (#19)Jimmy Hu2018-07-308-22/+240
|
* Verify the Total Ordering Algorithm in peerServer in tcp mode (#11)Jimmy Hu2018-07-269-16/+328
| | | Verify the Total Ordering Algorithm in peerServer in tcp mode.
* simulation: fix tcp-local network simulation (#8)Wei-Ning Huang2018-07-232-2/+6
| | | | | | * simulation: fix tcp-local network simulation * fixup
* Implement simulation on a real network (#5)Wei-Ning Huang2018-07-2014-129/+720
| | | simulation: implement simulation on a real network
* core: refactor acking relationship (#3)Wei-Ning Huang2018-07-181-1/+1
| | | | | | | | | * core: refactor acking relationship Use AckBy only, and remove IndirectAcks. Also fix the issue where validator is not filling Height when proposing block.
* Initial implementation of DEXON consensus algorithmWei-Ning Huang2018-07-167-0/+521