diff options
author | Sonic <sonic@dexon.org> | 2018-12-21 14:53:37 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:20 +0800 |
commit | e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5 (patch) | |
tree | 2b794474971e637eea79c061ae0e686c390d90d4 /les | |
parent | 1dae18a03ae58e4b98a81a1596fedb9cb2b893e6 (diff) | |
download | go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.tar go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.tar.gz go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.tar.bz2 go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.tar.lz go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.tar.xz go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.tar.zst go-tangerine-e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5.zip |
core, dex, internal: block proposer syncing (first iteration) (#96)
* 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.
Diffstat (limited to 'les')
-rw-r--r-- | les/handler_test.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/les/handler_test.go b/les/handler_test.go index 4a22b705b..bca84d346 100644 --- a/les/handler_test.go +++ b/les/handler_test.go @@ -562,23 +562,4 @@ func TestTransactionStatusLes2(t *testing.T) { block1hash := rawdb.ReadCanonicalHash(db, 1) test(tx1, false, txStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.TxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 0}}) test(tx2, false, txStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.TxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 1}}) - - // create a reorg that rolls them back - gchain, _ = core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), db, 2, func(i int, block *core.BlockGen) {}) - if _, err := chain.InsertChain(gchain); err != nil { - panic(err) - } - // wait until TxPool processes the reorg - for i := 0; i < 10; i++ { - if pending, _ := txpool.Stats(); pending == 3 { - break - } - time.Sleep(100 * time.Millisecond) - } - if pending, _ := txpool.Stats(); pending != 3 { - t.Fatalf("pending count mismatch: have %d, want 3", pending) - } - // check if their status is pending again - test(tx1, false, txStatus{Status: core.TxStatusPending}) - test(tx2, false, txStatus{Status: core.TxStatusPending}) } |