fix: scan all proto array nodes when counting payload reveals#9676
Open
nflaig wants to merge 1 commit into
Open
fix: scan all proto array nodes when counting payload reveals#9676nflaig wants to merge 1 commit into
nflaig wants to merge 1 commit into
Conversation
This comment was marked as spam.
This comment was marked as spam.
Contributor
Performance Report✔️ no performance regression detected Full benchmark results
|
twoeths
approved these changes
Jul 20, 2026
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.
Motivation
getPayloadRevealCounts(used by the builder circuit breaker) iterated the proto array backward and stopped at the first out-of-window block node, assuming nodes are ordered by slot. Nodes are in import order, not slot order, an older block can be imported after newer ones (a late block on a competing branch, or ancestors imported while resolving a heavier fork), so itsPENDINGnode lands at the end of the array. The backward scan then breaks on that trailing out-of-window node and misses the in-window nodes inserted earlier, undercounting blocks present and faults.The truncated counts can wrongly activate or deactivate the circuit breaker, which fails open (fewer faults observed) exactly during the instability where out-of-order imports are common, leading to the wrong bid source being selected.
Pointed out by codex in #9674 (comment)
Description
breakwith a full scan that skips out-of-window nodes, matching the pre-gloasgetSlotsPresent