fix: reject out-of-range builder_index in execution payload bid gossip validation - #9624
Merged
nflaig merged 1 commit intoJul 9, 2026
Conversation
…p validation `validateExecutionPayloadBid` looked up the builder via `state.getBuilder(bid.builderIndex)` inside a try/catch meant to convert an out-of-range index into a `GossipReject`. But `getBuilder` returns a lazy SSZ `getReadonly` view that is not bounds-checked eagerly, so an out-of-range `builder_index` does not throw there -- it throws `LeafNode has no right node` later, on deferred field access inside `isActiveBuilder`, escaping the try/catch. The result is an uncaught error instead of a clean `GossipReject`. Add an explicit `bid.builder_index < len(state.builders)` bounds check up front (spec step `[REJECT] bid.builder_index is a valid/active builder index`) and drop the now-ineffective try/catch. 🤖 Generated with AI assistance
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds an explicit bounds check for bid.builderIndex against state.getBuildersLength() during execution payload bid validation. This prevents deferred errors from escaping when accessing lazy SSZ views returned by state.getBuilder. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
nflaig
approved these changes
Jul 9, 2026
nflaig
enabled auto-merge (squash)
July 9, 2026 08:59
Member
|
🎉 This PR is included in v1.45.0 🎉 |
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.
Problem
validateExecutionPayloadBid(Gloas execution payload bid gossip validation) does not implement the spec's[REJECT] bid.builder_index < len(state.builders)bounds check. It looks up the builder inside atry/catchmeant to turn an out-of-range index into aGossipReject:But
state.getBuilder(i)returns a lazy SSZ view (builders.getReadonly(i)) that is not bounds-checked eagerly. An out-of-rangebuilder_indextherefore does not throw atgetBuilder— it throwsLeafNode has no right nodelater, on deferred field access insideisActiveBuilder(builder.depositEpoch), which is outside thetry/catch. The net effect is an uncaught error on the gossip validation path instead of a cleanREJECT.Fix
Add an explicit
bid.builder_index < len(state.builders)bounds check up front using the existingstate.getBuildersLength(), and drop the now-ineffectivetry/catch.Testing
Found by running the consensus-specs #5294 Gloas networking reference tests (spec
v1.7.0-alpha.12). Thegossip_execution_payload_bid__reject_builder_index_out_of_rangecase now returnsREJECT(previously an uncaught throw), with no regression across the rest of thegossip_execution_payload_bidsuite (minimal + mainnet presets).🤖 Generated with AI assistance