fix: Improve checkpoint diagnostics
Improve metrics and logging when the checkpoint verifier is waiting for more blocks.
This commit is contained in:
parent
3ed967bcf8
commit
7931766c84
|
|
@ -267,6 +267,13 @@ impl CheckpointVerifier {
|
||||||
if height == block::Height(pending_height.0 + 1) {
|
if height == block::Height(pending_height.0 + 1) {
|
||||||
pending_height = height;
|
pending_height = height;
|
||||||
} else {
|
} else {
|
||||||
|
let gap = height.0 - pending_height.0;
|
||||||
|
// Try to log a useful message when checkpointing has issues
|
||||||
|
tracing::trace!(contiguous_height = ?pending_height,
|
||||||
|
next_height = ?height,
|
||||||
|
?gap,
|
||||||
|
"Waiting for more checkpoint blocks");
|
||||||
|
metrics::gauge!("checkpoint.contiguous.height", pending_height.0 as i64);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -331,7 +338,10 @@ impl CheckpointVerifier {
|
||||||
InitialTip(previous_height) | PreviousCheckpoint(previous_height)
|
InitialTip(previous_height) | PreviousCheckpoint(previous_height)
|
||||||
if (height <= previous_height) =>
|
if (height <= previous_height) =>
|
||||||
{
|
{
|
||||||
Err(format!("Block has already been verified. {:?}", height))?
|
Err(format!(
|
||||||
|
"Block height has already been verified. {:?}",
|
||||||
|
height
|
||||||
|
))?
|
||||||
}
|
}
|
||||||
InitialTip(_) | PreviousCheckpoint(_) => {}
|
InitialTip(_) | PreviousCheckpoint(_) => {}
|
||||||
// We're finished, so no checkpoint height is valid
|
// We're finished, so no checkpoint height is valid
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue