aboutsummaryrefslogtreecommitdiffstats
path: root/dex/handler.go
Commit message (Collapse)AuthorAgeFilesLines
* core, rawdb, dex: improve gov state for syncing (#393)Sonic2019-04-241-0/+3
| | | | * core, rawdb, dex: improve gov state for syncing
* dex: add pullblock rate limit (#363)Jimmy Hu2019-04-151-8/+20
|
* dex: implement bad peer detect and disconnect mechanism (#360)Wei-Ning Huang2019-04-121-8/+45
|
* dex: reduce agreement result (#348)Jimmy Hu2019-04-091-0/+1
|
* dex: remove node table (#330)Sonic2019-04-091-88/+22
| | | | | | * dex: remove node table Node table is not so useful, go back to rely on kademlia * p2p: fix direct dial still have resolve delay
* dex: try to reduce the chance to pull non-finalized blocks (#327)Mission Liao2019-04-091-10/+21
| | | | | | | | | | | | | | | | * Send non-finalized blocks to notary set only * Update randomness field for blocks in cache upon receiving agreement result * Filter AgreementResult by its position * Avoid overwriting finalized blocks with non-finalized ones * Add blocks to finalized cache when pulling * Update to finalized cache when we have corresponding element in non-finalized one.
* vendor: sync to latest core (#320)Jimmy Hu2019-04-091-3/+2
| | | | | | | | * vendor: sync to latest core * dex, core: fix conflict x
* core: fix forget connection in resetDKG (#314)Jimmy Hu2019-04-091-1/+1
|
* dex: fix initial build connection bug (#311)Jimmy Hu2019-04-091-4/+5
|
* dex: rebuild connection if dkg reset, core/vm: fix gov (#308)Jimmy Hu2019-04-091-2/+11
| | | | | * dex: rebuild connection if dkg reset * core: vm: fix governance contract
* core: merge notarySet and DKGSet (#265)Jimmy Hu2019-04-091-62/+58
| | | | | | | | * vendor: sync to latest core * core: merge notarySet and dkgSet * dex: optimize network traffic for finalized block
* backport from v1.8.23 (#304)Sonic2019-04-091-3/+20
| | | | | | | | | | | | | | | | | | * dex: backport f6193ad * dex/downloader: backport accc0fa accc0fab 174083c3 * dex: backport 434dd5b * dex: backport 42a914a 0983d02 * dex: backport 48b70ec 31b3334 and some modification * dex/downloader: backport 5f251a6 * dex/downloader: backport 81c3dc7 * dex, dex/downloader: fix typos
* dex: fix missing trie node when fast syncing (#301)Sonic2019-04-091-2/+3
| | | | | | * dex: don't panic when we don't have gov state peer requested * dex: use correct head block Since we are fast syncing, we probably don't have body, receipt, state
* dex: fix fast sync in BP mode (#291)Wei-Ning Huang2019-04-091-34/+38
| | | | Start blockproposer only after fast sync is completed (received ChainHead event), so watchcat is not falsely triggered.
* dex: reduce msg when broadcast tx (#292)Sonic2019-04-091-4/+51
| | | | | | | | | | Our network topology is different from ethereum, the nodes in notary set will connect each other directly. So there is a waste for flooding tx msgs in notary set. And nodes in notary set are more likely to propose block successfully, it is not useful to broadcast tx msgs to non notary set nodes. This PR will increase some tx confirm latency, but can reduce waste tx msgs a lot.
* dex: recieve bp msg when recovery, use atomic to protect the flag (#286)Sonic2019-04-091-11/+15
|
* dex: ignore acceptableDist when force synchronise (#285)Sonic2019-04-091-1/+1
|
* dex: fix start bp node with empty datadir (#278)Sonic2019-04-091-17/+23
| | | also modify some debug log
* p2p, dex: add debug log (#269)Sonic2019-04-091-0/+34
|
* dex: properly shutdown protocol stack (#267)Wei-Ning Huang2019-04-091-2/+2
|
* dex: properly start and stop the block proposer module (#264)Wei-Ning Huang2019-04-091-0/+4
| | | | Stop blockproposer in the Stop() method of node service so the process doens't hang.
* core: fill in genesis timstamp and remove dMoment from protocol handshake (#263)Wei-Ning Huang2019-04-091-4/+2
| | | | | | Fill in dmoment as genesis block timestamp. This allow us to remove dMoment check from protocol handshake since genesis block hash itself will protect us against different dMoment.
* dex: rename lattice to coreWei-Ning Huang2019-04-091-5/+5
|
* dex, dex/downloader: remove some TODO comments (#232)Sonic2019-04-091-3/+0
|
* core: vm: flatten governanceWei-Ning Huang2019-04-091-8/+19
|
* core: sync to latest core (#214)Jimmy Hu2019-04-091-9/+6
| | | | | * vendor: sync to latest core * fix for single chain
* params: add Yilan network (#207)Mission Liao2019-04-091-1/+1
| | | | | | * Add Yilan network * Fixup: remove dummy log
* dex: some minor improvements (#195)Sonic2019-04-091-46/+38
| | | | | | | | | | * dex: improve some msg propagation * dex: support send a batch of lattice blocks, votes, randomnesses To reduce msgs number of PullBlocks, PullVotes, PullRandomness * dex: minor improvement
* dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg (#188)Sonic2019-04-091-31/+35
| | | | | | | | | * dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg So that we can dispatch the response msg to fetcher or downloader easily. * fixup! dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg
* p2p, dex: rework connection management (#183)Sonic2019-04-091-4/+18
| | | | | | * p2p, dex: rework connection management * dex: refresh our node record periodically * dex: don't send new record event if no new record
* dex: reduce pullVote (#172)Jimmy Hu2019-04-091-2/+3
|
* dex: Add rate limit for pullVote (#169)Jimmy Hu2019-04-091-7/+21
|
* dex: add block number gauge (#140)haoping-ku2019-04-091-18/+25
|
* params: write dMoment into ChainConfig (#150)Wei-Ning Huang2019-04-091-2/+4
|
* dex: remove unused log (#136)Sonic2019-04-091-4/+0
| | | | | | * fixup! app: use gcp storage instead of azure for builds (#81) * dex: remove unused log
* dex: replace NodeMeta with ENR (#132)Sonic2019-04-091-66/+42
|
* dex: add pull randomness (#105)Jimmy Hu2019-04-091-0/+27
| | | | | * vendor: sync to latest core * dex: Add PullRandomness
* core, dex, internal: block proposer syncing (first iteration) (#96)Sonic2019-04-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | * dex, internal: block proposer syncing (first iteration) * core: find block from db if not in memory This fix handles stopping proposing and then restarting * core: no need to reorg when reset Dexon will not fork. This commit also fix when a block confirm but its parent is not in db yet, during restarting proposing. * dex: always accept NewBlockMsg, NewBlockHashesMsg We need to accept NewBlockMsg, NewBlockHashesMsg to sync current block with other peers in block proposer mode when syncing lattice data. It's a waste when the node is synced and start proposing. Todo: control msg processing on/off more granular, accept NewBlockMsg, NewBlockHashesMsg when syncing, but stop when synced.
* vendor: sync to latest core (#91)Mission Liao2019-04-091-2/+2
| | | | | | - Implement new methods in db to cache DKG private key. - Implement new methods in db to cache compaction chain tip.
* dex: Pull blocks from blockdb if cache miss (#84)Jimmy Hu2019-04-091-1/+2
|
* core, dex: polish sync (#75)Sonic2019-04-091-5/+32
| | | | | | | | | | | | | | | - Broadcasting blocks at chain head event is not correct when the full node is not running in block proposer mode. Introduce NewFinalizedBlockEvent, this event is post by the full node which runs in block proposer mode when a block is witnessed and resulting in some blocks are considered finalized. - Non block proposer node will still broadcast blocks at the following moment (same as ethereum): 1. a sync with a peer is terminated successfully 2. a block passes the fetcher's header check during inserting blocks 3. a block is successfully inserted by fetcher - Don't trigger a sync when we are not behind other peers more than acceptable distance. Fetcher is able to cover this.
* dex: replace total difficulty with block number (#73)Sonic2019-04-091-33/+27
| | | | | | | In dexon, we don't "mine" and the blockchain won't and shouldn't fork, so there is no difficulty concept, just replace it with block number. Note: this commit only replace total difficulty related logic and code in dex, dex/downloader package.
* dex: use whole id to query peer info (#74)Sonic2019-04-091-1/+1
|
* dex: verify header that imported from fetcher (#68)Sonic2019-04-091-1/+1
|
* core: fix testsWei-Ning Huang2019-04-091-1/+1
|
* core: various changes on tps tuning (#46)Wei-Ning Huang2019-04-091-1/+1
|
* core, dex, downloader: refactor governanceSonic2019-04-091-8/+4
|
* core, dex, dex/downloader: restore insertChain to upstream versionSonic2019-04-091-1/+1
| | | | | Also rename InsertChain2, insertChain2, InsertHeaderChain2, ValidateHeaderChain2
* dex: implement downloader for dexSonic2019-04-091-5/+80
| | | | | | | | | | | We need governance state to verify block's signature (randomness), but in ethereum fast sync mode, eth downloader only downloads the whole state of pivot block, so we don't have governance state to verify the downloaded block that is before pivot block if we don't processing transaction. To avoid running transactions, dex downloader also downloads the governance state (merkle proof and storage) at snapshot height of each round, so that we can verify blocks in fast sync mode.
* dex: use dex/downloader in dexSonic2019-04-091-2/+2
| | | | | To compatible with ethereum code base, make Downloader a interface in internal/ethapi
* core: add global signature cache and improve concurrency (#42)Wei-Ning Huang2019-04-091-1/+1
| | | | | From the go trace result, the bottleneck hides in the lock of StoreTxCache. To improve this, we update the cache in a batched fassion.
* core, dex: Batch process touchSender. Lower priority for tx. (#41)Jimmy Hu2019-04-091-0/+1
| | | | | | | * dex: Add a tx queue in broadcast * Modify queue parameter * Priority select all messages except tx * Batch process TouchSenders
* dex: Tx message optimization (#39)Jimmy Hu2019-04-091-1/+16
| | | | | | | | * dex: Add a tx queue in broadcast * Modify queue parameter * Priority select all messages except tx
* core: fix light node synchronization issue (#30)Wei-Ning Huang2019-04-091-0/+4
| | | | | InsertChain() need to record the correct roundHeight mapping in order to process snapshotRoundHeight() governance method correctly.
* core: refactor validator and fix light node sync (#25)Wei-Ning Huang2019-04-091-39/+64
| | | | | | | | Remove custom Dexon validator by adding a new `ValidateWitnessData` method into the validator interface. This allow us to properly detect know blocks. This also allow other gdex "light" client to sync compaction chain. Also, setup a standalone RPC node for handling RPC reqeusts.
* dex: fix conflict caused by rebaseWei-Ning Huang2019-04-091-5/+12
|
* test: disable standalone RPC server as BroadcastBlock currently cause forkingWei-Ning Huang2019-04-091-3/+1
|
* test: start a separate RPC node for testing block syncWei-Ning Huang2019-04-091-1/+3
|
* Rename import due to dexon-consensus renameWei-Ning Huang2019-04-091-10/+10
|
* dex: implement PullBlocks/PullVotes (#1)Jimmy Hu2019-04-091-0/+80
|
* vendor: sync consensus core and fix conflictWei-Ning Huang2019-04-091-4/+5
|
* dex: prevent broadcasting agreement and randomness indefinitelyWei-Ning Huang2019-04-091-2/+6
|
* dex: misc fixesWei-Ning Huang2019-04-091-0/+2
|
* dex: no need to rlp encode/decode now, consensus supports itSonic2019-04-091-10/+8
|
* dex: fix public key conversionWei-Ning Huang2019-04-091-6/+2
|
* dex: polish network related functionSonic2019-04-091-30/+58
|
* dex: let notary nodes connect to some dkg nodesSonic2019-04-091-16/+17
| | | | BuildConnection builds notary and dkg connections together
* dex: implement peerSetLoopSonic2019-04-091-11/+43
|
* hack: temp fix for running testsWei-Ning Huang2019-04-091-7/+1
|
* dex: add self node meta after StartSonic2019-04-091-2/+32
|
* dex: add method to get NumChains, NotarySet, DKGSet easilySonic2019-04-091-4/+3
|
* dex: network: implement the network interfaceSonic2019-04-091-0/+116
|
* dex: remove DAO related codeSonic2019-04-091-59/+0
|
* dex: redesign p2p network topologySonic2019-04-091-129/+87
| | | | | | | | | | - Let p2p server support direct connection and group connection. - Introduce node meta table to maintain IP of all nodes in node set, in memory and let nodes in the network can sync this table. - Let peerSet able to manage direct connections to notary set and dkg set. The mechanism to refresh the network topology when configuration round change is not done yet.
* Change import go github.com/dexon-foundation/dexonWei-Ning Huang2019-04-091-13/+13
|
* dex: implement notary node info propagation and management mechanismSonic2019-04-091-14/+150
|
* dex: introduce dex64 and remove eth62, eth63Sonic2019-04-091-9/+4
|
* Change package name from eth to dexSonic2019-04-091-1/+1
|
* Copy codebase from ethSonic2019-04-091-0/+787