From e7ebac187855042232212e28b811a731aa81bdef Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:50:13 +0100 Subject: [PATCH 1/3] chore: #[clap] -> #[command], #[arg] warning: use of deprecated function `::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]` --> bin/reth/src/commands/db/get.rs:27:7 | 27 | #[clap(long)] | ^^^^ | = note: `#[warn(deprecated)]` on by default --- bin/reth/src/cli/mod.rs | 4 ++-- bin/reth/src/commands/db/diff.rs | 2 +- bin/reth/src/commands/db/get.rs | 4 ++-- bin/reth/src/commands/db/mod.rs | 4 ++-- .../src/commands/debug_cmd/build_block.rs | 2 +- bin/reth/src/commands/debug_cmd/execution.rs | 4 ++-- .../commands/debug_cmd/in_memory_merkle.rs | 4 ++-- bin/reth/src/commands/debug_cmd/merkle.rs | 4 ++-- bin/reth/src/commands/debug_cmd/mod.rs | 2 +- .../src/commands/debug_cmd/replay_engine.rs | 4 ++-- bin/reth/src/commands/import.rs | 2 +- bin/reth/src/commands/init_cmd.rs | 2 +- bin/reth/src/commands/node/mod.rs | 21 +++++++++---------- bin/reth/src/commands/p2p/mod.rs | 4 ++-- bin/reth/src/commands/recover/mod.rs | 2 +- bin/reth/src/commands/stage/drop.rs | 2 +- bin/reth/src/commands/stage/dump/mod.rs | 4 ++-- bin/reth/src/commands/stage/mod.rs | 2 +- bin/reth/src/commands/stage/run.rs | 6 +++--- bin/reth/src/commands/stage/unwind.rs | 8 +++---- bin/reth/src/commands/test_vectors/mod.rs | 2 +- crates/node-core/src/args/database_args.rs | 4 ++-- crates/node-core/src/args/debug_args.rs | 4 ++-- crates/node-core/src/args/dev_args.rs | 4 ++-- .../src/args/gas_price_oracle_args.rs | 4 ++-- crates/node-core/src/args/log_args.rs | 6 +++--- crates/node-core/src/args/network_args.rs | 4 ++-- .../src/args/payload_builder_args.rs | 4 ++-- crates/node-core/src/args/pruning_args.rs | 4 ++-- crates/node-core/src/args/rollup_args.rs | 4 ++-- crates/node-core/src/args/rpc_server_args.rs | 8 +++---- .../src/args/rpc_state_cache_args.rs | 2 +- crates/node-core/src/args/txpool_args.rs | 4 ++-- crates/node-core/src/cli/ext.rs | 2 +- .../src/main.rs | 2 +- 35 files changed, 72 insertions(+), 73 deletions(-) diff --git a/bin/reth/src/cli/mod.rs b/bin/reth/src/cli/mod.rs index 8c33e36e7f89..6883901fac44 100644 --- a/bin/reth/src/cli/mod.rs +++ b/bin/reth/src/cli/mod.rs @@ -32,7 +32,7 @@ pub use crate::core::cli::*; #[command(author, version = SHORT_VERSION, long_version = LONG_VERSION, about = "Reth", long_about = None)] pub struct Cli { /// The command to run - #[clap(subcommand)] + #[command(subcommand)] command: Commands, /// The chain this node is running. @@ -64,7 +64,7 @@ pub struct Cli { #[arg(long, value_name = "INSTANCE", global = true, default_value_t = 1, value_parser = value_parser!(u16).range(..=200))] instance: u16, - #[clap(flatten)] + #[command(flatten)] logs: LogArgs, } diff --git a/bin/reth/src/commands/db/diff.rs b/bin/reth/src/commands/db/diff.rs index 313db210884c..8b17a23e7817 100644 --- a/bin/reth/src/commands/db/diff.rs +++ b/bin/reth/src/commands/db/diff.rs @@ -30,7 +30,7 @@ pub struct Command { secondary_datadir: PlatformPath, /// Arguments for the second database - #[clap(flatten)] + #[command(flatten)] second_db: DatabaseArgs, /// The table name to diff. If not specified, all tables are diffed. diff --git a/bin/reth/src/commands/db/get.rs b/bin/reth/src/commands/db/get.rs index dc64c08e31da..6644d9b2270a 100644 --- a/bin/reth/src/commands/db/get.rs +++ b/bin/reth/src/commands/db/get.rs @@ -24,7 +24,7 @@ pub struct Command { pub subkey: Option, /// Output bytes instead of human-readable decoded value - #[clap(long)] + #[arg(long)] pub raw: bool, } @@ -121,7 +121,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/bin/reth/src/commands/db/mod.rs b/bin/reth/src/commands/db/mod.rs index e6f199cd7a6e..c7c2abf18663 100644 --- a/bin/reth/src/commands/db/mod.rs +++ b/bin/reth/src/commands/db/mod.rs @@ -60,10 +60,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/debug_cmd/build_block.rs b/bin/reth/src/commands/debug_cmd/build_block.rs index beb01873368e..a19756d1ad17 100644 --- a/bin/reth/src/commands/debug_cmd/build_block.rs +++ b/bin/reth/src/commands/debug_cmd/build_block.rs @@ -81,7 +81,7 @@ pub struct Command { chain: Arc, /// Database arguments. - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// Overrides the KZG trusted setup by reading from the supplied file. diff --git a/bin/reth/src/commands/debug_cmd/execution.rs b/bin/reth/src/commands/debug_cmd/execution.rs index 542a50b5e675..e55598a53cd3 100644 --- a/bin/reth/src/commands/debug_cmd/execution.rs +++ b/bin/reth/src/commands/debug_cmd/execution.rs @@ -68,10 +68,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// The maximum block height. diff --git a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs index fffda86b42c9..6f3cd0148149 100644 --- a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs +++ b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs @@ -61,10 +61,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, /// The number of retries per request diff --git a/bin/reth/src/commands/debug_cmd/merkle.rs b/bin/reth/src/commands/debug_cmd/merkle.rs index dbc4879938e6..0dabd7fdaf4e 100644 --- a/bin/reth/src/commands/debug_cmd/merkle.rs +++ b/bin/reth/src/commands/debug_cmd/merkle.rs @@ -67,10 +67,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, /// The number of retries per request diff --git a/bin/reth/src/commands/debug_cmd/mod.rs b/bin/reth/src/commands/debug_cmd/mod.rs index 36834da51da6..1bafbdbe7ab0 100644 --- a/bin/reth/src/commands/debug_cmd/mod.rs +++ b/bin/reth/src/commands/debug_cmd/mod.rs @@ -13,7 +13,7 @@ mod replay_engine; /// `reth debug` command #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/debug_cmd/replay_engine.rs b/bin/reth/src/commands/debug_cmd/replay_engine.rs index a18b9a9568a4..63884c624e0d 100644 --- a/bin/reth/src/commands/debug_cmd/replay_engine.rs +++ b/bin/reth/src/commands/debug_cmd/replay_engine.rs @@ -67,10 +67,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, /// The path to read engine API messages from. diff --git a/bin/reth/src/commands/import.rs b/bin/reth/src/commands/import.rs index ff0cf6080c42..6551b163b0c5 100644 --- a/bin/reth/src/commands/import.rs +++ b/bin/reth/src/commands/import.rs @@ -60,7 +60,7 @@ pub struct ImportCommand { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// The path to a block file for import. diff --git a/bin/reth/src/commands/init_cmd.rs b/bin/reth/src/commands/init_cmd.rs index 9ea949e6b479..1a56610a8252 100644 --- a/bin/reth/src/commands/init_cmd.rs +++ b/bin/reth/src/commands/init_cmd.rs @@ -39,7 +39,7 @@ pub struct InitCommand { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, } diff --git a/bin/reth/src/commands/node/mod.rs b/bin/reth/src/commands/node/mod.rs index b76902acb2d3..bf8ac313876f 100644 --- a/bin/reth/src/commands/node/mod.rs +++ b/bin/reth/src/commands/node/mod.rs @@ -85,45 +85,44 @@ pub struct NodeCommand { pub trusted_setup_file: Option, /// All networking related arguments - #[clap(flatten)] + #[command(flatten)] pub network: NetworkArgs, /// All rpc related arguments - #[clap(flatten)] + #[command(flatten)] pub rpc: RpcServerArgs, /// All txpool related arguments with --txpool prefix - #[clap(flatten)] + #[command(flatten)] pub txpool: TxPoolArgs, /// All payload builder related arguments - #[clap(flatten)] + #[command(flatten)] pub builder: PayloadBuilderArgs, /// All debug related arguments with --debug prefix - #[clap(flatten)] + #[command(flatten)] pub debug: DebugArgs, /// All database related arguments - #[clap(flatten)] + #[command(flatten)] pub db: DatabaseArgs, /// All dev related arguments with --dev prefix - #[clap(flatten)] + #[command(flatten)] pub dev: DevArgs, /// All pruning related arguments - #[clap(flatten)] + #[command(flatten)] pub pruning: PruningArgs, /// Rollup related arguments #[cfg(feature = "optimism")] - #[clap(flatten)] + #[command(flatten)] pub rollup: crate::args::RollupArgs, /// Additional cli arguments - #[clap(flatten)] - #[clap(next_help_heading = "Extension")] + #[command(flatten, next_help_heading = "Extension")] pub ext: Ext::Node, } diff --git a/bin/reth/src/commands/p2p/mod.rs b/bin/reth/src/commands/p2p/mod.rs index f307b0dcd0dd..4796b117bc53 100644 --- a/bin/reth/src/commands/p2p/mod.rs +++ b/bin/reth/src/commands/p2p/mod.rs @@ -73,10 +73,10 @@ pub struct Command { #[arg(long, default_value = "any")] nat: NatResolver, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/recover/mod.rs b/bin/reth/src/commands/recover/mod.rs index 044438f247f4..b1f778feac87 100644 --- a/bin/reth/src/commands/recover/mod.rs +++ b/bin/reth/src/commands/recover/mod.rs @@ -8,7 +8,7 @@ mod storage_tries; /// `reth recover` command #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/stage/drop.rs b/bin/reth/src/commands/stage/drop.rs index 3187932c2a08..405d1d19c3c3 100644 --- a/bin/reth/src/commands/stage/drop.rs +++ b/bin/reth/src/commands/stage/drop.rs @@ -42,7 +42,7 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, stage: StageEnum, diff --git a/bin/reth/src/commands/stage/dump/mod.rs b/bin/reth/src/commands/stage/dump/mod.rs index 2a34e67ee621..dbad94da7e87 100644 --- a/bin/reth/src/commands/stage/dump/mod.rs +++ b/bin/reth/src/commands/stage/dump/mod.rs @@ -56,10 +56,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Stages, } diff --git a/bin/reth/src/commands/stage/mod.rs b/bin/reth/src/commands/stage/mod.rs index a3e2fa19ebbf..fa9bda84295e 100644 --- a/bin/reth/src/commands/stage/mod.rs +++ b/bin/reth/src/commands/stage/mod.rs @@ -10,7 +10,7 @@ pub mod unwind; /// `reth stage` command #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/stage/run.rs b/bin/reth/src/commands/stage/run.rs index 5e2a6552bf54..1cc8bbcdd57f 100644 --- a/bin/reth/src/commands/stage/run.rs +++ b/bin/reth/src/commands/stage/run.rs @@ -63,7 +63,7 @@ pub struct Command { /// Enable Prometheus metrics. /// /// The metrics will be served at the given interface and port. - #[clap(long, value_name = "SOCKET")] + #[arg(long, value_name = "SOCKET")] metrics: Option, /// The name of the stage to run @@ -90,10 +90,10 @@ pub struct Command { #[arg(long, short)] skip_unwind: bool, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// Commits the changes in the database. WARNING: potentially destructive. diff --git a/bin/reth/src/commands/stage/unwind.rs b/bin/reth/src/commands/stage/unwind.rs index a5b568e4f8a9..28c18bb5d12f 100644 --- a/bin/reth/src/commands/stage/unwind.rs +++ b/bin/reth/src/commands/stage/unwind.rs @@ -42,10 +42,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } @@ -87,10 +87,10 @@ impl Command { #[derive(Subcommand, Debug, Eq, PartialEq)] enum Subcommands { /// Unwinds the database until the given block number (range is inclusive). - #[clap(name = "to-block")] + #[command(name = "to-block")] ToBlock { target: BlockHashOrNumber }, /// Unwinds the given number of blocks from the database. - #[clap(name = "num-blocks")] + #[command(name = "num-blocks")] NumBlocks { amount: u64 }, } diff --git a/bin/reth/src/commands/test_vectors/mod.rs b/bin/reth/src/commands/test_vectors/mod.rs index 7315b6006150..999c0bc91320 100644 --- a/bin/reth/src/commands/test_vectors/mod.rs +++ b/bin/reth/src/commands/test_vectors/mod.rs @@ -7,7 +7,7 @@ mod tables; /// Generate test-vectors for different data types. #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/crates/node-core/src/args/database_args.rs b/crates/node-core/src/args/database_args.rs index edaa26bbfaec..10f4d6b1e26c 100644 --- a/crates/node-core/src/args/database_args.rs +++ b/crates/node-core/src/args/database_args.rs @@ -5,7 +5,7 @@ use reth_interfaces::db::LogLevel; /// Parameters for database configuration #[derive(Debug, Args, PartialEq, Default, Clone, Copy)] -#[clap(next_help_heading = "Database")] +#[command(next_help_heading = "Database")] pub struct DatabaseArgs { /// Database logging level. Levels higher than "notice" require a debug build. #[arg(long = "db.log-level", value_enum)] @@ -20,7 +20,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/debug_args.rs b/crates/node-core/src/args/debug_args.rs index 104c8b2730b2..59b068e5cdcf 100644 --- a/crates/node-core/src/args/debug_args.rs +++ b/crates/node-core/src/args/debug_args.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; /// Parameters for debugging purposes #[derive(Debug, Clone, Args, PartialEq, Default)] -#[clap(next_help_heading = "Debug")] +#[command(next_help_heading = "Debug")] pub struct DebugArgs { /// Prompt the downloader to download blocks one at a time. /// @@ -74,7 +74,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/dev_args.rs b/crates/node-core/src/args/dev_args.rs index 929b3fd10c6f..baea7b7147ca 100644 --- a/crates/node-core/src/args/dev_args.rs +++ b/crates/node-core/src/args/dev_args.rs @@ -7,7 +7,7 @@ use humantime::parse_duration; /// Parameters for Dev testnet configuration #[derive(Debug, Args, PartialEq, Default, Clone, Copy)] -#[clap(next_help_heading = "Dev testnet")] +#[command(next_help_heading = "Dev testnet")] pub struct DevArgs { /// Start the node in dev mode /// @@ -49,7 +49,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/gas_price_oracle_args.rs b/crates/node-core/src/args/gas_price_oracle_args.rs index 54087693af7a..63b5e4b7649b 100644 --- a/crates/node-core/src/args/gas_price_oracle_args.rs +++ b/crates/node-core/src/args/gas_price_oracle_args.rs @@ -8,7 +8,7 @@ use reth_rpc_builder::constants::{ /// Parameters to configure Gas Price Oracle #[derive(Debug, Clone, Copy, Args, PartialEq, Eq)] -#[clap(next_help_heading = "Gas Price Oracle")] +#[command(next_help_heading = "Gas Price Oracle")] pub struct GasPriceOracleArgs { /// Number of recent blocks to check for gas price #[arg(long = "gpo.blocks", default_value_t = DEFAULT_GAS_PRICE_BLOCKS)] @@ -59,7 +59,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/log_args.rs b/crates/node-core/src/args/log_args.rs index 49435bded080..e5475e2697a8 100644 --- a/crates/node-core/src/args/log_args.rs +++ b/crates/node-core/src/args/log_args.rs @@ -67,7 +67,7 @@ pub struct LogArgs { )] pub color: ColorMode, /// The verbosity settings for the tracer. - #[clap(flatten)] + #[command(flatten)] pub verbosity: Verbosity, } @@ -145,11 +145,11 @@ pub struct Verbosity { /// -vvv Info /// -vvvv Debug /// -vvvvv Traces (warning: very verbose!) - #[clap(short, long, action = ArgAction::Count, global = true, default_value_t = 3, verbatim_doc_comment, help_heading = "Display")] + #[arg(short, long, action = ArgAction::Count, global = true, default_value_t = 3, verbatim_doc_comment, help_heading = "Display")] verbosity: u8, /// Silence all log output. - #[clap(long, alias = "silent", short = 'q', global = true, help_heading = "Display")] + #[arg(long, alias = "silent", short = 'q', global = true, help_heading = "Display")] quiet: bool, } diff --git a/crates/node-core/src/args/network_args.rs b/crates/node-core/src/args/network_args.rs index 75119f0ae8d3..7514c8937bda 100644 --- a/crates/node-core/src/args/network_args.rs +++ b/crates/node-core/src/args/network_args.rs @@ -19,7 +19,7 @@ use std::{net::Ipv4Addr, path::PathBuf, sync::Arc}; /// Parameters for configuring the network more granularity via CLI #[derive(Debug, Clone, Args, PartialEq, Eq)] -#[clap(next_help_heading = "Networking")] +#[command(next_help_heading = "Networking")] pub struct NetworkArgs { /// Disable the discovery service. #[command(flatten)] @@ -262,7 +262,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/payload_builder_args.rs b/crates/node-core/src/args/payload_builder_args.rs index b47fd2838e55..44250ffd5e86 100644 --- a/crates/node-core/src/args/payload_builder_args.rs +++ b/crates/node-core/src/args/payload_builder_args.rs @@ -13,7 +13,7 @@ use std::{borrow::Cow, ffi::OsStr, time::Duration}; /// Parameters for configuring the Payload Builder #[derive(Debug, Clone, Args, PartialEq)] -#[clap(next_help_heading = "Builder")] +#[command(next_help_heading = "Builder")] pub struct PayloadBuilderArgs { /// Block extra data set by the payload builder. #[arg(long = "builder.extradata", value_parser = ExtradataValueParser::default(), default_value_t = default_extradata())] @@ -124,7 +124,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/pruning_args.rs b/crates/node-core/src/args/pruning_args.rs index 86808e3ba18f..b89cca570512 100644 --- a/crates/node-core/src/args/pruning_args.rs +++ b/crates/node-core/src/args/pruning_args.rs @@ -9,7 +9,7 @@ use std::sync::Arc; /// Parameters for pruning and full node #[derive(Debug, Clone, Args, PartialEq, Default)] -#[clap(next_help_heading = "Pruning")] +#[command(next_help_heading = "Pruning")] pub struct PruningArgs { /// Run full node. Only the most recent [`MINIMUM_PRUNING_DISTANCE`] block states are stored. /// This flag takes priority over pruning configuration in reth.toml. @@ -56,7 +56,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/rollup_args.rs b/crates/node-core/src/args/rollup_args.rs index 1ffaae0516b6..76fb3865ac2c 100644 --- a/crates/node-core/src/args/rollup_args.rs +++ b/crates/node-core/src/args/rollup_args.rs @@ -2,7 +2,7 @@ /// Parameters for rollup configuration #[derive(Debug, Clone, Default, PartialEq, Eq, clap::Args)] -#[clap(next_help_heading = "Rollup")] +#[arg(next_help_heading = "Rollup")] pub struct RollupArgs { /// HTTP endpoint for the sequencer mempool #[arg(long = "rollup.sequencer-http", value_name = "HTTP_URL")] @@ -26,7 +26,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/rpc_server_args.rs b/crates/node-core/src/args/rpc_server_args.rs index fe2a27df9cec..a2715028dc4a 100644 --- a/crates/node-core/src/args/rpc_server_args.rs +++ b/crates/node-core/src/args/rpc_server_args.rs @@ -61,7 +61,7 @@ pub(crate) const RPC_DEFAULT_MAX_CONNECTIONS: u32 = 500; /// Parameters for configuring the rpc more granularity via CLI #[derive(Debug, Clone, Args, PartialEq, Eq)] -#[clap(next_help_heading = "RPC")] +#[command(next_help_heading = "RPC")] pub struct RpcServerArgs { /// Enable the HTTP-RPC server #[arg(long, default_value_if("dev", "true", "true"))] @@ -175,11 +175,11 @@ pub struct RpcServerArgs { pub rpc_gas_cap: u64, /// State cache configuration. - #[clap(flatten)] + #[command(flatten)] pub rpc_state_cache: RpcStateCacheArgs, /// Gas price oracle configuration. - #[clap(flatten)] + #[command(flatten)] pub gas_price_oracle: GasPriceOracleArgs, } @@ -631,7 +631,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/rpc_state_cache_args.rs b/crates/node-core/src/args/rpc_state_cache_args.rs index df909dbbd4bd..bb152e66c753 100644 --- a/crates/node-core/src/args/rpc_state_cache_args.rs +++ b/crates/node-core/src/args/rpc_state_cache_args.rs @@ -6,7 +6,7 @@ use reth_rpc::eth::cache::{ /// Parameters to configure RPC state cache. #[derive(Debug, Clone, Args, PartialEq, Eq)] -#[clap(next_help_heading = "RPC State Cache")] +#[command(next_help_heading = "RPC State Cache")] pub struct RpcStateCacheArgs { /// Max number of blocks in cache. diff --git a/crates/node-core/src/args/txpool_args.rs b/crates/node-core/src/args/txpool_args.rs index 186ddf78a64d..e349f170bbb9 100644 --- a/crates/node-core/src/args/txpool_args.rs +++ b/crates/node-core/src/args/txpool_args.rs @@ -11,7 +11,7 @@ use reth_transaction_pool::{ }; /// Parameters for debugging purposes #[derive(Debug, Clone, Args, PartialEq)] -#[clap(next_help_heading = "TxPool")] +#[command(next_help_heading = "TxPool")] pub struct TxPoolArgs { /// Max number of transaction in the pending sub-pool. #[arg(long = "txpool.pending_max_count", default_value_t = TXPOOL_SUBPOOL_MAX_TXS_DEFAULT)] @@ -128,7 +128,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/cli/ext.rs b/crates/node-core/src/cli/ext.rs index ce2c39f7f1d7..178e7ea87335 100644 --- a/crates/node-core/src/cli/ext.rs +++ b/crates/node-core/src/cli/ext.rs @@ -209,7 +209,7 @@ impl RethCliExt for NoArgsCliExt { /// the reth node command. #[derive(Debug, Clone, Copy, Default, Args)] pub struct NoArgs { - #[clap(skip)] + #[arg(skip)] inner: Option, } diff --git a/examples/additional-rpc-namespace-in-cli/src/main.rs b/examples/additional-rpc-namespace-in-cli/src/main.rs index f7d1b18f6cfd..1221efde51d9 100644 --- a/examples/additional-rpc-namespace-in-cli/src/main.rs +++ b/examples/additional-rpc-namespace-in-cli/src/main.rs @@ -38,7 +38,7 @@ impl RethCliExt for MyRethCliExt { #[derive(Debug, Clone, Copy, Default, clap::Args)] struct RethCliTxpoolExt { /// CLI flag to enable the txpool extension namespace - #[clap(long)] + #[arg(long)] pub enable_ext: bool, } From 103df4c2e6d8e5175e4b09bff184fd6d70f24e2a Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:51:11 +0100 Subject: [PATCH 2/3] chore: #[arg(name)] -> #[arg(id)] warning: use of deprecated function `::augment_args::id_is_only_for_arg`: `#[arg(name)] was allowed by mistake, instead use `#[arg(id)]` or `#[arg(value_name)]` --> crates/node-core/src/args/network_args.rs:218:36 | 218 | #[arg(long = "discovery.port", name = "discovery.port", value_name = "DISCOVERY_PORT", default_value_t = DEFAULT_DISCOVERY_PORT)] | ^^^^ --- crates/node-core/src/args/network_args.rs | 4 ++-- crates/node-core/src/args/rpc_server_args.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/node-core/src/args/network_args.rs b/crates/node-core/src/args/network_args.rs index 7514c8937bda..caa6b580e23c 100644 --- a/crates/node-core/src/args/network_args.rs +++ b/crates/node-core/src/args/network_args.rs @@ -211,11 +211,11 @@ pub struct DiscoveryArgs { pub disable_discv4_discovery: bool, /// The UDP address to use for P2P discovery/networking - #[arg(long = "discovery.addr", name = "discovery.addr", value_name = "DISCOVERY_ADDR", default_value_t = DEFAULT_DISCOVERY_ADDR)] + #[arg(id = "discovery.addr", long = "discovery.addr", value_name = "DISCOVERY_ADDR", default_value_t = DEFAULT_DISCOVERY_ADDR)] pub addr: Ipv4Addr, /// The UDP port to use for P2P discovery/networking - #[arg(long = "discovery.port", name = "discovery.port", value_name = "DISCOVERY_PORT", default_value_t = DEFAULT_DISCOVERY_PORT)] + #[arg(id = "discovery.port", long = "discovery.port", value_name = "DISCOVERY_PORT", default_value_t = DEFAULT_DISCOVERY_PORT)] pub port: u16, } diff --git a/crates/node-core/src/args/rpc_server_args.rs b/crates/node-core/src/args/rpc_server_args.rs index a2715028dc4a..4547a7068469 100644 --- a/crates/node-core/src/args/rpc_server_args.rs +++ b/crates/node-core/src/args/rpc_server_args.rs @@ -96,7 +96,7 @@ pub struct RpcServerArgs { pub ws_port: u16, /// Origins from which to accept WebSocket requests - #[arg(long = "ws.origins", name = "ws.origins")] + #[arg(id = "ws.origins", long = "ws.origins")] pub ws_allowed_origins: Option, /// Rpc Modules to be configured for the WS server From 552dfd530c506303a4a6b58bc59d1037fe63403c Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Thu, 29 Feb 2024 13:11:54 +0000 Subject: [PATCH 3/3] arg -> command for rollupargs --- crates/node-core/src/args/rollup_args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/node-core/src/args/rollup_args.rs b/crates/node-core/src/args/rollup_args.rs index 76fb3865ac2c..d56b4caaee24 100644 --- a/crates/node-core/src/args/rollup_args.rs +++ b/crates/node-core/src/args/rollup_args.rs @@ -2,7 +2,7 @@ /// Parameters for rollup configuration #[derive(Debug, Clone, Default, PartialEq, Eq, clap::Args)] -#[arg(next_help_heading = "Rollup")] +#[command(next_help_heading = "Rollup")] pub struct RollupArgs { /// HTTP endpoint for the sequencer mempool #[arg(long = "rollup.sequencer-http", value_name = "HTTP_URL")]