-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth, les: add new config "syncFromCheckpoint" #22123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Wanna see what @holiman has to say about this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -21,6 +21,7 @@ func (c Config) MarshalTOML() (interface{}, error) { | |||
NetworkId uint64 | |||
SyncMode downloader.SyncMode | |||
EthDiscoveryURLs []string | |||
SnapDiscoveryURLs []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this field added here by mistake? (if you really wanted to add it, it's fine, no need open another PR just for this change)
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.
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
andCheckpoint
.SyncFromCheckpoint
is true, the light client will try to sync from the specified checkpoint.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:
PS. Historical checkpoint can be retrieved from the synced full node or light client via
les_getCheckpoint
API.Fixes
#21786
#21337