Skip to content

fix: add slotNumber and targetGasLimit to testing_buildBlockV1 - #862

Open
O1ahmad wants to merge 2 commits into
ethereum:mainfrom
O1ahmad:fix/testing-build-block-target-gas-limit
Open

O1ahmad wants to merge 2 commits into
ethereum:mainfrom
O1ahmad:fix/testing-build-block-target-gas-limit

Conversation

@O1ahmad

@O1ahmad O1ahmad commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #857

testing_buildBlockV1 described its payload attributes as PayloadAttributesV3, but Amsterdam requires PayloadAttributesV4 with slotNumber and targetGasLimit. As reported in #857, this makes clients disagree — Erigon rejects with -32602 targetGasLimit required for Glamsterdam and later forks.

Changes

  • Retitle the payload attributes schema to PayloadAttributesV4 and add the two uint fields, plus the inline example.
  • Add both fields to the four testing_buildBlockV1 generators, gated on IsAmsterdam (mirroring the existing Cancun gating), so fixtures carry them when filled against an Amsterdam-capable chain.

Verification

  • make build, make test (speccheck), make lint, and go test ./... pass; make fill stays idempotent on the pre-Amsterdam test chain.

Note

The committed fixtures can't be regenerated in-repo to include targetGasLimit (the bundled geth and test chain are pre-Amsterdam, and geth's PayloadAttributes has no such field); filling them is a follow-up against an Amsterdam-capable client.

O1ahmad added 2 commits August 6, 2026 09:28
…utes

The method described its payload attributes as PayloadAttributesV3 but the
Amsterdam fork requires PayloadAttributesV4, which adds slotNumber and
targetGasLimit. Align the schema title, properties, and example so the
method is valid for the current fork and matches engine specs.
Amsterdam's PayloadAttributesV4 requires slotNumber and targetGasLimit.
Gate the new fields on the Amsterdam fork, mirroring the existing Cancun
parentBeaconBlockRoot gating, so the generated fixtures include them when
filled against an Amsterdam-capable chain.
@MysticRyuujin

Copy link
Copy Markdown
Contributor

I think that in order to do this we need two things:

  1. Small go-ethereum update/fix
  2. We need to update the hivechain: tracking here as I think this change requires Amsterdam support?

rjl493456442 pushed a commit to ethereum/go-ethereum that referenced this pull request Aug 11, 2026
…5501)

`testing_buildBlockV1` decodes `targetGasLimit` from the payload
attributes but does not pass it to `miner.BuildPayloadArgs`. The miner
then falls back to its configured gas ceiling, so the field is silently
ignored. The engine API path (`forkchoiceUpdated`) already passes it
through.

This matters for fixture generation in ethereum/execution-apis, where
`testing_buildBlockV1` builds Amsterdam test blocks and the gas limit
must honor the CL-provided target (see ethereum/execution-apis#857 and
ethereum/execution-apis#862).

The new test builds an Amsterdam block with a target inside the
per-block adjustment bound and checks the payload hits it exactly.
@MysticRyuujin

Copy link
Copy Markdown
Contributor

go-ethereum master was fixed, this PR is now just waiting for Amsterdam support

@MysticRyuujin

Copy link
Copy Markdown
Contributor

Sequencing note from testing this against the Amsterdam chain in #867 (cross-client runs on 2026-08-26):

Suggested order: land #867 first, then rebase this PR down to the targetGasLimit changes (schema, example, generators) and run a full make fill on the Amsterdam chain. Happy to push the rebase here if you enable maintainer edits, or open it as a follow-up branch, whichever you prefer.

@O1ahmad

O1ahmad commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Right on, thanks — agreed on #867 first, then rebase this to targetGasLimit.

Maintainer edits are enabled if you want to push the rebase; cool with taking it myself once #867 lands also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

testing_buildBlockV1 fixture omits required Amsterdam targetGasLimit

2 participants