aboutsummaryrefslogtreecommitdiffstats
path: root/core/blocklattice_test.go
Commit message (Collapse)AuthorAgeFilesLines
* test: fix block generator (#126)Mission Liao2018-09-211-2/+2
| | | | | | | | * 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 blockpool (#121)Mission Liao2018-09-201-13/+13
| | | | | | core.blockPool is used to cache blocks arrived out-of-order. Our consensus should retry those blocks after their acking blocks added to lattice.
* core: add blocklattice (#117)Mission Liao2018-09-201-0/+632
| | | | | | | | | | | | | 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.
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-081-531/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* core: refine Application interface and add Governance interface (#24)Wei-Ning Huang2018-07-311-5/+5
| | | | | | | 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-311-1/+3
| | | | | | | | | | | | - 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
* Add acking module (#13)Haoping Ku2018-07-301-6/+6
| | | | | | | * 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.
* Fix blocklattice_test.go's ordering check (#15)Haoping Ku2018-07-241-2/+6
| | | | | | Outputs of total ordering are sorted by hash value in blocklattice.go, but was checked orderly in test, which the order might change due to random hash. Added common.Hashes.
* Implement simulation on a real network (#5)Wei-Ning Huang2018-07-201-16/+4
| | | simulation: implement simulation on a real network
* core: refactor acking relationship (#3)Wei-Ning Huang2018-07-181-88/+104
| | | | | | | | | * 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-161-0/+521