-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: main
Are you sure you want to change the base?
[Feature]: Add Opstack superchain registry support for genesis files #14260
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.
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
- store the dictionary
- 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
reth/crates/node/core/src/dirs.rs
Lines 17 to 22 in 14a51b5
/// 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
reqwest = { version = "0.12.12", features = ["stream"] } | ||
tokio = { version = "1.0", features = ["full"] } | ||
serde_json = "1.0" | ||
zstd = "0.12" | ||
anyhow = "1.0" | ||
|
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.
this should use workspace
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"; |
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.
we should convert the base paths into constants
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.
cool, these functions just need some docs
Resolves #14240