Skip to content

feat(engine/ssz): add target_gas_limit to PayloadAttributesV4 wire#11646

Merged
benaadams merged 1 commit into
NethermindEth:glamsterdam-devnet-4from
barnabasbusa:bbusa/ssz-payload-attrs-v4-target-gas-limit
May 18, 2026
Merged

feat(engine/ssz): add target_gas_limit to PayloadAttributesV4 wire#11646
benaadams merged 1 commit into
NethermindEth:glamsterdam-devnet-4from
barnabasbusa:bbusa/ssz-payload-attrs-v4-target-gas-limit

Conversation

@barnabasbusa

Copy link
Copy Markdown

Summary

  • Adds target_gas_limit: uint64 to the SSZ PayloadAttributesWire (V4) and plumbs it through SszCodec.PayloadAttributesFromWire into the existing PayloadAttributes.TargetGasLimit domain field.
  • Extends the DecodeFcuV4Request round-trip test to assert the new field survives encode/decode.

Context

JSON-RPC support for targetGasLimit landed in 4e226fd (feat(engine): support targetGasLimit in PayloadAttributesV4). The SSZ wire schema lagged behind, so CLs that include the alpha-8 targetGasLimit over the SSZ-REST transport (POST /engine/v4/forkchoice) get rejected as Malformed SSZ body — the 8 trailing bytes shift the inner withdrawals offset inside PayloadAttributesV4.

execution-apis PR #796 added targetGasLimit to the JSON spec (commit a22fbd4). The matching SSZ-encoding spec change was just submitted in ethereum/execution-apis#764 (commit 949d6a8 on the bbusa/ssz branch). This PR aligns Nethermind's SSZ decoder with that schema so it accepts the field on the wire.

Hit in practice

Consensoor on Gloas devnet hits this every fcU at slot transition:

Engine API error 400: Malformed SSZ body
  at forkchoice_updated_v4 -> POST /engine/v4/forkchoice

After this fix the EL decodes PayloadAttributesV4 with 7 fields (target_gas_limit last) and forwards the value to PayloadAttributes.TargetGasLimit.

Test plan

  • DecodeFcuV4Request_spec_layout_roundtrips_parent_beacon_block_root_and_slot_number now also asserts target_gas_limit round-trips
  • CI green
  • Manual: consensoor ↔ nethermind on glamsterdam devnet — fcU v4 over SSZ no longer rejected

Aligns the SSZ wire schema for engine_forkchoiceUpdatedV4 with the
target_gas_limit field added to PayloadAttributesV4 in execution-apis
PR NethermindEth#796. 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.

JSON-RPC support for TargetGasLimit landed in 4e226fd ("feat(engine):
support targetGasLimit in PayloadAttributesV4"); this plumbs the same
value through the SSZ-REST decoder.

Changes:
- PayloadAttributesWire gains target_gas_limit: uint64 at the end of
  the container (matches execution-apis ssz-encoding.md).
- SszCodec.PayloadAttributesFromWire forwards the wire ulong as long
  to PayloadAttributes.TargetGasLimit.
- DecodeFcuV4Request roundtrip test now also asserts target_gas_limit
  survives encode/decode.
@benaadams benaadams merged commit c367954 into NethermindEth:glamsterdam-devnet-4 May 18, 2026
509 of 510 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants