bsc/les
gary rong 45cb1a580a
eth, les: add new config field SyncFromCheckpoint (#22123)
This PR introduces a new config field SyncFromCheckpoint for light client.

In some special scenarios, it's required to start synchronization from some
arbitrary checkpoint or even from the scratch. So this PR offers this
flexibility to users so that the synchronization start point can be configured.

There are two relevant configs: SyncFromCheckpoint and Checkpoint.

- If the SyncFromCheckpoint is true, the light client will try to sync from the
  specified checkpoint.

- If the Checkpoint is not configured, then the light client will sync from the
  scratch(from the latest header if the database is not empty)

Additional notes: these two configs are not visible in the CLI flags but only
accessable in the config file.

Example Usage:

[Eth]
SyncFromCheckpoint = true

[Eth.Checkpoint]
SectionIndex = 100
SectionHead = "0xabc"
CHTRoot = "0xabc"
BloomRoot = "0xabc"

PS. Historical checkpoint can be retrieved from the synced full node or light
client via les_getCheckpoint API.
2021-01-19 10:52:45 +01:00
..
checkpointoracle les: update checktime even if check fails 2020-08-07 10:57:02 +02:00
flowcontrol les/utils: protect against WeightedRandomSelect overflow (#21839) 2020-11-23 10:18:33 +01:00
lespay all: simplify nested complexity and if blocks ending with a return statement (#21854) 2020-11-25 09:24:50 +01:00
utils les: rework float conversion on arm64 and other architectures (#21994) 2020-12-11 10:28:01 +01:00
api_backend.go core, all: split vm.Context into BlockContext and TxContext (#21672) 2020-11-13 13:42:19 +01:00
api_test.go les, les/lespay/server: refactor client pool (#21236) 2020-09-14 22:44:20 +02:00
api.go les, les/lespay/server: refactor client pool (#21236) 2020-09-14 22:44:20 +02:00
benchmark.go les: remove useless protocol defines (#22115) 2021-01-16 19:06:18 +01:00
bloombits.go les: handler separation (#19639) 2019-08-21 11:29:34 +02:00
client_handler.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
client.go internal/ethapi: restore net_version RPC method (#22061) 2020-12-23 13:43:22 +01:00
clientpool_test.go les: remove clientPeerSet and serverSet (#21566) 2020-10-21 10:56:33 +02:00
clientpool.go les: remove clientPeerSet and serverSet (#21566) 2020-10-21 10:56:33 +02:00
commons.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
costtracker.go les: add missing Ticker.Stop call (#20864) 2020-04-02 15:54:59 +02:00
distributor_test.go les: separate peer into clientPeer and serverPeer (#19991) 2020-02-26 11:41:24 +02:00
distributor.go les, les/lespay: implement new server pool (#20758) 2020-05-22 13:46:34 +02:00
enr_entry.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
fetcher_test.go les: fix unittest (#21382) 2020-07-29 13:44:14 +03:00
fetcher.go les: implement new les fetcher (#20692) 2020-07-28 18:02:35 +03:00
handler_test.go les: remove useless protocol defines (#22115) 2021-01-16 19:06:18 +01:00
metrics.go les, les/lespay/server: refactor client pool (#21236) 2020-09-14 22:44:20 +02:00
odr_requests.go les: remove useless protocol defines (#22115) 2021-01-16 19:06:18 +01:00
odr_test.go core, all: split vm.Context into BlockContext and TxContext (#21672) 2020-11-13 13:42:19 +01:00
odr.go les, light: remove untrusted header retrieval in ODR (#21907) 2020-12-10 14:33:52 +01:00
peer_test.go les: introduce forkID (#21974) 2020-12-10 17:20:55 +01:00
peer.go les: les/4 minimalistic version (#21909) 2020-12-15 20:12:14 +01:00
protocol.go les: les/4 minimalistic version (#21909) 2020-12-15 20:12:14 +01:00
pruner_test.go les: historical data garbage collection (#19570) 2020-07-13 11:02:54 +02:00
pruner.go les: historical data garbage collection (#19570) 2020-07-13 11:02:54 +02:00
request_test.go les: historical data garbage collection (#19570) 2020-07-13 11:02:54 +02:00
retrieve.go les: don't drop sentTo for normal cases (#22048) 2021-01-15 23:04:38 +01:00
server_handler.go les: remove useless protocol defines (#22115) 2021-01-16 19:06:18 +01:00
server.go les: remove clientPeerSet and serverSet (#21566) 2020-10-21 10:56:33 +02:00
serverpool_test.go all: simplify nested complexity and if blocks ending with a return statement (#21854) 2020-11-25 09:24:50 +01:00
serverpool.go all: simplify nested complexity and if blocks ending with a return statement (#21854) 2020-11-25 09:24:50 +01:00
servingqueue.go les: separate peer into clientPeer and serverPeer (#19991) 2020-02-26 11:41:24 +02:00
sync_test.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
sync.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
test_helper.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
txrelay.go les: remove transaction propagation limits (#22125) 2021-01-07 23:39:35 +01:00
ulc_test.go les: historical data garbage collection (#19570) 2020-07-13 11:02:54 +02:00
ulc.go cmd, eth, les: fix up ultra light config integration 2019-07-09 20:34:42 +03:00