feat(engine/ssz): add target_gas_limit to PayloadAttributesV4 wire#11647
Merged
benaadams merged 1 commit intoMay 18, 2026
Conversation
Plumbs the new TargetGasLimit field added in this PR through the SSZ-REST wire schema for engine_forkchoiceUpdatedV4 (PR NethermindEth#764). Without this, CLs that include target_gas_limit in the SSZ body get rejected as "Malformed SSZ body" because the 8 extra trailing bytes shift the inner withdrawals offset. The wire field is a required fixed-size uint64 (per execution-apis ssz-encoding.md), so a missing value fails SSZ decode directly — the V4 null-guard in PayloadAttributes.GetInvalidPayloadAttributesMessage remains as defense-in-depth for the JSON path. Changes: - PayloadAttributesWire gains target_gas_limit at the end of the container (matches execution-apis ssz-encoding.md PayloadAttributesV4). - SszCodec.PayloadAttributesFromWire forwards the wire ulong as long to PayloadAttributes.TargetGasLimit. - DecodeFcuV4Request roundtrip test now also asserts target_gas_limit survives encode/decode, using a diverse-byte value (0x0123456789ABCDEF).
benaadams
approved these changes
May 18, 2026
Member
|
Thank you for your contribution |
8a82ef5
into
NethermindEth:feat/engine-payload-attrs-target-gas-limit
512 of 513 checks passed
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.
Summary
Stacked on top of #11611. Plumbs the new `TargetGasLimit` field through the SSZ-REST wire schema for `engine_forkchoiceUpdatedV4` (introduced in #11611 for JSON-RPC).
Why
Without the SSZ wire counterpart, CLs that send `targetGasLimit` over the SSZ-REST transport (`POST /engine/v4/forkchoice`, advertised under execution-apis PR #764) get rejected as Malformed SSZ body — the 8 extra trailing bytes shift the inner `withdrawals` offset inside `PayloadAttributesV4`.
Spec alignment:
Fail-loud guarantee
The wire `target_gas_limit` is a required fixed-size `uint64` (per ssz-encoding.md), so a missing value fails SSZ decode directly — the V4 null-guard in `PayloadAttributes.GetInvalidPayloadAttributesMessage` (`Producers/PayloadAttributes.cs:232`) remains as defense-in-depth for the JSON path. No default-value fallback anywhere.
Sister PRs
Test plan