reth
reth copied to clipboard
feat(chains): add support for custom/ephemeral chains
trafficstars
Title
Add spec-aware datadir naming via EthChainSpec::name()
Summary
This PR introduces spec-aware datadir naming to support custom and ephemeral chains while preserving existing behavior for built-in chains.
- Adds
EthChainSpec::name()with a default ofchain().to_string()for human-friendly, stable directory naming. - Updates
resolve_datadirand related helpers to useEthChainSpecinstead of plainChain. - Introduces
resolve_datadir_for_chainfor compatibility with existing chain-only call sites. - Propagates spec-based naming across key modules and tests.
Why
Allows custom or ephemeral networks not in alloy-chains to define meaningful datadir folder names instead of numeric chain IDs, improving clarity and usability.
Behavior
- Built-in chains remain unchanged.
- Custom chains can override
name()for stable folder naming.
Linked Issue
Closes #19635