cl/pool: size operation pools by retention need - #22823
Merged
Merged
Conversation
NewOperationsPool ignored its BeaconChainConfig and gave all five pools the same 512, which NewOperationPool silently multiplied by 20, so no number in the file was the capacity you got. The pools are gossip retention windows drained only by eviction, so name each capacity, state what it has to hold, and derive the attestation window from the network config. Mainnet and Gnosis capacities are unchanged. The attestation window is a latency trade against the BLS merge loop in block production, so changing it needs a measurement, not a constant swap. Fixes #22790
AskAlexSharov
approved these changes
Jul 29, 2026
AskAlexSharov
enabled auto-merge
July 29, 2026 03:56
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.
NewOperationsPooltakes a*clparams.BeaconChainConfigand ignores it. All five pools get the sameoperationsPerPool = 512, whichNewOperationPoolthen silently multiplies byoperationsMultiplier = 20, so every pool is really 10240 entries and no number in the file is the capacity you actually get.The pools are gossip retention windows, not per-block buffers:
NotifyBlocknever removes attestations, so the LRU cap alone decides how far back a proposer can pack.Changes
NewOperationPooltakescapacityand passes it straight to the LRU.operationsMultiplieris gone, so the number at the call site is the capacity.attestationRetentionSlots(10) * MaxCommitteesPerSlot * TargetAggregatorsPerCommittee.Mainnet and Gnosis capacities are unchanged. The only behaviour changes are voluntary exits 10240 -> 16384, and the minimal preset, where the attestation pool is now sized to its own committee count (640) instead of inheriting the mainnet number.
The attestation window is deliberately not widened. A deeper window gives the proposer more partial aggregates to merge, but
electraMergedAttestationCandidatesis linear in pool occupancy and quadratic within one data root, with abls.AggregateSignaturesper merge (block_production.go:2178), on the proposal critical path — and the constant being replaced came from #10020, a latency PR. Changing that number is a latency trade that needs a measurement, not an argument.Fixes #22790