Skip to content

execution,cl: add TargetGasLimit to PayloadAttributesV4#21297

Open
taratorio wants to merge 2 commits into
mainfrom
worktree-payload-attr-v4-target-gas-lim
Open

execution,cl: add TargetGasLimit to PayloadAttributesV4#21297
taratorio wants to merge 2 commits into
mainfrom
worktree-payload-attr-v4-target-gas-lim

Conversation

@taratorio
Copy link
Copy Markdown
Member

@taratorio taratorio commented May 20, 2026

for ethereum/execution-apis#796 in glamsterdam-devnet-4

Copy link
Copy Markdown
Member

@domiwei domiwei left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the Amsterdam/Gloas PayloadAttributesV4.targetGasLimit field (per execution-apis/pull/796) and wires it through Erigon’s Engine API + block builder so a CL-provided gas target can override the EL’s static --miner.gaslimit when building blocks.

Changes:

  • Plumbs TargetGasLimit from Engine API payload attributes into builder.Parameters and uses it during header construction.
  • Extends SSZ + JSON-RPC payload attributes schemas to carry targetGasLimit, and updates test/mock CL paths to populate it.
  • Adds an Engine API test ensuring CL targetGasLimit overrides the EL configured gas limit for block building.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
execution/execmodule/chainreader/chain_reader.go Passes TargetGasLimit into builder.Parameters for assembling blocks.
execution/engineapi/testing_api.go Propagates TargetGasLimit into builder params in the testing API path.
execution/engineapi/sszrest_test.go Extends SSZ REST forkchoice test to include TargetGasLimit.
execution/engineapi/engineapitester/mock_cl.go Mock CL now supplies TargetGasLimit for Amsterdam builds.
execution/engineapi/engine_types/ssz.go SSZ encode/decode updated to include TargetGasLimit for Gloas attrs.
execution/engineapi/engine_types/jsonrpc.go Adds targetGasLimit field to JSON-RPC PayloadAttributes.
execution/engineapi/engine_server.go For FCU builds, passes TargetGasLimit into builder params; TODO’d validation for requirement.
execution/engineapi/engine_api_builder_test.go New test proving CL targetGasLimit overrides EL --miner.gaslimit.
execution/builder/parameters.go Adds TargetGasLimit to builder parameters struct.
execution/builder/create_block.go Uses CL TargetGasLimit (when present) as the gas target instead of static config.
cl/phase1/stages/forkchoice.go CL event emission now includes TargetGasLimit for Gloas+.
cl/beacon/handler/block_production.go CL block production path sets TargetGasLimit for Gloas+.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 231 to +235
if version >= clparams.GloasVersion && payloadAttributes.SlotNumber == nil {
return &engine_helpers.InvalidPayloadAttributesErr // SlotNumber required for Glamsterdam (EIP-7843)
}
// TODO: enable once tests catch up with glamsterdam-devnet-4 spec
// if version >= clparams.GloasVersion && payloadAttributes.TargetGasLimit == nil {
Comment on lines 251 to 255
attrs := &engine_types.PayloadAttributes{
Timestamp: 1,
SuggestedFeeRecipient: common.HexToAddress("0x1234"),
Withdrawals: nil,
SlotNumber: &slotNumber,
@yperbasis yperbasis added the Glamsterdam https://eips.ethereum.org/EIPS/eip-7773 label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Glamsterdam https://eips.ethereum.org/EIPS/eip-7773

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants