aboutsummaryrefslogtreecommitdiffstats
path: root/blockdb
Commit message (Collapse)AuthorAgeFilesLines
* core: move blockdb into core package and minor change on governance ↵Wei-Ning Huang2018-09-175-642/+0
| | | | | | | 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: replace acks with slice (#102)Mission Liao2018-09-121-9/+5
|
* core: timestamp (#98)Jimmy Hu2018-09-111-4/+2
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-032-7/+17
| | | | `Height` from `Block` (#89)
* core: tune performance (#73)Mission Liao2018-08-281-10/+2
| | | | | | | | | | | | | | | | | | | | | | - 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: implicit fields in types.Block used in reliable broadcast (#59)Haoping Ku2018-08-171-3/+0
|
* 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.
* blockdb: allow to dump blocks to json-encoded fileMission Liao2018-07-315-136/+282
| | | | | | | | | | | | - 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-3/+3
| | | | | | | * 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.
* Add test to cover blockdb.syncIndex.Jimmy Hu2018-07-241-0/+48
| | | | | | * Add test to cover blockdb.syncIndex * Test GetByValidatorAndHeight after syncIndex
* Remove test db after test (#9)Jimmy Hu2018-07-231-4/+6
|
* Implement blockdb levelDB backend (#6)Mission Liao2018-07-224-12/+304
|
* Fix typos and add .gitignore (#2)Haoping Ku2018-07-171-3/+3
| | | | | * Fix typos and add .gitignore * Add more rule on .gitignore
* Initial implementation of DEXON consensus algorithmWei-Ning Huang2018-07-162-0/+144