execution,cl: add TargetGasLimit to PayloadAttributesV4#21297
Open
taratorio wants to merge 2 commits into
Open
execution,cl: add TargetGasLimit to PayloadAttributesV4#21297taratorio wants to merge 2 commits into
taratorio wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
TargetGasLimitfrom Engine API payload attributes intobuilder.Parametersand 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
targetGasLimitoverrides 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, |
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.
for ethereum/execution-apis#796 in
glamsterdam-devnet-4