Skip to content

Commit

Permalink
fix: sequencer negative histogram recodings (#10490)
Browse files Browse the repository at this point in the history
Fix for these two otel warnings
```
negative value provided to histogram aztec.sequencer.state_transition_buffer.duration:

INT value type cannot accept a floating-point value for aztec.sequencer.state_transition_buffer.duration, ignoring the fractional digits.
```
  • Loading branch information
alexghr authored Dec 9, 2024
1 parent 85c0676 commit 623f3e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yarn-project/sequencer-client/src/sequencer/sequencer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,16 @@ export class Sequencer {
}

const bufferSeconds = this.timeTable[proposedState] - secondsIntoSlot;
this.metrics.recordStateTransitionBufferMs(bufferSeconds * 1000, proposedState);

if (bufferSeconds < 0) {
this.log.warn(
`Too far into slot to transition to ${proposedState}. max allowed: ${this.timeTable[proposedState]}s, time into slot: ${secondsIntoSlot}s`,
);
return false;
}

this.metrics.recordStateTransitionBufferMs(Math.floor(bufferSeconds * 1000), proposedState);

this.log.debug(
`Enough time to transition to ${proposedState}, max allowed: ${this.timeTable[proposedState]}s, time into slot: ${secondsIntoSlot}s`,
);
Expand Down

0 comments on commit 623f3e2

Please sign in to comment.