Commit 6fe58eb2 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix(fd): off by one in metric (#2726)

Fixes a simple off-by-one error in the highestCheckedBatchIndex metric.
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 37dfe4f6
---
'@eth-optimism/fault-detector': patch
---
Fix order in which a metric was bumped then emitted to fix off by one issue
...@@ -168,10 +168,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> { ...@@ -168,10 +168,10 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
} }
} }
this.state.highestCheckedBatchIndex++
this.metrics.highestCheckedBatchIndex.set( this.metrics.highestCheckedBatchIndex.set(
this.state.highestCheckedBatchIndex this.state.highestCheckedBatchIndex
) )
this.state.highestCheckedBatchIndex++
// If we got through the above without throwing an error, we should be fine to reset. // If we got through the above without throwing an error, we should be fine to reset.
this.metrics.isCurrentlyMismatched.set(0) this.metrics.isCurrentlyMismatched.set(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment