chore(node-core): add stage id to eta overflow log (#6991)

This commit is contained in:
Roman Krasiuk
2024-03-06 10:34:13 +01:00
committed by GitHub
parent da0c7e535a
commit 56376b9bdc

View File

@@ -117,7 +117,7 @@ impl<DB> NodeState<DB> {
if let Some(current_stage) = self.current_stage.as_mut() {
current_stage.checkpoint = checkpoint;
current_stage.eta.update(checkpoint);
current_stage.eta.update(stage_id, checkpoint);
let target = OptionalField(current_stage.target);
let stage_progress = OptionalField(
@@ -479,7 +479,7 @@ struct Eta {
impl Eta {
/// Update the ETA given the checkpoint, if possible.
fn update(&mut self, checkpoint: StageCheckpoint) {
fn update(&mut self, stage: StageId, checkpoint: StageCheckpoint) {
let Some(current) = checkpoint.entities() else { return };
if let Some(last_checkpoint_time) = &self.last_checkpoint_time {
@@ -487,7 +487,7 @@ impl Eta {
current.processed.checked_sub(self.last_checkpoint.processed)
else {
self.eta = None;
debug!(target: "reth::cli", ?current, ?self.last_checkpoint, "Failed to calculate the ETA: processed entities is less than the last checkpoint");
debug!(target: "reth::cli", %stage, ?current, ?self.last_checkpoint, "Failed to calculate the ETA: processed entities is less than the last checkpoint");
return
};
let elapsed = last_checkpoint_time.elapsed();
@@ -495,7 +495,7 @@ impl Eta {
let Some(remaining) = current.total.checked_sub(current.processed) else {
self.eta = None;
debug!(target: "reth::cli", ?current, "Failed to calculate the ETA: total entities is less than processed entities");
debug!(target: "reth::cli", %stage, ?current, "Failed to calculate the ETA: total entities is less than processed entities");
return
};