Skip to content

cl/pool: size operation pools by retention need - #22823

Merged
AskAlexSharov merged 3 commits into
mainfrom
awskii/cl-pool-capacity
Jul 29, 2026
Merged

cl/pool: size operation pools by retention need#22823
AskAlexSharov merged 3 commits into
mainfrom
awskii/cl-pool-capacity

Conversation

@awskii

@awskii awskii commented Jul 28, 2026

Copy link
Copy Markdown
Member

NewOperationsPool takes a *clparams.BeaconChainConfig and ignores it. All five pools get the same operationsPerPool = 512, which NewOperationPool then silently multiplies by operationsMultiplier = 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: NotifyBlock never removes attestations, so the LRU cap alone decides how far back a proposer can pack.

Changes

  • NewOperationPool takes capacity and passes it straight to the LRU. operationsMultiplier is gone, so the number at the call site is the capacity.
  • Each pool gets a named capacity and the reason it holds what it holds.
  • The attestation window is derived from the config: attestationRetentionSlots(10) * MaxCommitteesPerSlot * TargetAggregatorsPerCommittee.
  • Tests pin each capacity by filling the pool past it.

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 electraMergedAttestationCandidates is linear in pool occupancy and quadratic within one data root, with a bls.AggregateSignatures per 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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@AskAlexSharov
AskAlexSharov enabled auto-merge July 29, 2026 03:56
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 97a52af Jul 29, 2026
106 checks passed
@AskAlexSharov
AskAlexSharov deleted the awskii/cl-pool-capacity branch July 29, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cl/pool: derive OperationsPool capacities from BeaconChainConfig (currently ignored)

3 participants