Validate bid gas limit against the payload at bid.parent_block_hash - #8941
Open
barnabasbusa wants to merge 1 commit into
Open
Validate bid gas limit against the payload at bid.parent_block_hash#8941barnabasbusa wants to merge 1 commit into
barnabasbusa wants to merge 1 commit into
Conversation
validateExecutionPayloadBid derived parent_gas_limit from the head state's latest_execution_payload_bid, i.e. the head block's own bid. The spec keys parent_gas_limit on bid.parent_block_hash: a bid that builds on the parent's parent payload (parent payload withheld) must be checked against that payload's gas limit, which differs from the parent bid's gas limit whenever the gas limit is moving. Such bids were dropped with "gas limit not target-compatible", on gossip and via the publish REST endpoint. Resolve the block carrying the payload identified by bid.parent_block_hash (the parent block for Timely, its execution parent for Withheld) and use that block's committed gas limit.
ahshum
reviewed
Aug 25, 2026
| of PayloadAvailability.Timely: | ||
| parentBlck | ||
| of PayloadAvailability.Withheld: | ||
| dag.loadExecutionParent(parentBlck).valueOr: |
Contributor
There was a problem hiding this comment.
We already have
nimbus-eth2/beacon_chain/consensus_object_pools/blockchain_dag.nim
Lines 2574 to 2576 in 7acd211
that loads hashes and searches for the execution parent.
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.
What
validateExecutionPayloadBidderivedparent_gas_limitfromdag.headState.latest_execution_payload_bid.gas_limit— the head block's own bid — regardless of which payload the bid builds on. The spec keys the check on the payload the bid actually extends:(https://github.com/ethereum/consensus-specs/blob/a670e0193446474bb1775ec94a93ca6fbaa11a89/specs/gloas/p2p-interface.md#L995-L1000)
A bid with
parent_block_root = headandparent_block_hash = head_bid.parent_block_hash(head payload treated as withheld — permitted byis_bid_compatible_with_headwhenshould_build_on_fullis false) must be checked against the grandparent payload's gas limit. Whenever the gas limit is moving, that differs from the head bid's gas limit by one EIP-1559 step, so a spec-correct bid was dropped withgas limit not target-compatible— on gossip and viaPOST /eth/v1/beacon/execution_payload_bids(same path).This PR resolves the block carrying the payload identified by
bid.parent_block_hashusing thePayloadAvailabilityalready computed for the pool key (Timely→ parent block,Withheld→ its execution parent via a newloadExecutionParent), and uses that block's committed gas limit (loadExecutionGasLimit: the bid'sgas_limitpost-Gloas, the payload's pre-Gloas). Envelopes must match their bid'sgas_limit, so the bid value is the payload value.Why
Seen on glamsterdam-devnet-8 (gas limit ramping under EIP-8261). Slot 85165: payload at 85163 had gas limit 199411976, payload at 85164 (head) had 199606713, target 200000000. A builder's parent-empty bid carried 199606713 = 199411976 + 199411976/1024 − 1, correct for the payload it builds on; comparing against the head bid (199606713) instead makes it look like it failed to step toward the target.
Same class of bug was found in prysm (fixed in OffchainLabs/prysm#17405), lighthouse (sigp/lighthouse#9905) and grandine; lodestar and teku are correct. The spec gossip test vectors don't cover empty-head bids yet (all cases use the head's own payload as
parent_block_hash), a vector PR is in progress.Notes
loadExecutionParentwalks ancestors loading execution hashes on demand (bounded byEXECUTION_PARENT_MAX_DEPTH), unlikeexecutionParentwhich only inspects already-loaded hashes.nimbus_beacon_nodelocally; there is no existing unit-test harness forvalidateExecutionPayloadBid, happy to add one if you can point me at the preferred fixture.