aboutsummaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* core: total ordering with chain ID (#100)Mission Liao2018-09-125-414/+363
|
* simulation: integrate test.Transport (#99)Mission Liao2018-09-113-33/+115
| | | | | - 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-1111-356/+170
|
* test: add transport layer (#97)Mission Liao2018-09-105-0/+1142
| | | | | | | | | | 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
* misc: Polish BA. (#94)Jimmy Hu2018-09-055-31/+36
|
* core: BA-based consensus core. (#93)Jimmy Hu2018-09-0410-103/+592
|
* Add GetChainNumber to Goverance (#92)Jimmy Hu2018-09-032-0/+8
|
* core: minor change to governance interface (#90)Wei-Ning Huang2018-09-034-62/+30
|
* core: Add a new structure `Position` and move `ShardID`, `ChainID` and ↵Jimmy Hu2018-09-0320-215/+411
| | | | `Height` from `Block` (#89)
* Fix VerifyPayloads in nonBlockingApplication (#87)Jimmy Hu2018-08-311-1/+1
|
* Add methods to Application interface. (#86)Jimmy Hu2018-08-315-0/+45
|
* Use Network in Consensus core (#85)Jimmy Hu2018-08-312-1/+116
|
* core: Add PreparePayloads to Application and Remove blockConverter ↵Jimmy Hu2018-08-3010-66/+57
| | | | interface. (#84)
* core: Change the lattice key from validatorID to chainID. (#83)Jimmy Hu2018-08-305-97/+176
| | | | | * 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-309-23/+287
|
* 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-294-0/+1086
|
* core: tune performance (#73)Mission Liao2018-08-285-155/+489
| | | | | | | | | | | | | | | | | | | | | | - 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-284-4/+115
|
* core: Notary ack application. (#70)Jimmy Hu2018-08-225-0/+58
|
* simulation: add simulation with scheduler (#71)Mission Liao2018-08-216-41/+76
| | | | | | | | - 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-2110-186/+381
|
* 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-2010-67/+132
|
* core: implicit fields in types.Block used in reliable broadcast (#59)Haoping Ku2018-08-173-66/+83
|
* 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-158-5/+711
| | | | | | | | | | | 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-144-53/+121
|
* remove cpu.prof (#57)Jimmy Hu2018-08-141-0/+0
|
* Add -cpuprofile and -memprofile to dexcon-simulation (#56)Jimmy Hu2018-08-141-0/+0
|
* test: Fix a bug in test. (#55)Jimmy Hu2018-08-141-0/+1
|
* core: add nack module (#41)Haoping Ku2018-08-135-113/+605
|
* core: Sign block in Consensus.PrepareBlock. (#50)Jimmy Hu2018-08-135-13/+43
|
* core: ValidatorID.Hash is the hash of public key. (#49)Jimmy Hu2018-08-131-0/+7
|
* 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-105-18/+46
|
* core: update governance interface and move K into config (#40)Wei-Ning Huang2018-08-106-40/+83
|
* Fix the bug preventing us from testing large group when using TCP-Local (#42)Mission Liao2018-08-102-8/+1
| | | | | | | | | | | | | | | | | | | | * 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-103-11/+9
|
* core: Add block hash signature functions in core/ctypto.go. (#39)Jimmy Hu2018-08-104-10/+174
|
* core: Add Block.IsGenesis() and set Block.ParentHash to 0 in genesis block. ↵Jimmy Hu2018-08-098-109/+106
| | | | (#37)
* core: Add Consensus to replace core.Blocklattice (#35)Mission Liao2018-08-0816-1201/+868
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-086-14/+210
|
* simulation: Show internal and external timestamp latency. (#30)Jimmy Hu2018-08-071-0/+11
|
* 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
* test: random blocks generator (#26)Mission Liao2018-08-039-6/+958
| | | | | | | | | | | | | | | | | | | | | | * 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-033-10/+369
|
* 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
|
* core: refine Application interface and add Governance interface (#24)Wei-Ning Huang2018-07-315-9/+77
| | | | | | | 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 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-305-24/+759
| | | | | | | * 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.
* Verify the Total Ordering Algorithm in peerServer in tcp mode (#11)Jimmy Hu2018-07-261-35/+0
| | | Verify the Total Ordering Algorithm in peerServer in tcp mode.
* 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 blockdb levelDB backend (#6)Mission Liao2018-07-221-0/+1
|
* Implement simulation on a real network (#5)Wei-Ning Huang2018-07-206-86/+48
| | | simulation: implement simulation on a real network
* core: refactor acking relationship (#3)Wei-Ning Huang2018-07-183-166/+135
| | | | | | | | | * 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-174-5/+5
| | | | | * Fix typos and add .gitignore * Add more rule on .gitignore
* Initial implementation of DEXON consensus algorithmWei-Ning Huang2018-07-169-0/+1396