45cb1a580a
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. |
||
---|---|---|
.. | ||
downloader | ||
fetcher | ||
filters | ||
gasprice | ||
protocols | ||
tracers | ||
api_backend.go | ||
api_test.go | ||
api_tracer.go | ||
api.go | ||
backend.go | ||
bloombits.go | ||
config.go | ||
discovery.go | ||
gen_config.go | ||
handler_eth_test.go | ||
handler_eth.go | ||
handler_snap.go | ||
handler_test.go | ||
handler.go | ||
peer.go | ||
peerset.go | ||
sync_test.go | ||
sync.go |