@aztec/validator-client 5.0.0-private.20260318 → 5.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/metrics.ts CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  createUpDownCounterWithDefault,
12
12
  } from '@aztec/telemetry-client';
13
13
 
14
- import type { BlockProposalValidationFailureReason } from './block_proposal_handler.js';
14
+ import type { BlockProposalValidationFailureReason } from './proposal_handler.js';
15
15
 
16
16
  export class ValidatorMetrics {
17
17
  private failedReexecutionCounter: UpDownCounter;
@@ -24,6 +24,8 @@ export class ValidatorMetrics {
24
24
  private reexMana: Histogram;
25
25
  private reexTx: Histogram;
26
26
  private reexDuration: Gauge;
27
+ private checkpointProposalToPipelinedStateDuration: Histogram;
28
+ private checkpointProposalReceiveOffsetFromNextSlotBoundary: Histogram;
27
29
 
28
30
  constructor(telemetryClient: TelemetryClient) {
29
31
  const meter = telemetryClient.getMeter('Validator');
@@ -77,6 +79,12 @@ export class ValidatorMetrics {
77
79
  this.reexTx = meter.createHistogram(Metrics.VALIDATOR_RE_EXECUTION_TX_COUNT);
78
80
 
79
81
  this.reexDuration = meter.createGauge(Metrics.VALIDATOR_RE_EXECUTION_TIME);
82
+ this.checkpointProposalToPipelinedStateDuration = meter.createHistogram(
83
+ Metrics.VALIDATOR_CHECKPOINT_PROPOSAL_TO_PIPELINED_STATE_DURATION,
84
+ );
85
+ this.checkpointProposalReceiveOffsetFromNextSlotBoundary = meter.createHistogram(
86
+ Metrics.VALIDATOR_CHECKPOINT_PROPOSAL_RECEIVE_OFFSET_FROM_NEXT_SLOT_BOUNDARY,
87
+ );
80
88
  }
81
89
 
82
90
  public recordReex(time: number, txs: number, mManaTotal: number) {
@@ -85,6 +93,16 @@ export class ValidatorMetrics {
85
93
  this.reexMana.record(mManaTotal);
86
94
  }
87
95
 
96
+ public recordCheckpointProposalToPipelinedStateDuration(durationMs: number) {
97
+ this.checkpointProposalToPipelinedStateDuration.record(Math.ceil(durationMs));
98
+ }
99
+
100
+ public recordCheckpointProposalReceiveOffsetFromNextSlotBoundary(offsetMs: number) {
101
+ this.checkpointProposalReceiveOffsetFromNextSlotBoundary.record(Math.ceil(Math.abs(offsetMs)), {
102
+ [Attributes.SLOT_BOUNDARY_SIDE]: offsetMs < 0 ? 'before' : 'after',
103
+ });
104
+ }
105
+
88
106
  public recordFailedReexecution(proposal: BlockProposal) {
89
107
  const proposer = proposal.getSender();
90
108
  this.failedReexecutionCounter.add(1, {