Skip to content

Add testing_buildBlockV1 RPC Method#747

Merged
fjl merged 17 commits into
ethereum:mainfrom
MysticRyuujin:buildBlockV1
Apr 6, 2026
Merged

Add testing_buildBlockV1 RPC Method#747
fjl merged 17 commits into
ethereum:mainfrom
MysticRyuujin:buildBlockV1

Conversation

@MysticRyuujin

@MysticRyuujin MysticRyuujin commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

This PR adds comprehensive support for the testing_buildBlockV1 RPC method.

Changes

  • New OpenRPC specification for testing_buildBlockV1
  • 4 test fixtures validating various scenarios
  • Build system integration
  • Client configuration updates
  • Test generator implementation
  • Auto-generated documentation

Testing Results

✅ All npm lint checks passing
✅ All speccheck tests passing
✅ Spellcheck validation passing

…ures

This commit adds comprehensive support for the testing_buildBlockV1 RPC method,
which is used to generate test fixtures for Ethereum execution layer clients.

Changes include:
- New OpenRPC specification in src/testing/testing_buildBlockV1.yaml
- Test fixtures for three scenarios: with transactions, with extra data, without extra data
- Integration of testing methods into spec build process (scripts/build.js)
- Client configuration to enable testing RPC namespace (tools/client.go)
- Test generator implementation with comprehensive validation (tools/testgen/generators.go)
- Wordlist update for spellcheck compliance

All tests pass:
✅ npm run lint (OpenRPC validation)
✅ npm run test (speccheck validation)
✅ Spellcheck

The implementation follows existing patterns and is backward compatible.
@MysticRyuujin

MysticRyuujin commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

This PR is in draft mostly because of the requirement to use MariusVanDerWijden/testing-buildblock and it is directly addressing testing for #710 as well as some other minor issues found while running the complete test suite.

Also, I'm getting some errors with the branch/fork of geth, which I think are actual geth bugs.

@MysticRyuujin

Copy link
Copy Markdown
Contributor Author

Ok, now the tests are passing, but these changes still need to make it into go-ethereum

@MysticRyuujin

Copy link
Copy Markdown
Contributor Author

I removed one of the tests because it was redundant. The tests cover all scenarios:

  1. Empty block with no TXs and no extraData
  2. Passing a TX with extraData
  3. Attempting to pass an invalid tx

It also validates the go-ethereum responses to the spec to avoid regressions in the library

@MysticRyuujin

Copy link
Copy Markdown
Contributor Author

Updated reference to the latest, spec now allows passing null for the transaction array to build a block from mempool. This may result in hive diffs, not sure, but we can deal with that later.

Resolve conflicts:
- package.json: accept main's make-based build commands
- scripts/build.js: delete (replaced by Go specgen tool)
- tools/go.mod: accept main's deps, keep replace directive for geth fork
- tools/go.sum: regenerated via go mod tidy
- Makefile: add -methods 'src/testing' for testing_buildBlockV1
Update testing_buildBlockV1 fixture outputs to match current fill
results, including slotNumber and blockTimestamp fields.
@MysticRyuujin

Copy link
Copy Markdown
Contributor Author

@fjl can merge

@fjl fjl merged commit 6ea5e40 into ethereum:main Apr 6, 2026
5 checks passed
github-merge-queue Bot pushed a commit to erigontech/erigon that referenced this pull request Apr 7, 2026
## Summary

Pin `ethereum/execution-apis` ref in hive rpc-compat tests, the same way
`hive_ref` already pins the hive framework itself.

- Add `execution_apis_ref` to `hive-versions.json`
- Before hive builds the rpc-compat simulator image, clone
execution-apis at the pinned ref, copy the `tests/` dir into the build
context, and patch the Dockerfile to use the local copy (the Dockerfile
already has a commented-out `ADD tests` for this purpose)
- Only runs for the `rpc/compat` matrix entry, not engine sims

## Why

The rpc-compat simulator's Dockerfile clones `ethereum/execution-apis`
at `main` HEAD on every build (`ARG branch=main`). On April 6 at ~15:00
UTC, ethereum/execution-apis#747 added `testing_buildBlockV1` tests (200
→ 208 tests). Erigon doesn't implement this method, causing 4 new
failures and breaking ci-gate on **all PRs**.

The hive framework was already pinned via `hive_ref`, but the test data
it fetches was not.

To bump execution-apis in the future, update `execution_apis_ref` in
`hive-versions.json`.

## Test plan

- [ ] ci-gate passes (rpc-compat runs pinned 200 tests, 0 failures)
- [ ] Engine sims unaffected (step is skipped via matrix condition)

---------

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-merge-queue Bot pushed a commit to erigontech/erigon that referenced this pull request Apr 7, 2026
## Summary

Pin `ethereum/execution-apis` ref in hive rpc-compat tests, the same way
`hive_ref` already pins the hive framework itself.

- Add `execution_apis_ref` to `hive-versions.json`
- Before hive builds the rpc-compat simulator image, clone
execution-apis at the pinned ref, copy the `tests/` dir into the build
context, and patch the Dockerfile to use the local copy (the Dockerfile
already has a commented-out `ADD tests` for this purpose)
- Only runs for the `rpc/compat` matrix entry, not engine sims

## Why

The rpc-compat simulator's Dockerfile clones `ethereum/execution-apis`
at `main` HEAD on every build (`ARG branch=main`). On April 6 at ~15:00
UTC, ethereum/execution-apis#747 added `testing_buildBlockV1` tests (200
→ 208 tests). Erigon doesn't implement this method, causing 4 new
failures and breaking ci-gate on **all PRs**.

The hive framework was already pinned via `hive_ref`, but the test data
it fetches was not.

To bump execution-apis in the future, update `execution_apis_ref` in
`hive-versions.json`.

## Test plan

- [ ] ci-gate passes (rpc-compat runs pinned 200 tests, 0 failures)
- [ ] Engine sims unaffected (step is skipped via matrix condition)

---------

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AskAlexSharov added a commit to erigontech/erigon that referenced this pull request Apr 8, 2026
Pin `ethereum/execution-apis` ref in hive rpc-compat tests, the same way
`hive_ref` already pins the hive framework itself.

- Add `execution_apis_ref` to `hive-versions.json`
- Before hive builds the rpc-compat simulator image, clone
execution-apis at the pinned ref, copy the `tests/` dir into the build
context, and patch the Dockerfile to use the local copy (the Dockerfile
already has a commented-out `ADD tests` for this purpose)
- Only runs for the `rpc/compat` matrix entry, not engine sims

The rpc-compat simulator's Dockerfile clones `ethereum/execution-apis`
at `main` HEAD on every build (`ARG branch=main`). On April 6 at ~15:00
UTC, ethereum/execution-apis#747 added `testing_buildBlockV1` tests (200
→ 208 tests). Erigon doesn't implement this method, causing 4 new
failures and breaking ci-gate on **all PRs**.

The hive framework was already pinned via `hive_ref`, but the test data
it fetches was not.

To bump execution-apis in the future, update `execution_apis_ref` in
`hive-versions.json`.

- [ ] ci-gate passes (rpc-compat runs pinned 200 tests, 0 failures)
- [ ] Engine sims unaffected (step is skipped via matrix condition)

---------

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jochem-brouwer

Copy link
Copy Markdown
Member

I was not aware that this was the active one for this endpoint, I went to #710. There are some requests, this one in particular, which I'd like to see in this API. It is about adding the target gas limit to the API, to have control over the gas target of the block. This is necessary to fill certain benchmarks (for instance a mainnet fork where we want to bump the gas limit to twice the current value, and then create benchmark blocks)

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.

3 participants