Skip to content

Commit

Permalink
fix(cli): block node command from exiting (paradigmxyz#1540)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Feb 24, 2023
1 parent dc57fba commit a0c82c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ jobs:
cargo run --profile ${{ matrix.profile }} \
--bin reth -- node \
--debug.tip 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 \
--debug.max-block 100000
--debug.max-block 100000 \
--debug.terminate
15 changes: 13 additions & 2 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ pub struct Command {
#[arg(long = "debug.max-block", help_heading = "Debug")]
max_block: Option<u64>,

/// Flag indicating whether the node should be terminated after the pipeline sync.
#[arg(long = "debug.terminate", help_heading = "Debug")]
terminate: bool,

#[clap(flatten)]
rpc: RpcServerArgs,
}
Expand Down Expand Up @@ -196,8 +200,15 @@ impl Command {

tx.await??;

info!(target: "reth::cli", "Finishing up");
Ok(())
info!(target: "reth::cli", "Pipeline has finished.");

if self.terminate {
Ok(())
} else {
// The pipeline has finished downloading blocks up to `--debug.tip` or
// `--debug.max-block`. Keep other node components alive for further usage.
futures::future::pending().await
}
}

async fn build_networked_pipeline(
Expand Down

0 comments on commit a0c82c5

Please sign in to comment.