diff --git a/book/cli/reth/node.md b/book/cli/reth/node.md index b73b1319b..465948c68 100644 --- a/book/cli/reth/node.md +++ b/book/cli/reth/node.md @@ -545,6 +545,7 @@ Debug: Example: `witness,prestate` + [default: witness] [possible values: witness, pre-state, opcode] --debug.healthy-node-rpc-url diff --git a/crates/node/core/src/args/debug.rs b/crates/node/core/src/args/debug.rs index 5ed882c92..83c5c268d 100644 --- a/crates/node/core/src/args/debug.rs +++ b/crates/node/core/src/args/debug.rs @@ -9,7 +9,7 @@ use std::{collections::HashSet, ffi::OsStr, fmt, path::PathBuf, str::FromStr}; use strum::{AsRefStr, EnumIter, IntoStaticStr, ParseError, VariantArray, VariantNames}; /// Parameters for debugging purposes -#[derive(Debug, Clone, Args, PartialEq, Eq, Default)] +#[derive(Debug, Clone, Args, PartialEq, Eq)] #[command(next_help_heading = "Debug")] pub struct DebugArgs { /// Flag indicating whether the node should be terminated after the pipeline sync. @@ -71,7 +71,12 @@ pub struct DebugArgs { /// Determines which type of invalid block hook to install /// /// Example: `witness,prestate` - #[arg(long = "debug.invalid-block-hook", help_heading = "Debug", value_parser = InvalidBlockSelectionValueParser::default())] + #[arg( + long = "debug.invalid-block-hook", + help_heading = "Debug", + value_parser = InvalidBlockSelectionValueParser::default(), + default_value = "witness" + )] pub invalid_block_hook: Option, /// The RPC URL of a healthy node to use for comparing invalid block hook results against. @@ -84,6 +89,25 @@ pub struct DebugArgs { pub healthy_node_rpc_url: Option, } +impl Default for DebugArgs { + fn default() -> Self { + Self { + terminate: false, + tip: None, + max_block: None, + etherscan: None, + rpc_consensus_ws: None, + skip_fcu: None, + skip_new_payload: None, + reorg_frequency: None, + reorg_depth: None, + engine_api_store: None, + invalid_block_hook: Some(InvalidBlockSelection::default()), + healthy_node_rpc_url: None, + } + } +} + /// Describes the invalid block hooks that should be installed. /// /// # Example @@ -97,6 +121,12 @@ pub struct DebugArgs { #[derive(Debug, Clone, PartialEq, Eq, derive_more::Deref)] pub struct InvalidBlockSelection(HashSet); +impl Default for InvalidBlockSelection { + fn default() -> Self { + Self([InvalidBlockHookType::Witness].into()) + } +} + impl InvalidBlockSelection { /// Creates a new _unique_ [`InvalidBlockSelection`] from the given items. ///