Skip to content

Commit 2a60a86

Browse files
committed
feat: add log for checkpoint index as well
1 parent fbc34c0 commit 2a60a86

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

rust/main/agents/validator/src/submit.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,14 @@ impl ValidatorSubmitterMetrics {
503503
}
504504

505505
fn set_latest_checkpoint_observed(&self, checkpoint: &CheckpointAtBlock) {
506+
let prev_checkpoint_index = self.latest_checkpoint_observed.get();
507+
508+
if prev_checkpoint_index > checkpoint.index as i64 {
509+
tracing::warn!(
510+
?checkpoint,
511+
prev_checkpoint_index,
512+
checkpoint_index=checkpoint.index, "Observed a checkpoint with index that is lower than previous checkpoint. Did a reorg occur?");
513+
}
506514
self.latest_checkpoint_observed.set(checkpoint.index as i64);
507515

508516
if let Some(block_height) = checkpoint.block_height {
@@ -512,7 +520,7 @@ impl ValidatorSubmitterMetrics {
512520
tracing::warn!(
513521
?checkpoint,
514522
prev_block_height,
515-
block_height, "Observed a checkpoint with block height that is lower previous checkpoint. Did a reorg occur?");
523+
block_height, "Observed a checkpoint with block height that is lower than previous checkpoint. Did a reorg occur?");
516524
}
517525
self.latest_checkpoint_observed_block_height
518526
.set(block_height);

0 commit comments

Comments
 (0)