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

[Feature]: Add Opstack superchain registry support for genesis files #14260

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

18aaddy
Copy link
Contributor

@18aaddy 18aaddy commented Feb 6, 2025

Resolves #14240

@mattsse mattsse added A-cli Related to the reth CLI A-op-reth Related to Optimism and op-reth labels Feb 6, 2025
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great

next step is to configure a directory manager that is responsible for writing and reading the files from disk because we don't want to do this everytime the program launches

this can be a simple struct that wraps some path that represents the directory, where we

  1. store the dictionary
  2. the genesis files

features we need are:
read genesis by name, if missing download
update dictionary + genesis files

layout should be similar to the registry repository
grouped by sepolia,mainnet

path can be something like this

/// Returns the path to the reth data directory.
///
/// Refer to [`dirs_next::data_dir`] for cross-platform behavior.
pub fn data_dir() -> Option<PathBuf> {
dirs_next::data_dir().map(|root| root.join("reth"))
}

like op-reth-registry for example

Comment on lines +12 to +17
reqwest = { version = "0.12.12", features = ["stream"] }
tokio = { version = "1.0", features = ["full"] }
serde_json = "1.0"
zstd = "0.12"
anyhow = "1.0"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should use workspace

Comment on lines +50 to +51
let file_url = "https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/main/superchain/extra/genesis/mainnet/arena-z.json.zst";
let dict_url = "https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/main/superchain/extra/dictionary";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should convert the base paths into constants

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, these functions just need some docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI A-op-reth Related to Optimism and op-reth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opstack superchain registry support for genesis files
2 participants