Skip to content

feat(test-cli): Add support for testing block building via simulator#2679

Open
fselmo wants to merge 3 commits intoethereum:forks/amsterdamfrom
fselmo:feat/block-building-tests
Open

feat(test-cli): Add support for testing block building via simulator#2679
fselmo wants to merge 3 commits intoethereum:forks/amsterdamfrom
fselmo:feat/block-building-tests

Conversation

@fselmo
Copy link
Copy Markdown
Contributor

@fselmo fselmo commented Apr 14, 2026

🗒️ Description

Adds a hive-based simulator that verifies EL clients build correct blocks via testing_buildBlockV1

For each payload in a blockchain_test_engine fixture, the test sends the expected transactions and block attributes to the client's block building endpoint. The resulting block is validated against the fixture's expected output (state_root, receipts_root, etc). The fixture block is then imported via engine_newPayloadVX to advance the chain for subsequent blocks.

gas_limit is validated a bit different for now, since testing_buildBlockV1 doesn't accept a gas limit parameter. The client picks its own within the EIP-1559 adjustment range so we validate it is within that range until we can actually account for the gas limit. For this reason, block_hash is also excluded from comparison as it depends on gas_limit.

Also looking for recs on the naming (uv run build-block). We could go with build by itself but it feels vague to me. That said, I can be easily convinced here 😄.

🔗 Related Issues or PRs

closes #2560

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

Screenshot 2026-04-14 at 13 23 01

- Test build building via ``testing_buildBlockV1``, validating the built block, and re-consuming against the client
@fselmo fselmo added C-feat Category: an improvement or new feature A-test-cli Area: execution_testing.cli labels Apr 14, 2026
@fselmo fselmo marked this pull request as ready for review April 14, 2026 19:26
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.26%. Comparing base (6672cfe) to head (795a4f9).
⚠️ Report is 7 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2679   +/-   ##
================================================
  Coverage            86.25%   86.26%           
================================================
  Files                  599      599           
  Lines                37032    37038    +6     
  Branches              3795     3795           
================================================
+ Hits                 31943    31949    +6     
  Misses                4525     4525           
  Partials               564      564           
Flag Coverage Δ
unittests 86.26% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jwasinger pushed a commit to ethereum/go-ethereum that referenced this pull request Apr 14, 2026
Wire up slotnum for `testing_buildBlockV1` for `bal-devnet-3` branch

We are experimenting testing block building through hive via EELS (PR
[here](ethereum/execution-specs#2679)). This is
the only change needed to test against `bal-devnet-3` - missing slotnum.
@LouisTsai-Csie LouisTsai-Csie self-requested a review April 15, 2026 06:48
Copy link
Copy Markdown
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just two comments to try to improve maintainability.

fselmo added a commit to fselmo/execution-specs that referenced this pull request Apr 15, 2026
@fselmo fselmo force-pushed the feat/block-building-tests branch from 5852e2d to 795a4f9 Compare April 15, 2026 23:03
@fselmo
Copy link
Copy Markdown
Contributor Author

fselmo commented Apr 15, 2026

@marioevz lmk if the last commit here is what you meant. I re-ran against geth bal-devnet-3 with this cherry-picked there with some minor updates that are needed (slotnum, etc) and it's still running smooth 👍🏼

"-p",
"execution_testing.cli.pytest_commands.plugins.consume.simulators.build_block.conftest",
]
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not important but maybe we could have something like this for the entire if-else comparison:

command_name = self.command_name
simulator_command_list = ["engine", "enginex", ...]

if command_name in simulator_command_list:
  modified_args.extend(
      [
          "-p",
          f"execution_testing.cli.pytest_commands.plugins.consume.simulators.{command_name}.conftest",
      ]
  )

else:
  raise ValueError(f"Unknown command name: {self.command_name}")

i would like to continue on reviewing the remaining part of the PR!

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

Labels

A-test-cli Area: execution_testing.cli C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add block building correctness testing via testing_buildBlockV1 endpoint

3 participants