beacon/engine, eth/catalyst, miner: honor targetGasLimit from payload attributes#35353
Open
qu0b wants to merge 1 commit into
Open
beacon/engine, eth/catalyst, miner: honor targetGasLimit from payload attributes#35353qu0b wants to merge 1 commit into
qu0b wants to merge 1 commit into
Conversation
… attributes PayloadAttributesV4 carries a required targetGasLimit field (execution-apis#796) through which the consensus layer supplies the desired gas limit with each payload request. The field was previously dropped during JSON decoding, so locally built payloads always steered the gas limit towards the miner's configured gas ceiling (default 60M) regardless of the CL-registered value. On glamsterdam-devnet-7 this made every geth proposal step the block gas limit down by the maximum parent/1024 step while the other ELs honored the 300M target registered on the CL side. - decode targetGasLimit in PayloadAttributes - reject forkchoiceUpdatedV4 attributes without it, like slotNumber - thread it through BuildPayloadArgs (and the payload id) into the worker, where it takes precedence over miner.config.GasCeil; internal callers that leave it unset (simulated beacon, testing payloads) keep the gas-ceiling behavior Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
On glamsterdam-devnet-7 the block gas limit is now driven by the consensus layer:
PayloadAttributesV4carries a requiredtargetGasLimitfield (execution-apis#796) that the CL supplies with everyengine_forkchoiceUpdatedV4, replacing the static EL-side flag for local building.geth's
PayloadAttributesstruct has no such field, so the JSON key is silently dropped and payload building falls back to the local miner gas ceiling (default 60M). In a 12-node devnet-7 network (geth/ethrex/nethermind × lighthouse/teku/lodestar/prysm) with genesis at 150M, the CLs registering 300M, and no EL gas-limit flags, all 58 geth proposals over 166 Gloas blocks stepped the gas limit down by the maximum parent/1024, under all four CLs alike, while every ethrex and nethermind proposal stepped up toward the target. geth proposers permanently fight the CL-configured gas limit.Fix
targetGasLimitinPayloadAttributes(hex-quantity, mirroringslotNumber)forkchoiceUpdatedV4attributes without it (the spec lists it as required), likeslotNumberBuildPayloadArgs— included in the payload id, with a tag byte so an args set with onlyslotNumcannot collide with one with onlytargetGasLimit(both encode as 8 big-endian bytes) — into the worker, where it takes precedence overminer.config.GasCeilinCalcGasLimitTesting
TestPayloadAttributesJSON: decodes CL-shaped fcuV4 attributes JSON + round tripTestBuildPayloadTargetGasLimit: built payload steers up toward a target above parent, down toward one below, and falls back toGasCeilwhen unsetTestForkchoiceUpdatedV4TargetGasLimit: missing field →Invalid payload attributes(-38003); present → proceeds to the fork checkTestPayloadId: id distinctness for slotNum/targetGasLimit combinationsminer,beacon/engine,eth/catalystsuites passDevnet validation
Kurtosis network of 4× geth (this branch) under lighthouse, teku, lodestar and prysm; minimal preset, genesis
gasLimit150M, every CL configured to register 300M (--gas-limit/--validators-builder-registration-default-gas-limit/--defaultGasLimit/--suggested-gas-limit), no EL-side gas-limit flags:Without the fix (stock
glamsterdam-devnet-7image), the same setup produces 58/58 maximum down-steps on geth proposals.🤖 Generated with Claude Code