Skip to content

Optimize onboarding builders at the fork + add BuilderIndexCache - #10729

Merged
StefanBratanov merged 17 commits into
Consensys:masterfrom
StefanBratanov:onboard_builders_fork
May 29, 2026
Merged

Optimize onboarding builders at the fork + add BuilderIndexCache#10729
StefanBratanov merged 17 commits into
Consensys:masterfrom
StefanBratanov:onboard_builders_fork

Conversation

@StefanBratanov

@StefanBratanov StefanBratanov commented May 19, 2026

Copy link
Copy Markdown
Contributor

PR Description

Implements functionality as per ethereum/consensus-specs#5254 The reference tests changed as far as I know so that's why they are failing, will test once we merge other alpha.8 changes

Also added BuilderIndexCache similar to ValidatorIndexCache to optimize builder index retrieval

Small refactor to put back apply_parent_execution_payload to BlockProcessor.

Fixed Issue(s)

N/A

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Note

High Risk
Changes Gloas beacon state transition, deposit classification, fork upgrade onboarding, and fork-choice payload simulation鈥攃onsensus-critical paths tied to an in-flight spec update.

Overview
Aligns Gloas with updated consensus-spec behavior (including MIN_BUILDER_WITHDRAWABILITY_DELAY 8192 on mainnet) and speeds builder-related state work.

Introduces BuilderIndexCache (mirroring ValidatorIndexCache) for pubkey鈫抜ndex lookups with incremental scanning, bounds checks when caches are shared across states, and copied builder caches on TransitionCaches.copy() because builder slots can be reassigned. BeaconStateAccessorsGloas.getBuilderIndex now uses that cache.

Moves apply_parent_execution_payload back into BlockProcessorGloas; ForkChoiceUtilGloas (and Heze wiring) calls the block processor for payload-attribute withdrawals instead of ExecutionRequestsProcessorGloas.

Reworks builder onboarding at the Gloas fork and deposit request classification: single-pass pending-deposit handling with ValidatorsUtil / isPendingValidator on a list (no repeated full-registry/set scans). ExecutionRequestsProcessorGloas deposit routing matches that model.

Reviewed by Cursor Bugbot for commit 2051ac7. Bugbot is set up for automated code reviews on this repo. Configure here.

@zilm13 zilm13 mentioned this pull request May 19, 2026
17 tasks
zilm13
zilm13 previously approved these changes May 20, 2026

@zilm13 zilm13 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.

LGTM

// If there is a valid pending deposit for a new validator with this pubkey, keep this
// deposit in the pending queue to be applied to that validator later.
final boolean isPendingValidator =
verifiedPendingValidatorPubkeys.contains(pubkey)

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.

nit: I'd refactor this logic to spread along more lines but be more readable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

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.

looks good

rolfyone
rolfyone previously approved these changes May 25, 2026
@StefanBratanov
StefanBratanov force-pushed the onboard_builders_fork branch from 90938e4 to 1f154f6 Compare May 27, 2026 13:57
@StefanBratanov StefanBratanov changed the title Optimize onboarding builders at the fork Optimize onboarding builders at the fork + small refactor May 27, 2026
@StefanBratanov StefanBratanov changed the title Optimize onboarding builders at the fork + small refactor Optimize onboarding builders at the fork + add BuilderIndexCache May 28, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 078b4a8. Configure here.

zilm13
zilm13 previously approved these changes May 28, 2026

@zilm13 zilm13 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.

LGTM, just one nit

@zilm13 zilm13 mentioned this pull request May 28, 2026
2 tasks
@StefanBratanov
StefanBratanov enabled auto-merge (squash) May 29, 2026 13:20

@zilm13 zilm13 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.

LGTM

@StefanBratanov
StefanBratanov merged commit a3bdf2d into Consensys:master May 29, 2026
83 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants