Skip to content

Commit

Permalink
chore: improve stage checkpoint logs (#2823)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored May 25, 2023
1 parent d05ba97 commit d6ccab1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 21 additions & 5 deletions bin/reth/src/node/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,34 @@ impl NodeState {
self.current_checkpoint = checkpoint.unwrap_or_default();

if notable {
info!(target: "reth::cli", stage = %stage_id, from = ?checkpoint, "Executing stage");
info!(
target: "reth::cli",
stage = %stage_id,
from = self.current_checkpoint.block_number,
checkpoint = %self.current_checkpoint,
"Executing stage",
);
}
}
PipelineEvent::Ran { stage_id, result: ExecOutput { checkpoint, done } } => {
let notable = checkpoint.block_number > self.current_checkpoint.block_number;
self.current_checkpoint = checkpoint;

if done {
self.current_stage = None;
info!(target: "reth::cli", stage = %stage_id, checkpoint = %checkpoint, "Stage finished executing");
} else if notable {
info!(target: "reth::cli", stage = %stage_id, checkpoint = %checkpoint, "Stage committed progress");
}

info!(
target: "reth::cli",
stage = %stage_id,
progress = checkpoint.block_number,
%checkpoint,
"{}",
if done {
"Stage finished executing"
} else {
"Stage committed progress"
}
);
}
_ => (),
}
Expand Down
1 change: 1 addition & 0 deletions crates/stages/src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ where
info!(
target: "sync::pipeline",
stage = %stage_id,
progress = checkpoint.block_number,
%checkpoint,
%done,
"Stage made progress"
Expand Down

0 comments on commit d6ccab1

Please sign in to comment.