mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(bin, pipeline): report pipeline progress (#2932)
This commit is contained in:
@ -37,7 +37,7 @@ impl NodeState {
|
||||
/// Processes an event emitted by the pipeline
|
||||
fn handle_pipeline_event(&mut self, event: PipelineEvent) {
|
||||
match event {
|
||||
PipelineEvent::Running { stage_id, checkpoint } => {
|
||||
PipelineEvent::Running { pipeline_position, pipeline_total, stage_id, checkpoint } => {
|
||||
let notable = self.current_stage.is_none();
|
||||
self.current_stage = Some(stage_id);
|
||||
self.current_checkpoint = checkpoint.unwrap_or_default();
|
||||
@ -45,6 +45,7 @@ impl NodeState {
|
||||
if notable {
|
||||
info!(
|
||||
target: "reth::cli",
|
||||
pipeline_stages = %format!("{pipeline_position}/{pipeline_total}"),
|
||||
stage = %stage_id,
|
||||
from = self.current_checkpoint.block_number,
|
||||
checkpoint = %self.current_checkpoint,
|
||||
@ -52,7 +53,12 @@ impl NodeState {
|
||||
);
|
||||
}
|
||||
}
|
||||
PipelineEvent::Ran { stage_id, result: ExecOutput { checkpoint, done } } => {
|
||||
PipelineEvent::Ran {
|
||||
pipeline_position,
|
||||
pipeline_total,
|
||||
stage_id,
|
||||
result: ExecOutput { checkpoint, done },
|
||||
} => {
|
||||
self.current_checkpoint = checkpoint;
|
||||
|
||||
if done {
|
||||
@ -61,6 +67,7 @@ impl NodeState {
|
||||
|
||||
info!(
|
||||
target: "reth::cli",
|
||||
pipeline_stages = %format!("{pipeline_position}/{pipeline_total}"),
|
||||
stage = %stage_id,
|
||||
progress = checkpoint.block_number,
|
||||
%checkpoint,
|
||||
|
||||
Reference in New Issue
Block a user