paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.85k stars 1.1k forks source link

cleanup chainspec value parsers #11397

Open mattsse opened 3 days ago

mattsse commented 3 days ago

atm the chainspec parsers are still in the utils crate

https://github.com/paradigmxyz/reth/blob/9c9b1fdf849992f0fa277e5135be3cbf8feb0139/crates/node/core/src/args/utils.rs#L27-L42

but they are no longer used in this crate. They should be moved to where the chainspec parsers are defined (chainspec crates).

we also need to rename:

https://github.com/paradigmxyz/reth/blob/9c9b1fdf849992f0fa277e5135be3cbf8feb0139/crates/node/core/src/args/utils.rs#L76-L76

to EthereumChainSpecParser

garwahl commented 2 days ago

Yeah I can do this

garwahl commented 2 days ago

Hey @mattsse it appears these parsing functions already exist in their corresponding crates crates/ethereum/../chainspec.rs https://github.com/paradigmxyz/reth/blob/6cb26f72afa478ae72c0988383b62a924ebed521/crates/ethereum/cli/src/chainspec.rs#L10-L12

crates/optimism/../chainspec.rs https://github.com/paradigmxyz/reth/blob/2aa3dd0fd8b02b067eb39631bc30de47c434f0f0/crates/optimism/cli/src/chainspec.rs#L12-L14

Wondering how the value parsers inutils.rs are used and if we want this duplication/ can they be removed?

mattsse commented 2 days ago

I think these are duplicated and we can remove if possible