go-ethereum/eth
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
..
downloader eth/downloader: fix race condition in tests (#22140) 2021-01-09 17:29:19 +01:00
fetcher core, eth, les, trie: add a prefix to contract code (#21080) 2020-08-21 15:10:40 +03:00
filters eth/filters: replace wiki links with new doc pages (#22070) 2020-12-27 22:09:05 +01:00
gasprice cmd, eth: offer maxprice flag for overwritting price cap (#21531) 2020-09-09 18:38:47 +03:00
protocols eth/protocols/eth: fix slice resize flaw (#22181) 2021-01-16 18:15:18 +01:00
tracers eth, eth/tracers: include intrinsic gas in calltracer, expose for all tracers (#22038) 2020-12-27 21:57:19 +01:00
api_backend.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
api_test.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
api_tracer.go core: persist bad blocks (#21827) 2021-01-10 12:54:15 +01:00
api.go eth: return error from eth_chainID during sync before EIP-155 activates (#21686) 2021-01-12 10:52:13 +01:00
backend.go internal/ethapi: restore net_version RPC method (#22061) 2020-12-23 13:43:22 +01:00
bloombits.go eth: updated comments (#21490) 2020-08-26 13:20:12 +03:00
config.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
discovery.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
gen_config.go eth, les: add new config field SyncFromCheckpoint (#22123) 2021-01-19 10:52:45 +01:00
handler_eth_test.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
handler_eth.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
handler_snap.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
handler_test.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
handler.go eth: improve log message (#22146) 2021-01-11 12:53:13 +01:00
peer.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
peerset.go eth: improve log message (#22146) 2021-01-11 12:53:13 +01:00
sync_test.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00
sync.go core, eth: split eth package, implement snap protocol (#21482) 2020-12-14 10:27:15 +01:00