[r3.5] cl/phase1/forkchoice: don't maintain GLOAS indexed weight store pre-GLOAS#21699
Merged
Conversation
…LOAS The indexedWeightStore (new in the GLOAS merge) was instantiated unconditionally and its IndexVote/RemoveVote were called per validator index on every attestation via setLatestMessage, regardless of fork. Its results are only consumed by GLOAS get_head; pre-GLOAS get_head uses the non-indexed weightStore, so this was pure overhead — a top CPU hotspot (RemoveVote) plus heavy allocation/GC, all under the fork-choice write lock. On high-validator-count networks this stalls block import and head updates past the attestation deadline, causing stale head votes. Gate the index maintenance on the GLOAS vote path only.
yperbasis
approved these changes
Jun 9, 2026
domiwei
approved these changes
Jun 9, 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.
Cherry-pick of #21698 to release/3.5.
Fixes the Caplin pre-GLOAS attestation head-vote regression: the GLOAS
indexedWeightStorewas maintained on every vote regardless of fork (top CPU hotspot + GC pressure under the fork-choice lock) but never read pre-GLOAS, delaying head updates past the attestation deadline. Validated on a live Hoodi node (node CPU ~7.5%-><2%, head-vote misses 40%->0%).Clean cherry-pick;
on_attestation.gois identical betweenmainandrelease/3.5.