Skip to content

Commit c763be7

Browse files
spalladinoalexghr
andauthored
fix(archiver): restore pending block height metric under pipelining (#22994)
## Motivation The `aztec.archiver.block_height` series with no status attribute (rendered as the "Pending chain" line on the network, prover, and fisherman Grafana dashboards) stopped being published a couple of weeks ago. With pipelining enabled every checkpoint arriving from L1 already has its blocks in the proposed store, so the L1 synchronizer always took the new promotion fast path introduced in #22716, leaving `checkpointsToAdd` empty and skipping the metric call. ## Approach Record the checkpointed block-height metrics across all valid checkpoints in the batch instead of only the ones routed through `addCheckpoints`, so the promoted checkpoint contributes too. The duration is averaged over the full batch since `addCheckpoints` performs the work for both paths in a single transaction. ## Changes - **archiver (`l1_synchronizer.ts`)**: Move the `processNewCheckpointedBlocks` call to use `validCheckpoints` rather than `checkpointsToAdd`, restoring the empty-status `block_height`, `checkpoint_height`, `sync_block_count`, and `sync_per_checkpoint` series under pipelining. --------- Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
1 parent c4e1914 commit c763be7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

yarn-project/archiver/src/modules/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class ArchiverInstrumentation {
136136
}
137137

138138
this.syncDurationPerCheckpoint.record(Math.ceil(syncTimePerCheckpoint));
139-
this.blockHeight.record(Math.max(...blocks.map(b => b.number)));
139+
this.blockHeight.record(Math.max(...blocks.map(b => b.number)), { [Attributes.STATUS]: 'checkpointed' });
140140
this.checkpointHeight.record(Math.max(...blocks.map(b => b.checkpointNumber)));
141141
this.syncBlockCount.add(blocks.length);
142142
}

yarn-project/archiver/src/modules/l1_synchronizer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,10 @@ export class ArchiverL1Synchronizer implements Traceable {
973973
),
974974
);
975975

976-
if (checkpointsToAdd.length > 0) {
976+
if (validCheckpoints.length > 0) {
977977
this.instrumentation.processNewCheckpointedBlocks(
978-
processDuration / checkpointsToAdd.length,
979-
checkpointsToAdd.flatMap(c => c.checkpoint.blocks),
978+
processDuration / validCheckpoints.length,
979+
validCheckpoints.flatMap(c => c.checkpoint.blocks),
980980
);
981981
}
982982

0 commit comments

Comments
 (0)