diff --git a/bin/reth/src/node/mod.rs b/bin/reth/src/node/mod.rs index 6e7f820030..8e96eb71a1 100644 --- a/bin/reth/src/node/mod.rs +++ b/bin/reth/src/node/mod.rs @@ -83,7 +83,7 @@ pub struct Command { /// Runs the sync only up to the specified block #[arg(long = "debug.max-block", help_heading = "Debug")] - max_block: u64, + max_block: Option, } impl Command { @@ -203,8 +203,13 @@ impl Command { let body_downloader = self.spawn_bodies_downloader(config, consensus, &fetch_client, db); let stage_conf = &config.stages; - let pipeline = Pipeline::builder() - .with_max_block(self.max_block) + let mut builder = Pipeline::builder(); + + if let Some(max_block) = self.max_block { + builder = builder.with_max_block(max_block) + } + + let pipeline = builder .with_sync_state_updater(network.clone()) .add_stages( OnlineStages::new(consensus.clone(), header_downloader, body_downloader).set(