fix(cli): make max_block optional (#1176)

This commit is contained in:
Georgios Konstantopoulos
2023-02-04 20:32:45 -08:00
committed by GitHub
parent e46d0401a2
commit ba70b3b7ef

View File

@@ -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<u64>,
}
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(