aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* core: Fix goroutine leaks (#270)Jimmy Hu2018-10-292-1/+8
|
* core: Do not process vote/block in agreement if it has stopped (#269)Jimmy Hu2018-10-291-4/+18
|
* test: Handle blocks that should retry sanity check later. (#267)Mission Liao2018-10-272-14/+36
|
* core: Fix missing fields when cloning blocks. (#268)Mission Liao2018-10-272-4/+33
|
* core: Remove atomic (#266)Jimmy Hu2018-10-272-14/+11
|
* core: Unit test for BA sync (#265)Jimmy Hu2018-10-262-0/+86
|
* core: sync BA (#264)Jimmy Hu2018-10-263-19/+72
|
* test: clone types.Config, test.Governance, test.State (#262)Mission Liao2018-10-266-42/+608
|
* core: Pull block (#263)Jimmy Hu2018-10-267-32/+141
|
* core: Leader selector will retry sanityCheck (#261)Jimmy Hu2018-10-268-27/+118
|
* misc: Increase CircleCI no output time to 15 min (#260)Jimmy Hu2018-10-261-0/+1
|
* core: Lock entire lattice.ProcessBlock (#259)Jimmy Hu2018-10-262-2/+7
| | | | | | * Lock entire ProcessBlock * Lock Consensus.processBlock
* misc: Add longer timeout for test in master (#258)Jimmy Hu2018-10-252-8/+14
|
* core: lattice sync (#257)Jimmy Hu2018-10-2512-119/+507
|
* core: handle round 0 randomness in processFinalizedBlock (#256)Jimmy Hu2018-10-252-12/+26
|
* test: add test.Stopper to stop by round (#255)Mission Liao2018-10-252-32/+162
|
* core: Move dkg in types to types/dkg. (#253)Jimmy Hu2018-10-2519-278/+297
|
* core: fix stuffs (#250)Mission Liao2018-10-249-52/+33
| | | | | | | | * 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.
* test: Fix datarace in test (#251)Jimmy Hu2018-10-241-6/+12
|
* test: add test.State (#239)Mission Liao2018-10-2411-154/+1019
| | | | | | | | | * 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: disable nonblocking temporarily (#249)Mission Liao2018-10-242-10/+5
|
* core: reduce calls to Application.VerifyBlock (#247)Mission Liao2018-10-245-29/+25
| | | | | | * remove sanity check when adding blocks. * call VerifyBlock after lattice's sanity check. * remove checkRelation flag.
* core: fix panic when proposed block is nil (#248)Mission Liao2018-10-241-0/+4
|
* core: Change interface of Application.VerifyBlock (#246)Jimmy Hu2018-10-237-10/+25
| | | | * Change interface of Application.VerifyBlock
* Change BLS to dexon-foundation (#245)Jimmy Hu2018-10-237-19/+18
|
* core: notify fullnode to snapshot configs when round change. (#243)Mission Liao2018-10-231-8/+19
|
* core: add equality checker for dkg related structure (#237)Mission Liao2018-10-234-26/+379
| | | | | | | | | Besides adding equality, also renaming those fields. - PublicKeyShares.shares -> shareCaches - PublicKeyShares.shareIndex -> shareCacheIndex - rlpPublicKeyShares.Shares -> ShareCaches - rlpPublicKeyShares.ShareIndexK -> ShareCacheIndexK - rlpPublicKeyShares.ShareIndexV -> ShareCahceIndexV
* core: add round parameter to ProposeCRS method (#244)Wei-Ning Huang2018-10-235-5/+12
| | | | | | | | 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-232-20/+41
|
* core: Change dkg timing (#241)Jimmy Hu2018-10-231-12/+17
| | | | | * Register DKG after CRS is proposed * Change round at only one place
* core: remove duplicate BroadcastRandomnessResult call (#240)Wei-Ning Huang2018-10-231-6/+1
|
* core: prepare empty block if null block is confirmed by BA. (#231)Jimmy Hu2018-10-237-23/+136
|
* core: fix uninitialized variable in configuration chain (#238)Wei-Ning Huang2018-10-222-1/+2
|
* core: Handling self proposed DKG private share (#236)Jimmy Hu2018-10-223-27/+34
|
* core: total-ordering: add test TestRunFromNonGenesis (#226)Haoping Ku2018-10-223-22/+96
| | | | * core: total-ordering: add test TestRunFromNonGenesis
* crypto: dkg: implement rlp.Encoder, rlp.Decoder for PrivateKey (#235)Sonic2018-10-202-0/+26
|
* core: fix logging for SendDKGPrivateShare (#234)Wei-Ning Huang2018-10-201-1/+2
|
* Start Run() until dMoment. (#233)Jimmy Hu2018-10-201-0/+2
|
* core: types: implement rlp.Encoder and rlp.Decoder (#232)Sonic2018-10-206-7/+379
| | | | | * core: types: implement rlp.Encoder and rlp.Decoder * crypto: dkg: fix PublicKey.Bytes
* core: initial commit for logger (#228)Mission Liao2018-10-1912-52/+280
| | | | | | | | | | | | | * 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-196-24/+78
|
* core: Sync from BA and test. (#224)Jimmy Hu2018-10-192-64/+199
|
* core: total-ordering: change early flag to mode (#227)Haoping Ku2018-10-1910-49/+64
| | | * core: total-ordering: change early flag to mode
* crypto: ecdsa: make NodeID match dexon address (#229)Sonic2018-10-193-51/+35
| | | | | | | * Remove publicKey struct * PublicKey.Bytes() return uncompressed public key to match the address format of dexon (Keccak256(pubBytes[1:])[12:], where pubBytes is 65 bytes uncompressed public key.). * Rename ethcrypto to dexCrypto
* core: Append all config till Initial block (#225)Jimmy Hu2018-10-181-0/+7
|
* core: types: implements UnmarshalJSON from DKGMasterPublicKey (#223)Wei-Ning Huang2018-10-181-0/+8
|
* core: total ordering flush (#212)Mission Liao2018-10-189-229/+737
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement flush * Panic for all errors from total-ordering * Fix test failure All DAGs generated by blocks-generator would trigger round switching. * Add NewBlocksGeneratorConfig * Add test caes for numChains changes * Resize internal structures * Perform total ordering based on current numChains * Fix not a valid DAG checking * Comparing blocks by height is not correct * Fix blocks from future round are delivered first by revealer * Make sure only picking one candidate in one chain. Blocks on the same chain in different rounds would not have acking relation. * Fix stuffs * Fix the issue that two candidates from the same chain are picked. * Rework candidateChainMapping * Add test case for phi, k changed * Refine testing code for round change * Add breakpoints in global vector * Remove not a valid dag checking. * Adding comments * Add check to forward acking * Fix vet failure * Prepareing height record with breakpoint * Fixup: add check to make sure delivered round IDs are increasing.
* core: sync compaction chain (#222)Jimmy Hu2018-10-186-27/+391
|
* core: consensus-timestamp: add sync (#219)Haoping Ku2018-10-183-29/+118
| | | | | | | | | | | | | | * core: consensus-timestamp: add sync * core: consensus-timestamp: add config change * fix go comment * add config change test * fixup: add error case handling * fixup: round interleave
* core: Add init block to Run() (#221)Jimmy Hu2018-10-186-14/+24
|
* core: Some sync functions (#220)Jimmy Hu2018-10-177-27/+107
|
* core: Rebroadcast agreement and randomness result. (#218)Jimmy Hu2018-10-173-30/+49
|
* core: genesis consensus timestamp (#217)Mission Liao2018-10-176-30/+48
| | | | | | | | | | * 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.
* core: Add stop function to all components (#216)Jimmy Hu2018-10-175-28/+79
|
* Finalization Height starts from 1 (#215)Jimmy Hu2018-10-162-0/+7
|
* core: consensus-timestamp: modify for round change (#214)Haoping Ku2018-10-161-4/+12
| | | | | | * core: consensus-timestamp: modify for round change * core: consensus-timestamp: fix typos
* core: New dexon ba (#210)Jimmy Hu2018-10-168-479/+405
|
* core: Fix corner cases (#211)Jimmy Hu2018-10-164-2/+8
| | | | | | * leader selector will choose smaller hash if distance to crs is the same * Set initial value of aID in BA before start
* core: set genesis block finalization timestamp to zero time (#213)Wei-Ning Huang2018-10-161-0/+2
|
* core: Change First round dkg timing (#209)Jimmy Hu2018-10-162-4/+6
|
* core: fix block confirmed is not called when Debug is not implemented. (#208)Mission Liao2018-10-162-3/+54
|
* core: Change threshold (#205)Jimmy Hu2018-10-151-1/+1
|
* core: fix timestamp marshaling (#207)Wei-Ning Huang2018-10-152-3/+3
|
* Remove duplicated dMoment in Consensus.Run (#206)Jimmy Hu2018-10-152-3/+5
|
* core: Add NodeSetCacheInterface (#203)Jimmy Hu2018-10-152-31/+42
|
* core: Change DKG threshold (#204)Jimmy Hu2018-10-153-6/+6
|
* core: Fix simulation errors. (#202)Jimmy Hu2018-10-154-35/+36
|
* core: fix simulation error (#201)Jimmy Hu2018-10-155-12/+29
| | | | | * Sync dMoment for all consensus core * App check for randomness ignore round 0
* test_config: sync default config (#200)Wei-Ning Huang2018-10-152-2/+4
|
* misc: Use prebuild bls docker image. (#199)Jimmy Hu2018-10-152-5/+18
|
* core: No randomness for round 0 (#198)Jimmy Hu2018-10-153-1/+45
| | | | | * No randomness for round 0 * Ignore round 0 randomness
* core: check if flush is required when round switching in total-ordering (#197)Mission Liao2018-10-156-220/+304
|
* core: blocks generation supports rounds (#196)Mission Liao2018-10-146-219/+445
| | | | | | | * Block proposing based on timestamp, instead of count of blocks generated. * Add method to find tips of each round in blockdb. * Block proposing based on tips of last round found on blockdb.
* core: crypto: ecdsa: add method to create PrivateKey from ecdsa.PrivateKey ↵Wei-Ning Huang2018-10-131-0/+9
| | | | (#195)
* core: modify interface (#194)Mission Liao2018-10-129-20/+38
| | | | * Add a new method to notify full node about round cutting. * Modify interface to return error when preparing block
* core: latticeData supports config change (#190)Mission Liao2018-10-1214-597/+802
| | | | | | | | | | | | | | | * 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.
* core: change interface (#193)Mission Liao2018-10-1119-92/+110
| | | | | | | * Extract types.FinalizationResult * Change interface: - Application.BlockConfirmed returns whole block. - Application.BlockDelivered returns partial result.
* core: Move BlockConfirmed to Application interface (#192)Mission Liao2018-10-113-5/+5
| | | | | | | | When a block is confirmed, all its txs are permitted to be executed. Therefore, exporting this method provides more and earlier information about txs to be executed, and helps application layer to process txs more efficiently.
* core: types: fix nodeID generation (#191)Wei-Ning Huang2018-10-114-6/+10
| | | | | Use ethereum style nodeID generation (keccak on compressed public key without the first byte).
* simulation: Fix docker build fail (#188)Jimmy Hu2018-10-093-3/+9
|
* Merge pull request #187 from dexon-foundation/w-bytesSonic2018-10-091-0/+5
|\ | | | | common: add Bytes() method to Hash
| * Merge branch 'master' into w-bytesWei-Ning Huang2018-10-0912-39/+74
| |\ | |/ |/|
* | Fix typo in crypto (#186)Jimmy Hu2018-10-092-2/+16
| |
* | core: Add round to DKG methods in gov. Change network interface name (#185)Jimmy Hu2018-10-0910-37/+58
| |
| * common: add Bytes() method to HashWei-Ning Huang2018-10-091-0/+5
|/
* core: Add DKG final message. (#181)Jimmy Hu2018-10-0914-2/+175
|
* core: update config variable name grammar and remove configuration (#184)Wei-Ning Huang2018-10-088-64/+26
|
* core: Fix timestamp (#182)Jimmy Hu2018-10-082-5/+1
|
* core: Remove round from gov.ProposeCRS (#183)Jimmy Hu2018-10-085-18/+31
|
* core: Check PrivateShare in DKGComplaint (#180)Jimmy Hu2018-10-082-25/+75
|
* core: Add block randomness in compaction-chain module (#179)Jimmy Hu2018-10-086-32/+153
|
* core: Block randomness generation. (#178)Jimmy Hu2018-10-084-7/+73
|
* core: General tsig (#177)Jimmy Hu2018-10-0514-73/+287
|
* core: Add NotarySet and DKGSet to cache (#176)Jimmy Hu2018-10-053-27/+94
|
* types: Test block clone (#175)Jimmy Hu2018-10-052-0/+73
|
* core: find block in db (#174)Mission Liao2018-10-057-79/+199
| | | | | | | | | | | | | | | | | | | | * 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.
* core: Use event to run DKG and CRS in Consensus. (#171)Jimmy Hu2018-10-044-53/+71
|
* core: Check sorted ack in sanity check (#173)Jimmy Hu2018-10-044-1/+44
|
* core: split lattice-data to another file (#172)Mission Liao2018-10-044-1058/+1069
| | | | | - Split latticeData to another file - Remove areAllAcksInLattice
* core: Check Witness height. Add ConsensusTime and ConsensusHeight to block. ↵Jimmy Hu2018-10-0416-61/+159
| | | | (#170)
* common: Add an Event module (#169)Jimmy Hu2018-10-042-0/+175
|
* test: Short test applied to some long running tests (#168)Jimmy Hu2018-10-043-3/+16
|
* core: remove NumWitnessSet in governance config (#167)Wei-Ning Huang2018-10-033-9/+3
| | | | NumWitnessSet is no longer required as we don't have witness set in the design anymore.
* core: export some crypto verification function (#166)Wei-Ning Huang2018-10-033-7/+9
| | | | | verifyDKGMasterPublicKeySignature and verifyDKGComplaintSignature are needed in the governance contract to verify the signature. Export than so fullnode can use it.
* core: publish round based config (#165)Mission Liao2018-10-0311-33/+147
|
* CurcleCI: Run full test on master (#164)Jimmy Hu2018-10-032-1/+16
|
* core: Add unit test for DKG CRS in consensus (#163)Jimmy Hu2018-10-033-4/+120
|
* core: Prevent duplicated nack complaint (#162)Jimmy Hu2018-10-032-1/+14
|
* core: remove shard (#161)Mission Liao2018-10-027-683/+620
|
* core: Export DKGGroupPublicKey and its verify function (#160)Jimmy Hu2018-10-023-18/+21
|
* core: replace reliable-broadcast with shard (#159)Mission Liao2018-10-0216-1458/+264
|
* core: remove ProposeThresholdSignature/GetThresholdSignature (#158)Wei-Ning Huang2018-10-024-48/+5
| | | Also rename the argument name of ProposeCRS.
* core: run DKG and CRS at background. (#155)Jimmy Hu2018-10-0215-57/+142
|
* core: update data model to reflect new model (#157)Wei-Ning Huang2018-10-0123-611/+51
| | | | | | Update data model: 1) Remove witness ack. 2) Add round to block. 3) Update governance interface.
* core: check block timestamp (#156)Jimmy Hu2018-10-013-29/+73
|
* test: Non-qualified node are accepted in test. (#154)Jimmy Hu2018-10-014-12/+25
|
* core: use notarySet for BA module. (#153)Jimmy Hu2018-10-018-82/+117
|
* core: integrate authenticator (#150)Mission Liao2018-09-3012-192/+153
|
* test: tcp handshake (#151)Jimmy Hu2018-09-301-49/+175
|
* core: Allow more time for DKG to finish on CircleCI machine. (#152)Jimmy Hu2018-09-291-1/+1
|
* core: remove legacy mode (#149)Mission Liao2018-09-288-77/+48
|
* core: Add sizes of various nodeSets (#148)Jimmy Hu2018-09-285-24/+81
|
* core: hide types.NodeID from full node. (#147)Mission Liao2018-09-2821-251/+544
| | | | | | | | | * 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.
* types: NodeSet and Selector (#146)Jimmy Hu2018-09-272-0/+203
|
* core: update governance interface and config (#145)Wei-Ning Huang2018-09-279-57/+61
| | | | | | 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-2614-41/+41
|
* core: use dexon-foundation/dexon instead of ethereum/go-ethereum (#143)Wei-Ning Huang2018-09-265-23/+23
|
* Fix racing (#142)Jimmy Hu2018-09-261-3/+6
|
* crypto: sigtopub to crypto package. remove SigToPubFn (#141)Jimmy Hu2018-09-2629-138/+152
|
* core: move crypto to core/crypto (#140)Mission Liao2018-09-2642-135/+112
| | | | | | | | | - 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
* Fix race (#138)Jimmy Hu2018-09-261-1/+16
|
* core: configuration chain test (#137)Jimmy Hu2018-09-265-9/+226
|
* core: run TSIG for first configuration block at startup (#135)Jimmy Hu2018-09-2615-70/+473
|
* core: update governance interface to consider genesis state (#136)Wei-Ning Huang2018-09-2517-94/+123
|
* Fix naming of methods (#134)Mission Liao2018-09-2511-83/+83
| | | | | | - BlockDeliver -> BlockDelivered - TotalOrderingDeliver -> TotalOrderingDelivered - WitnessAckDeliver -> WitnessAckDelivered - VerifyPayload -> VerifyPayloads
* core: add debug (#133)Mission Liao2018-09-2513-239/+190
| | | | | | | | | | | | | | | | | | | | | * 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.
* Use static linking for libbls (#132)Wei-Ning Huang2018-09-254-47/+3
|
* core: add key holder (#130)Mission Liao2018-09-253-0/+220
| | | | | The purpose to add this module is to export the functionality to sign/verify data without exporting private key directly.
* core: Fix random test failure (#131)Jimmy Hu2018-09-251-1/+1
|
* core: run first DKG at startup. (#129)Jimmy Hu2018-09-2320-69/+377
|
* env.sh: set LD_LIBRARY_PATH and DYLD_LIBRARY_PATHWei-Ning Huang2018-09-211-0/+4
|
* bin: patches: update patch due to upstream changes (#128)Wei-Ning Huang2018-09-211-9/+10
|
* core: add shard (#127)Mission Liao2018-09-218-107/+504
| | | | | | | A shard is basically DEXON v1 components, except the strongly acked part, including: - maintaining lattice structure - total ordering - generate consensus timestamp
* dep: update dependenciesWei-Ning Huang2018-09-211-40/+5
|
* test: fix block generator (#126)Mission Liao2018-09-216-76/+99
| | | | | | | | * Generate correct hash/signature when generating blocks. * Refine naming, types. - type of chainNum should be uint32 by default - rename blockCount to blockNum - rename nodeCount to chainNum
* core: add anti-complaint and nack-complaint to dkg protocol (#123)Jimmy Hu2018-09-214-35/+282
|
* core: refactor witness data processing flow (#124)Wei-Ning Huang2018-09-2010-33/+133
| | | | | | | | | | | 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.
* core: add blockpool (#121)Mission Liao2018-09-205-22/+190
| | | | | | core.blockPool is used to cache blocks arrived out-of-order. Our consensus should retry those blocks after their acking blocks added to lattice.
* test_config: update config to latest runnable version (#122)Wei-Ning Huang2018-09-202-7/+15
|
* core: add blocklattice (#117)Mission Liao2018-09-202-0/+992
| | | | | | | | | | | | | blocklattice is used to replace reliable broadcast. Aiming to fix these problems: - The mechanism related to strong ack is no longer required. - The sanity-check of one block would be passed even if its acking block doesn't exist. This commit doesn't include logic to handle out-of-order blocks. It should be done in another PR.
* Rename validator* to node* (#120)Mission Liao2018-09-2063-1151/+1154
|
* core: Add dkg test (#119)Jimmy Hu2018-09-193-0/+210
|
* core: rename Notary (Acks) to Witness (#118)Wei-Ning Huang2018-09-1919-230/+230
|
* core: Nack Complaint (#116)Jimmy Hu2018-09-192-11/+83
|
* core:DKG and TSIG protocol (#115)Jimmy Hu2018-09-1910-29/+791
|
* core: refine governance interface to reduce Get* methods (#114)Wei-Ning Huang2018-09-189-153/+116
| | | | | 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.
* bin: allow non-root homebrew install to work (#113)Wei-Ning Huang2018-09-183-0/+41
| | | | | | | | In order for non-root homebrew install to work, we need to setup some custom CFLAGS and LDFLAGS variables, we also need to patch the mcl library so we are able to build. A PR is sent to the mcl upstream, the local patch will be removed once the upstream PR is merged.
* core: remove ticker parameter from NewConsensusMission Liao2018-09-1810-53/+113
| | | | | | | | | - 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-1725-30/+43
| | | | | | | 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-178-4/+179
|
* cleanup (#109)Mission Liao2018-09-173-71/+39
| | | | | | - With context, we don't need stopChan - Remove core.BlockChain. - Remove unused variable.
* crypto: Add Benchmark for DKG (#105)Jimmy Hu2018-09-142-0/+174
|
* core: Fix BA Fork issues (#104)Jimmy Hu2018-09-135-69/+60
|
* core: fix VerifyPayload argument (#103)Wei-Ning Huang2018-09-135-5/+5
| | | | Since we are using a byte slice for storing payload. VerifyPayload() should also accepts a byte slice.
* crypto: dkg implementation and test. (#96)Jimmy Hu2018-09-136-2/+636
| | | | | | | | * DKG API and test. * Change naming * Broadcast pubShares
* core: replace acks with slice (#102)Mission Liao2018-09-1215-247/+172
|
* core: types: use []byte for block Payload type (#101)Wei-Ning Huang2018-09-128-22/+19
| | | | | 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.
* core: total ordering with chain ID (#100)Mission Liao2018-09-125-414/+363
|
* simulation: integrate test.Transport (#99)Mission Liao2018-09-1116-985/+597
| | | | | - 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-1113-361/+173
|
* test: add transport layer (#97)Mission Liao2018-09-1010-12/+1100
| | | | | | | | | | 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
* CRYPTO: dkg library (#95)Jimmy Hu2018-09-056-9/+101
|
* misc: Polish BA. (#94)Jimmy Hu2018-09-0511-56/+84
|
* core: BA-based consensus core. (#93)Jimmy Hu2018-09-0415-106/+616
|
* Add GetChainNumber to Goverance (#92)Jimmy Hu2018-09-035-23/+27
|
* core: minor change to governance interface (#90)Wei-Ning Huang2018-09-035-67/+30
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-0324-228/+436
| | | | `Height` from `Block` (#89)
* Fix VerifyPayloads in nonBlockingApplication (#87)Jimmy Hu2018-08-311-1/+1
|
* Add methods to Application interface. (#86)Jimmy Hu2018-08-317-92/+56
|
* Use Network in Consensus core (#85)Jimmy Hu2018-08-315-3/+163
|
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-3014-73/+73
| | | | interface. (#84)
* core: Change the lattice key from validatorID to chainID. (#83)Jimmy Hu2018-08-307-98/+210
| | | | | * Add chainID in simulation.Validator * Change validatorid to chainID in rbModule
* core: tune total ordering performance (#81)Mission Liao2018-08-309-443/+592
| | | | | - Replace map with slice Compared to slice, accessing to map is slower and the memory usage is inefficient.
* Copy block (#82)Jimmy Hu2018-08-301-0/+2
|
* core: Leader Selector. (#80)Jimmy Hu2018-08-3012-29/+311
|
* core: Remove channel in agreement (#79)Jimmy Hu2018-08-293-172/+111
|
* crypto test for vote (#78)Jimmy Hu2018-08-291-0/+18
|
* core: Add agreement module (#77)Jimmy Hu2018-08-295-2/+1099
|
* core: tune performance (#73)Mission Liao2018-08-2811-202/+562
| | | | | | | | | | | | | | | | | | | | | | - 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-288-4/+139
|
* 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-228-7/+102
| | | | | | | | 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-229-0/+87
|
* simulation: add simulation with scheduler (#71)Mission Liao2018-08-2115-89/+544
| | | | | | | | - 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.
* core: Notary ack (#69)Jimmy Hu2018-08-2111-188/+383
|
* core: tune performance total ordering (#66)Mission Liao2018-08-214-386/+577
| | | | | | - the checking of `internal stability` is more expensive than checking `len(ANS) == validatorCount`. So only check it when `len(ANS) != validatorCount`. - cache the result of `grade` between candidates. - cache the `acking height vector` of each candidate. - add test on total ordering with different acking frequency between blocks.
* core: NotaryAck interfaces. (#67)Jimmy Hu2018-08-2011-67/+136
|
* 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
* core: implicit fields in types.Block used in reliable broadcast (#59)Haoping Ku2018-08-174-69/+83
|
* simulation: Fix port reuse error in simulation. (#65)Jimmy Hu2018-08-172-16/+71
|
* core: Remove notary ack. (#64)Jimmy Hu2018-08-168-168/+197
|
* Verify consensus info and the acking's signature (#63)Jimmy Hu2018-08-161-3/+29
|
* core: Add compaction chain module. (#60)Jimmy Hu2018-08-166-18/+188
|
* test: add test.Scheduler (#58)Mission Liao2018-08-1511-5/+976
| | | | | | | | | | | 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.
* core: Add a nonBlockingApplication. (#62)Jimmy Hu2018-08-154-8/+238
|
* test: refine test utility (#61)Mission Liao2018-08-156-49/+307
| | | | | * Add functionality to test.App * Add test utility to generate slices of types.ValidatorID
* core: Prepare Genesis block. (#54)Jimmy Hu2018-08-145-60/+125
|
* remove cpu.prof (#57)Jimmy Hu2018-08-141-0/+0
|
* Add -cpuprofile and -memprofile to dexcon-simulation (#56)Jimmy Hu2018-08-142-0/+28
|
* test: Fix a bug in test. (#55)Jimmy Hu2018-08-141-0/+1
|
* core: add nack module (#41)Haoping Ku2018-08-135-113/+605
|
* 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-138-19/+54
|
* simulation: kubernetes: update configWei-Ning Huang2018-08-135-12/+12
|
* core: ValidatorID.Hash is the hash of public key. (#49)Jimmy Hu2018-08-135-9/+36
|
* simulation: kubernetes: update config templateWei-Ning Huang2018-08-131-0/+4
|
* crypto: Add SigToPub. (#48)Jimmy Hu2018-08-132-5/+35
| | | | * Add SigToPub function in crypto
* core: Hash block in Consensus.PrepareBlock. (#46)Jimmy Hu2018-08-128-70/+162
| | | | | | | | * Add hash to block * Check block hash in Consensus.sanityCheck * Add hashBlockFn in block generator.go
* core: reliable-broadcast: delete old blocks (#47)Haoping Ku2018-08-102-3/+13
| | | | Delete all blocks in received blocks array for avoiding using too much memory space.
* core: Modify Consensus interface (#45)Jimmy Hu2018-08-106-19/+47
|
* core: update governance interface and move K into config (#40)Wei-Ning Huang2018-08-1014-140/+233
|
* 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-104-29/+25
| | | | | | | | | | | | | | | | | | | | * 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-105-20/+26
|
* core: Add block hash signature functions in core/ctypto.go. (#39)Jimmy Hu2018-08-104-10/+174
|
* Add -race to go test (#38)Jimmy Hu2018-08-091-1/+1
|
* core: Add Block.IsGenesis() and set Block.ParentHash to 0 in genesis block. ↵Jimmy Hu2018-08-099-113/+109
| | | | (#37)
* Gopkg: fixup importsWei-Ning Huang2018-08-091-1/+21
|
* simulation: Fix k8s simulation issues. (#36)Jimmy Hu2018-08-093-9/+41
| | | | | | | | | | | | * 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-0821-1237/+1039
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* crypto: Add crypto module. (#34)Jimmy Hu2018-08-0815-17/+534
|
* simulation: Show internal and external timestamp latency. (#30)Jimmy Hu2018-08-075-17/+204
|
* 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.
* Rename names of struct and filesMission Liao2018-08-066-392/+392
| | | | | | | | | | | Rename these files: - core/sequencer[_test].go -> core/total-ordering[_test].go - core/acking[_test].go -> core/reliable-broadcast[_test].go - core/timestamp[_test].go -> core/consensus-timestamp[_test].go Rename these structs: - core.sequencer -> core.totalOrdering - core.acking -> core.reliableBroadcast - core.timestamp -> core.consensusTimestamp
* simulation: free resource after use and misc fix for k8s mode (#31)Wei-Ning Huang2018-08-069-17/+66
|
* Gopkg: update importsWei-Ning Huang2018-08-052-36/+10
|
* test: random blocks generator (#26)Mission Liao2018-08-0310-6/+975
| | | | | | | | | | | | | | | | | | | | | | * Add blocks generator. This helper would randomly generate blocks that forms valid DAGs. * Add revealer Revealer is an extension of blockdb.BlockIterator. The block sequence from 'Next' method would be either randomly (see RandomRevealer) or meeting some specific condition (ex. forming a DAG, see RandomDAGRevealer). * Add test for sequencer based on random blocks. * core: refine Application interface and add Governance interface (#24) 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.
* core: DEXON Consensus Timestamp Algorithm. (#29)Jimmy Hu2018-08-034-10/+377
|
* core: make acking module implicit (#28)Haoping Ku2018-08-012-46/+46
| | | | This commit made acking module in core implicit for avoiding other package to use. And fix underscore error messages.
* core: fix decimal package import (#27)Wei-Ning Huang2018-08-011-1/+1
|
* Remove timestamp generating function in validator (#25)Jimmy Hu2018-08-012-25/+9
|
* core: refine Application interface and add Governance interface (#24)Wei-Ning Huang2018-07-316-16/+84
| | | | | | | 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-318-147/+294
| | | | | | | | | | | | - 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 new sorting method for blocksMission Liao2018-07-312-0/+65
| | | | - Add types.ByHeight to sort slice of blocks by their heights. - Add test case for sorting methods of types.Block.
* Implement DEXON total ordering algorithm (#16)Mission Liao2018-07-302-0/+1396
| | | | | | | | | | | | | | Implement K-Level Total ordering algorithm Besides algorithm implementation, these concepts are also included: The candidate set and ackingStatusVector of each candidate won't be recalculated upon receiving each block. Make the component to calculate total ordering more self-contained. The access to block status is only required when receiving a new block.
* Add acking module (#13)Haoping Ku2018-07-306-27/+762
| | | | | | | * Refactor and add acking module Extract acking module for unit testing. This commit splits functions into small pieces for better understanding and easy unit testing.