Skip to content
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

Checkpoint sync default behaviour for testnets #6064

Open
atkinsonholly opened this issue Oct 25, 2023 · 2 comments
Open

Checkpoint sync default behaviour for testnets #6064

atkinsonholly opened this issue Oct 25, 2023 · 2 comments
Labels
meta-discussion Indicates a topic that requires input from various developers. meta-feature-request Issues to track feature requests.

Comments

@atkinsonholly
Copy link
Contributor

Problem description

This issue is being created to follow up on the comment in #6054 (ephemery testnet config) relating to checkpoint sync behaviour. Ephemery testnet spec requires automatic use of checkpoint sync URL, unless overridden by the user with an alternative endpoint.

In Lodestar, however, the checkpoint sync URL has to be provided together with the --checkpointSyncUrl flag. Using the checkpoint sync URL is therefore not current "default" behaviour for testnets.

The purpose of this issue is to open discussion on the preferred default behaviour for ephemery, and other testnets, to obtain the genesis state.

Solution description

Options are discussed below.

If changing default behaviour for testnets:

  • add new property for each network checkpointSyncUrl (string), but keep it undefined for mainnet
  • add flag --disableCheckpointSync (bool)
    Note: For mainnet, a user will still have to choose the checkpoint sync provider they want to use (or none at all).

Otherwise:

  • retain the --checkpointSyncUrl flag as it is currently implemented, and ensure this is properly documented as ephemery recommended usage.

Additional context

No response

@atkinsonholly atkinsonholly added the meta-feature-request Issues to track feature requests. label Oct 25, 2023
@nflaig nflaig added the meta-discussion Indicates a topic that requires input from various developers. label Oct 25, 2023
@taxmeifyoucan
Copy link
Contributor

taxmeifyoucan commented Oct 27, 2023

The idea is that some networks might benefit from default checkpoint sync of genesis instead of keeping it hardcoded in the client. Especially testnets merged from genesis which include bunch of validators, like Holešky, are more practical to download from a server or via checkpoint sync from genesis. Ephemery can utilize this feature to avoid generating the genesis by itself each time.

I am not sure what is the current state, e.g. whether Lodestar keeps whole ssz for Holešky, but some clients take approach of simply downloading it from a hardcoded server address upon start. More native approach would be to use checkpoint server which can provide the genesis state. And providing --checkpointSyncUrl would override the default server address.

I am not sure if this should be default with each testnet, right now it makes sense with Holešky and Ephemery and having the feature implemented would make it future-proof with more merged networks coming. Plus might it be beneficial for testing tools as well

@nflaig
Copy link
Member

nflaig commented Oct 27, 2023

but some clients take approach of simply downloading it from a hardcoded server address upon start

That's what Lodestar does as well, e.g. for Holesky it will download the genesis state from github. There is an option to initialize the state from execution layer (eth1) but this seems to be a pre-merge approach and not used with networks merged on genesis.

Lodestar will load the state based the following criteria

  • from db if it exists and state is within weak subjectivity period
  • otherwise download the state from checkpointSyncUrl if set (or checkpointState file)
  • or if not set then download from genesisFileUrl defined in network settings or use --genesisStateFile provided by user

The genesisFileUrl is defined for all networks and will just download the genesis state, whereas checkpointSyncUrl will be used to get the last finalized state which means the client does not have to sync the chain from genesis.

I am not sure if there is a huge difference for Ephemery as I'd assume the network syncs quite fast but for Holesky it definitely takes a few hours already to sync from genesis which means a user has to explicitly set a checkpointSyncUrl.

We could think about adding a checkpointSyncUrl to network settings (only for testnets) to make it easier for users to join the network. For Holesky, there have been issues with downloading the state from GitHub, might be better to use checkpoint sync providers for that anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-discussion Indicates a topic that requires input from various developers. meta-feature-request Issues to track feature requests.
Projects
None yet
Development

No branches or pull requests

3 participants