reth
reth copied to clipboard
Add `EthChainSpec::name` method
Describe the feature
Right now when resolving datadir, we will only include chain name in the directory for chains that are added to alloy-chains enum, if it's not present, just chain id will be included
https://github.com/paradigmxyz/reth/blob/7997cd42832f4be41e0a20e5796f8dc194b7b137/crates/node/core/src/dirs.rs#L165-L169 https://github.com/paradigmxyz/reth/blob/7997cd42832f4be41e0a20e5796f8dc194b7b137/crates/node/core/src/dirs.rs#L12-L16
To support custom/ephemeral chains to customize this we can add something like this to the EthChainSpec trait
fn name(&self) -> String {
self.chain().to_string()
}
And propagate it all the way to platform_path_from_chain from all callsites
We would want to change resolve_datadir to take impl ChainSpec and make use of the name method
https://github.com/paradigmxyz/reth/blob/7997cd42832f4be41e0a20e5796f8dc194b7b137/crates/node/core/src/args/datadir_args.rs#L33-L37
Additional context
No response