Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exclude_crates=(
reth-cli
reth-cli-commands
reth-cli-runner
reth-cli-util
reth-consensus-debug-client
reth-db-common
reth-discv4
Expand Down
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bin/reth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ pub mod chainspec {
pub use reth_ethereum_cli::chainspec::*;
}

/// Re-exported from `reth_ethereum_cli`
pub use reth_ethereum_cli::parsers::EthereumCliParsers;

/// Re-exported from `reth_provider`.
pub mod providers {
pub use reth_provider::*;
Expand Down
5 changes: 2 additions & 3 deletions bin/reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();

use clap::Parser;
use reth::{args::RessArgs, cli::Cli, ress::install_ress_subprotocol};
use reth_ethereum_cli::chainspec::EthereumChainSpecParser;
use reth::{args::RessArgs, cli::Cli, ress::install_ress_subprotocol, EthereumCliParsers};
use reth_node_builder::NodeHandle;
use reth_node_ethereum::EthereumNode;
use tracing::info;
Expand All @@ -19,7 +18,7 @@ fn main() {
}

if let Err(err) =
Cli::<EthereumChainSpecParser, RessArgs>::parse().run(async move |builder, ress_args| {
Cli::<EthereumCliParsers, RessArgs>::parse().run(async move |builder, ress_args| {
info!(target: "reth::cli", "Launching node");
let NodeHandle { node, node_exit_future } =
builder.node(EthereumNode::default()).launch_with_debug_capabilities().await?;
Expand Down
2 changes: 2 additions & 0 deletions crates/cli/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ workspace = true
[dependencies]
# reth
reth-fs-util.workspace = true
reth-cli.workspace = true
reth-rpc-server-types.workspace = true

# eth
alloy-primitives.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub use load_secret_key::get_secret_key;
pub mod parsers;
pub use parsers::{
hash_or_num_value_parser, parse_duration_from_secs, parse_duration_from_secs_or_ms,
parse_ether_value, parse_socket_address,
parse_ether_value, parse_socket_address, RethCliParsers,
};

#[cfg(all(unix, any(target_env = "gnu", target_os = "macos")))]
Expand Down
12 changes: 12 additions & 0 deletions crates/cli/util/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ use std::{
time::Duration,
};

/// Trait for configuring CLI parsers across reth.
///
/// This trait provides configurable parsers for various CLI components,
/// allowing customization of validation behavior.
pub trait RethCliParsers: Clone + Send + Sync + 'static {
/// The chain specification parser type.
type ChainSpecParser: reth_cli::chainspec::ChainSpecParser + std::fmt::Debug;

/// The RPC module validator type.
type RpcModuleValidator: reth_rpc_server_types::RpcModuleValidator;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we follow the same convention as ChainSpecParser here and move the parse_rpc_modules in the trait?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

makes sense, moved

}

/// Helper to parse a [Duration] from seconds
pub fn parse_duration_from_secs(arg: &str) -> eyre::Result<Duration, std::num::ParseIntError> {
let seconds = arg.parse()?;
Expand Down
8 changes: 7 additions & 1 deletion crates/ethereum/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ workspace = true
reth-cli.workspace = true
reth-cli-commands.workspace = true
reth-cli-runner.workspace = true
reth-cli-util.workspace = true
reth-chainspec.workspace = true
reth-db.workspace = true
reth-node-builder.workspace = true
reth-node-core.workspace = true
reth-node-ethereum.workspace = true
reth-node-metrics.workspace = true
reth-rpc-server-types.workspace = true
reth-tracing.workspace = true
reth-node-api.workspace = true

Expand All @@ -44,13 +46,17 @@ asm-keccak = [
]

jemalloc = [
"reth-cli-util/jemalloc",
"reth-node-core/jemalloc",
"reth-node-metrics/jemalloc",
]
jemalloc-prof = [
"reth-cli-util/jemalloc-prof",
"reth-node-core/jemalloc",
]
tracy-allocator = []
tracy-allocator = [
"reth-cli-util/tracy-allocator",
]

# Because jemalloc is default and preferred over snmalloc when both features are
# enabled, `--no-default-features` should be used when enabling snmalloc or
Expand Down
Loading