Avoid duplicate metric events in FCR - #11198
Open
zilm13 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Was in backlog for FCR, see #10994
Fixing it according to the spec
Fixed Issue(s)
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Low Risk
Observability-only changes to fast confirmation counters and reorg classification; core confirmation logic is unchanged aside from not double-counting metrics.
Overview
Fast confirmation reorgs, fallbacks, and restarts counters now increment once per episode instead of on every slot where the condition holds. Episode state uses
lastConfirmationOutcome(fallback vs restart vs advanced, with restart keyed by observed justified root) and a separatepreviousSlotWasReorgflag so chain switches and outcome types can be counted independently.Warm-up after init/reinit no longer counts as a fallback when
confirmed_rootstays on finality. Slots that skip or abandon confirmation leave episode state unchanged. Reorg detection treats roots missing from fork choice (e.g. pruned previous confirmed root) as not a reorg. Metric help text documents episode semantics; tests cover consecutive slots, advancing finalization, checkpoint rotation, abandoned slots, and Fulu/Gloas.Reviewed by Cursor Bugbot for commit 0958ee2. Bugbot is set up for automated code reviews on this repo. Configure here.