aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus.go
Commit message (Collapse)AuthorAgeFilesLines
* simulation: use test.Governacne in simulation (#311)Mission Liao2018-11-081-1/+2
| | | | | | | | | | | | * 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: revert the revert for broken commit and fix (#309)Mission Liao2018-11-081-67/+78
| | | | | | | | * 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.
* core: Optimize core (#307)Jimmy Hu2018-11-081-10/+34
|
* Revert "core: unbind global round in Consensus (#304)" (#306)Mission Liao2018-11-081-59/+57
| | | This reverts commit 3714ebf2f1054d9984d37b89cf17e885a5856532.
* core: unbind global round in Consensus (#304)Mission Liao2018-11-061-57/+59
|
* core: Run DKG stuffs only if the node is in DKG set (#302)Jimmy Hu2018-11-061-15/+46
|
* core: lattice-data: fix details and add test (#299)haoping-ku2018-11-061-1/+1
|
* core: Fix deadlock (#298)Jimmy Hu2018-11-051-0/+9
|
* core: notify consensus height for genesis rounds (#296)Mission Liao2018-11-051-1/+7
| | | | * Add notifyGenesisRounds * Log round for types.Vote and types.Block
* core: Fix dkg and CRS signature (#294)Jimmy Hu2018-11-051-3/+3
|
* core: Fix BA stuffs (#293)Jimmy Hu2018-11-051-1/+4
|
* core: Fix fork vote (#290)Jimmy Hu2018-11-031-4/+4
|
* core: reset CRS in leader selector by round (#286)Mission Liao2018-11-021-14/+10
|
* 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-0/+3
|
* Rename repo to dexon-consensusWei-Ning Huang2018-11-021-10/+10
|
* core: Fix various locking issues (#285)Jimmy Hu2018-11-021-17/+23
|
* core: fix possible fork vote (#283)Jimmy Hu2018-11-011-1/+1
|
* core: Add PullVotes to Network. (#281)Jimmy Hu2018-10-311-0/+6
|
* core: fix NotifyRoundHeight is not called when processing blocksMission Liao2018-10-311-10/+16
| | | - also add missing logs when calling Application.BlockDelivered.
* core: Fix goroutine leaks (#270)Jimmy Hu2018-10-291-0/+1
|
* core: Unit test for BA sync (#265)Jimmy Hu2018-10-261-0/+13
|
* core: sync BA (#264)Jimmy Hu2018-10-261-15/+40
|
* core: Pull block (#263)Jimmy Hu2018-10-261-23/+65
|
* core: Leader selector will retry sanityCheck (#261)Jimmy Hu2018-10-261-3/+8
|
* core: Lock entire lattice.ProcessBlock (#259)Jimmy Hu2018-10-261-0/+4
| | | | | | * Lock entire ProcessBlock * Lock Consensus.processBlock
* core: lattice sync (#257)Jimmy Hu2018-10-251-9/+6
|
* core: Move dkg in types to types/dkg. (#253)Jimmy Hu2018-10-251-7/+8
|
* core: fix stuffs (#250)Mission Liao2018-10-241-2/+2
| | | | | | | | * 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: disable nonblocking temporarily (#249)Mission Liao2018-10-241-9/+5
|
* core: reduce calls to Application.VerifyBlock (#247)Mission Liao2018-10-241-2/+2
| | | | | | * 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: notify fullnode to snapshot configs when round change. (#243)Mission Liao2018-10-231-8/+19
|
* core: add round parameter to ProposeCRS method (#244)Wei-Ning Huang2018-10-231-2/+2
| | | | | | | | 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/+5
|
* 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-231-6/+35
|
* core: fix uninitialized variable in configuration chain (#238)Wei-Ning Huang2018-10-221-1/+1
|
* core: Handling self proposed DKG private share (#236)Jimmy Hu2018-10-221-11/+22
|
* 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: initial commit for logger (#228)Mission Liao2018-10-191-36/+107
| | | | | | | | | | | | | * 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
* core: Append all config till Initial block (#225)Jimmy Hu2018-10-181-0/+7
|
* core: sync compaction chain (#222)Jimmy Hu2018-10-181-1/+19
|
* core: Add init block to Run() (#221)Jimmy Hu2018-10-181-1/+2
|
* core: Some sync functions (#220)Jimmy Hu2018-10-171-4/+20
|
* core: Rebroadcast agreement and randomness result. (#218)Jimmy Hu2018-10-171-18/+28
|
* core: Add stop function to all components (#216)Jimmy Hu2018-10-171-4/+11
|
* core: New dexon ba (#210)Jimmy Hu2018-10-161-5/+16
|
* core: Change First round dkg timing (#209)Jimmy Hu2018-10-161-4/+5
|
* core: Change threshold (#205)Jimmy Hu2018-10-151-1/+1
|
* Remove duplicated dMoment in Consensus.Run (#206)Jimmy Hu2018-10-151-2/+4
|
* core: Change DKG threshold (#204)Jimmy Hu2018-10-151-2/+2
|
* core: Fix simulation errors. (#202)Jimmy Hu2018-10-151-28/+32
|
* core: fix simulation error (#201)Jimmy Hu2018-10-151-2/+2
| | | | | * Sync dMoment for all consensus core * App check for randomness ignore round 0
* core: No randomness for round 0 (#198)Jimmy Hu2018-10-151-0/+6
| | | | | * No randomness for round 0 * Ignore round 0 randomness
* core: latticeData supports config change (#190)Mission Liao2018-10-121-8/+8
| | | | | | | | | | | | | | | * 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-111-6/+3
| | | | | | | * 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-091-4/+4
|
* core: Add DKG final message. (#181)Jimmy Hu2018-10-091-0/+9
|
* core: update config variable name grammar and remove configuration (#184)Wei-Ning Huang2018-10-081-5/+7
|
* core: Remove round from gov.ProposeCRS (#183)Jimmy Hu2018-10-081-1/+1
|
* core: Add block randomness in compaction-chain module (#179)Jimmy Hu2018-10-081-3/+13
|
* core: Block randomness generation. (#178)Jimmy Hu2018-10-081-3/+66
|
* core: General tsig (#177)Jimmy Hu2018-10-051-2/+61
|
* core: find block in db (#174)Mission Liao2018-10-051-1/+4
| | | | | | | | | | | | | | | | | | | | * 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-041-40/+44
|
* core: publish round based config (#165)Mission Liao2018-10-031-1/+1
|
* core: Add unit test for DKG CRS in consensus (#163)Jimmy Hu2018-10-031-0/+5
|
* core: remove shard (#161)Mission Liao2018-10-021-11/+11
|
* core: replace reliable-broadcast with shard (#159)Mission Liao2018-10-021-171/+50
|
* core: run DKG and CRS at background. (#155)Jimmy Hu2018-10-021-16/+71
|
* core: update data model to reflect new model (#157)Wei-Ning Huang2018-10-011-64/+2
| | | | | | Update data model: 1) Remove witness ack. 2) Add round to block. 3) Update governance interface.
* core: check block timestamp (#156)Jimmy Hu2018-10-011-0/+10
|
* core: use notarySet for BA module. (#153)Jimmy Hu2018-10-011-32/+36
|
* core: integrate authenticator (#150)Mission Liao2018-09-301-45/+31
|
* core: remove legacy mode (#149)Mission Liao2018-09-281-25/+9
|
* core: hide types.NodeID from full node. (#147)Mission Liao2018-09-281-89/+50
| | | | | | | | | * 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-271-6/+11
| | | | | | 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.
* crypto: sigtopub to crypto package. remove SigToPubFn (#141)Jimmy Hu2018-09-261-14/+5
|
* core: move crypto to core/crypto (#140)Mission Liao2018-09-261-1/+1
| | | | | | | | | - 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-1/+1
|
* core: run TSIG for first configuration block at startup (#135)Jimmy Hu2018-09-261-42/+35
|
* core: update governance interface to consider genesis state (#136)Wei-Ning Huang2018-09-251-52/+70
|
* Fix naming of methods (#134)Mission Liao2018-09-251-3/+3
| | | | | | - BlockDeliver -> BlockDelivered - TotalOrderingDeliver -> TotalOrderingDelivered - WitnessAckDeliver -> WitnessAckDelivered - VerifyPayload -> VerifyPayloads
* core: add debug (#133)Mission Liao2018-09-251-15/+13
| | | | | | | | | | | | | | | | | | | | | * 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-231-21/+163
|
* core: add shard (#127)Mission Liao2018-09-211-9/+9
| | | | | | | A shard is basically DEXON v1 components, except the strongly acked part, including: - maintaining lattice structure - total ordering - generate consensus timestamp
* core: refactor witness data processing flow (#124)Wei-Ning Huang2018-09-201-10/+42
| | | | | | | | | | | 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.
* Rename validator* to node* (#120)Mission Liao2018-09-201-24/+24
|
* core: rename Notary (Acks) to Witness (#118)Wei-Ning Huang2018-09-191-15/+15
|
* core: refine governance interface to reduce Get* methods (#114)Wei-Ning Huang2018-09-181-15/+19
| | | | | 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-181-8/+6
| | | | | | | | | - 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-171-8/+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.
* cleanup (#109)Mission Liao2018-09-171-27/+24
| | | | | | - With context, we don't need stopChan - Remove core.BlockChain. - Remove unused variable.
* core: Fix BA Fork issues (#104)Jimmy Hu2018-09-131-16/+16
|
* core: replace acks with slice (#102)Mission Liao2018-09-121-1/+0
|
* core: types: use []byte for block Payload type (#101)Wei-Ning Huang2018-09-121-2/+2
| | | | | 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-121-1/+1
|
* simulation: integrate test.Transport (#99)Mission Liao2018-09-111-1/+0
| | | | | - 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-8/+3
|
* misc: Polish BA. (#94)Jimmy Hu2018-09-051-5/+6
|
* core: BA-based consensus core. (#93)Jimmy Hu2018-09-041-27/+220
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-031-6/+10
| | | | `Height` from `Block` (#89)
* Add methods to Application interface. (#86)Jimmy Hu2018-08-311-0/+1
|
* Use Network in Consensus core (#85)Jimmy Hu2018-08-311-0/+94
|
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-301-13/+8
| | | | interface. (#84)
* core: Change the lattice key from validatorID to chainID. (#83)Jimmy Hu2018-08-301-0/+1
| | | | | * Add chainID in simulation.Validator * Change validatorid to chainID in rbModule
* core: tune total ordering performance (#81)Mission Liao2018-08-301-1/+5
| | | | | - Replace map with slice Compared to slice, accessing to map is slower and the memory usage is inefficient.
* core: tune performance (#73)Mission Liao2018-08-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | - 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-281-0/+5
|
* core: Notary ack application. (#70)Jimmy Hu2018-08-221-0/+4
|
* core: Notary ack (#69)Jimmy Hu2018-08-211-35/+13
|
* core: NotaryAck interfaces. (#67)Jimmy Hu2018-08-201-6/+22
|
* core: Remove notary ack. (#64)Jimmy Hu2018-08-161-22/+25
|
* Verify consensus info and the acking's signature (#63)Jimmy Hu2018-08-161-3/+29
|
* core: Add compaction chain module. (#60)Jimmy Hu2018-08-161-0/+9
|
* core: Add a nonBlockingApplication. (#62)Jimmy Hu2018-08-151-1/+1
|
* core: Prepare Genesis block. (#54)Jimmy Hu2018-08-141-8/+45
|
* core: Sign block in Consensus.PrepareBlock. (#50)Jimmy Hu2018-08-131-2/+33
|
* core: Hash block in Consensus.PrepareBlock. (#46)Jimmy Hu2018-08-121-0/+22
| | | | | | | | * Add hash to block * Check block hash in Consensus.sanityCheck * Add hashBlockFn in block generator.go
* core: Modify Consensus interface (#45)Jimmy Hu2018-08-101-3/+21
|
* core: update governance interface and move K into config (#40)Wei-Ning Huang2018-08-101-5/+2
|
* core: Deliver only Hash to Application. (#43)Jimmy Hu2018-08-101-2/+6
|
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-081-0/+130
* 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.