From e7d6753c4b2ce239becf025d1e14a7c7fe86d8e5 Mon Sep 17 00:00:00 2001 From: Sonic Date: Fri, 21 Dec 2018 14:53:37 +0800 Subject: 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. --- internal/web3ext/web3ext.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'internal/web3ext/web3ext.go') diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index 6b98c8b7e..2253142b9 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -199,6 +199,14 @@ web3._extend({ name: 'stopWS', call: 'admin_stopWS' }), + new web3._extend.Method({ + name: 'startProposing', + call: 'admin_startProposing' + }), + new web3._extend.Method({ + name: 'stopProposing', + call: 'admin_stopProposing' + }), ], properties: [ new web3._extend.Property({ @@ -213,6 +221,14 @@ web3._extend({ name: 'datadir', getter: 'admin_datadir' }), + new web3._extend.Property({ + name: 'isLatticeSyncing', + getter: 'admin_isLatticeSyncing' + }), + new web3._extend.Property({ + name: 'isProposing', + getter: 'admin_isProposing' + }), ] }); ` -- cgit v1.2.3