aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
Commit message (Collapse)AuthorAgeFilesLines
* core: Add BlockSkeleton and Verify functions (#271)Jimmy Hu2018-10-292-1/+8
|
* core: Fix missing fields when cloning blocks. (#268)Mission Liao2018-10-272-4/+33
|
* core: Remove atomic (#266)Jimmy Hu2018-10-271-9/+6
|
* test: clone types.Config, test.Governance, test.State (#262)Mission Liao2018-10-262-0/+64
|
* core: lattice sync (#257)Jimmy Hu2018-10-252-0/+41
|
* core: Move dkg in types to types/dkg. (#253)Jimmy Hu2018-10-252-99/+101
|
* core: fix stuffs (#250)Mission Liao2018-10-243-40/+13
| | | | | | | | * 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-0/+14
| | | | * Change interface of Application.VerifyBlock
* core: add equality checker for dkg related structure (#237)Mission Liao2018-10-232-0/+224
| | | | | | | | | Besides adding equality, also renaming those fields. - PublicKeyShares.shares -> shareCaches - PublicKeyShares.shareIndex -> shareCacheIndex - rlpPublicKeyShares.Shares -> ShareCaches - rlpPublicKeyShares.ShareIndexK -> ShareCacheIndexK - rlpPublicKeyShares.ShareIndexV -> ShareCahceIndexV
* core: prepare empty block if null block is confirmed by BA. (#231)Jimmy Hu2018-10-231-0/+5
|
* core: Handling self proposed DKG private share (#236)Jimmy Hu2018-10-221-11/+7
|
* core: types: implement rlp.Encoder and rlp.Decoder (#232)Sonic2018-10-204-4/+259
| | | | | * core: types: implement rlp.Encoder and rlp.Decoder * crypto: dkg: fix PublicKey.Bytes
* core: initial commit for logger (#228)Mission Liao2018-10-193-1/+32
| | | | | | | | | | | | | * 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: types: implements UnmarshalJSON from DKGMasterPublicKey (#223)Wei-Ning Huang2018-10-181-0/+8
|
* core: total ordering flush (#212)Mission Liao2018-10-182-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-181-0/+31
|
* core: Some sync functions (#220)Jimmy Hu2018-10-171-0/+5
|
* core: Rebroadcast agreement and randomness result. (#218)Jimmy Hu2018-10-171-2/+1
|
* core: New dexon ba (#210)Jimmy Hu2018-10-161-3/+3
|
* core: fix timestamp marshaling (#207)Wei-Ning Huang2018-10-151-1/+1
|
* core: Fix simulation errors. (#202)Jimmy Hu2018-10-151-5/+2
|
* core: latticeData supports config change (#190)Mission Liao2018-10-122-0/+133
| | | | | | | | | | | | | | | * 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-112-22/+29
| | | | | | | * Extract types.FinalizationResult * Change interface: - Application.BlockConfirmed returns whole block. - Application.BlockDelivered returns partial result.
* core: types: fix nodeID generation (#191)Wei-Ning Huang2018-10-111-3/+3
| | | | | Use ethereum style nodeID generation (keccak on compressed public key without the first byte).
* core: Add DKG final message. (#181)Jimmy Hu2018-10-091-1/+8
|
* core: update config variable name grammar and remove configuration (#184)Wei-Ning Huang2018-10-082-48/+8
|
* core: General tsig (#177)Jimmy Hu2018-10-054-15/+47
|
* core: Add NotarySet and DKGSet to cache (#176)Jimmy Hu2018-10-051-14/+2
|
* types: Test block clone (#175)Jimmy Hu2018-10-052-0/+73
|
* core: Check Witness height. Add ConsensusTime and ConsensusHeight to block. ↵Jimmy Hu2018-10-041-9/+13
| | | | (#170)
* core: remove NumWitnessSet in governance config (#167)Wei-Ning Huang2018-10-031-7/+3
| | | | 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-4/+0
|
* core: run DKG and CRS at background. (#155)Jimmy Hu2018-10-023-7/+9
|
* core: update data model to reflect new model (#157)Wei-Ning Huang2018-10-015-70/+10
| | | | | | 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-012-12/+27
|
* core: Add sizes of various nodeSets (#148)Jimmy Hu2018-09-281-0/+33
|
* types: NodeSet and Selector (#146)Jimmy Hu2018-09-272-0/+203
|
* core: update governance interface and config (#145)Wei-Ning Huang2018-09-271-11/+0
| | | | | | 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-1/+1
|
* core: move crypto to core/crypto (#140)Mission Liao2018-09-265-6/+6
| | | | | | | | | - 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-0/+7
|
* core: run TSIG for first configuration block at startup (#135)Jimmy Hu2018-09-262-5/+56
|
* core: update governance interface to consider genesis state (#136)Wei-Ning Huang2018-09-251-3/+5
|
* core: run first DKG at startup. (#129)Jimmy Hu2018-09-232-2/+14
|
* core: add anti-complaint and nack-complaint to dkg protocol (#123)Jimmy Hu2018-09-211-0/+6
|
* core: refactor witness data processing flow (#124)Wei-Ning Huang2018-09-201-0/+8
| | | | | | | | | | | 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-201-6/+21
| | | | | | core.blockPool is used to cache blocks arrived out-of-order. Our consensus should retry those blocks after their acking blocks added to lattice.
* Rename validator* to node* (#120)Mission Liao2018-09-205-19/+19
|
* core: rename Notary (Acks) to Witness (#118)Wei-Ning Huang2018-09-192-20/+20
|
* core:DKG and TSIG protocol (#115)Jimmy Hu2018-09-191-5/+14
|
* core: refine governance interface to reduce Get* methods (#114)Wei-Ning Huang2018-09-181-0/+35
| | | | | 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: DKG interface (#108)Jimmy Hu2018-09-171-0/+47
|
* core: replace acks with slice (#102)Mission Liao2018-09-122-19/+34
|
* core: types: use []byte for block Payload type (#101)Wei-Ning Huang2018-09-121-6/+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.
* core: timestamp (#98)Jimmy Hu2018-09-111-20/+9
|
* core: BA-based consensus core. (#93)Jimmy Hu2018-09-042-2/+4
|
* core: minor change to governance interface (#90)Wei-Ning Huang2018-09-031-8/+2
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-034-21/+56
| | | | `Height` from `Block` (#89)
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-301-23/+6
| | | | interface. (#84)
* Copy block (#82)Jimmy Hu2018-08-301-0/+2
|
* core: Leader Selector. (#80)Jimmy Hu2018-08-301-0/+3
|
* core: tune performance (#73)Mission Liao2018-08-281-14/+48
| | | | | | | | | | | | | | | | | | | | | | - 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-282-1/+65
|
* core: Notary ack (#69)Jimmy Hu2018-08-211-0/+10
|
* core: NotaryAck interfaces. (#67)Jimmy Hu2018-08-202-41/+45
|
* core: implicit fields in types.Block used in reliable broadcast (#59)Haoping Ku2018-08-171-15/+9
|
* core: Remove notary ack. (#64)Jimmy Hu2018-08-161-30/+36
|
* core: Add compaction chain module. (#60)Jimmy Hu2018-08-161-4/+4
|
* core: Prepare Genesis block. (#54)Jimmy Hu2018-08-141-0/+1
|
* core: Sign block in Consensus.PrepareBlock. (#50)Jimmy Hu2018-08-131-0/+5
|
* core: ValidatorID.Hash is the hash of public key. (#49)Jimmy Hu2018-08-131-0/+7
|
* core: reliable-broadcast: delete old blocks (#47)Haoping Ku2018-08-101-0/+1
| | | | Delete all blocks in received blocks array for avoiding using too much memory space.
* core: Modify Consensus interface (#45)Jimmy Hu2018-08-101-3/+9
|
* core: update governance interface and move K into config (#40)Wei-Ning Huang2018-08-102-16/+46
|
* core: Add block hash signature functions in core/ctypto.go. (#39)Jimmy Hu2018-08-102-6/+35
|
* core: Add Block.IsGenesis() and set Block.ParentHash to 0 in genesis block. ↵Jimmy Hu2018-08-092-6/+29
| | | | (#37)
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-082-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-081-8/+28
|
* test: random blocks generator (#26)Mission Liao2018-08-031-0/+17
| | | | | | | | | | | | | | | | | | | | | | * 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-031-10/+12
|
* core: refine Application interface and add Governance interface (#24)Wei-Ning Huang2018-07-311-0/+6
| | | | | | | 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.
* 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.
* Add acking module (#13)Haoping Ku2018-07-301-6/+7
| | | | | | | * 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.
* Implement simulation on a real network (#5)Wei-Ning Huang2018-07-202-20/+10
| | | simulation: implement simulation on a real network
* core: refactor acking relationship (#3)Wei-Ning Huang2018-07-181-3/+2
| | | | | | | | | * core: refactor acking relationship Use AckBy only, and remove IndirectAcks. Also fix the issue where validator is not filling Height when proposing block.
* Fix typos and add .gitignore (#2)Haoping Ku2018-07-171-1/+1
| | | | | * Fix typos and add .gitignore * Add more rule on .gitignore
* Initial implementation of DEXON consensus algorithmWei-Ning Huang2018-07-162-0/+126