Skip to content

update eip 8037 to latest spec test#10185

Merged
daniellehrner merged 3 commits intobesu-eth:mainfrom
daniellehrner:feat/bal_devnet_test_v5.6.1
Apr 7, 2026
Merged

update eip 8037 to latest spec test#10185
daniellehrner merged 3 commits intobesu-eth:mainfrom
daniellehrner:feat/bal_devnet_test_v5.6.1

Conversation

@daniellehrner
Copy link
Copy Markdown
Contributor

PR description

Update devnet reference tests to https://github.com/ethereum/execution-spec-tests/releases/tag/bal%40v5.6.1:

Per-tx state gas pre-check removal

  1. check_transaction was reserving the full tx gas limit against the state gas budget per-transaction, but EIP-8037 only defines block-level validation. This rejected valid blocks where individual txs exceeded the state gas budget but the block total was valid.
  2. Multi-tx block where individual txs exceed the state gas budget but the block total max(regular, state) <= gas_limit is valid.

CREATE state gas ordering (now active)

  1. charge_state_gas(STATE_BYTES_PER_NEW_ACCOUNT) was called before the MAX_INIT_CODE_SIZE validation in create()/create2(). A CREATE with oversized initcode would persist state_gas_used for an account that was never created. Also moved is_static check before gas charging, consistent with SSTORE, CALL, and SELFDESTRUCT.
  2. Existing test_max_initcode_size_via_create[over_max] cases cover this scenario after re-fill.
    Code deposit halt state gas
  3. Initcode that performs state-creating operations (CALL to new account, inner CREATE) then triggers code deposit failure (oversized code or OOG). Verifies reverted GAS_NEW_ACCOUNT does not count in block_state_gas_used.

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Copilot AI review requested due to automatic review settings April 4, 2026 18:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Besu’s EIP-8037-related behavior and devnet reference fixtures to align with the latest execution-spec-tests release, specifically around removing per-tx state gas pre-checks and correcting CREATE initcode/state-gas ordering.

Changes:

  • Bump execution-spec-tests devnet fixtures from bal@v5.5.1 to bal@v5.6.1 (Gradle dependency + verification metadata).
  • Update EIP-8037 block/tx capacity pre-checks to consider regular gas only (state gas validated at block level).
  • Reorder CREATE initcode max-size validation to happen before charging state gas.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
gradle/verification-metadata.xml Updates checksum metadata for the new bal@v5.6.1 fixtures artifact.
ethereum/referencetests/build.gradle Bumps the devnet fixtures dependency to bal@v5.6.1.
evm/.../AbstractCreateOperation.java Validates MAX_INIT_CODE_SIZE before any state gas charging to match spec ordering.
ethereum/core/.../BlockGasAccountingStrategy.java Removes per-tx “state dimension” capacity check; only regular gas is checked pre-exec.
ethereum/core/.../BlockGasAccountingStrategyTest.java Updates/extends tests to reflect regular-gas-only block capacity checks.
ethereum/blockcreation/.../BlockSizeTransactionSelector.java Updates docs to match regular-gas-only pre-check behavior.
ethereum/blockcreation/.../BlockSizeTransactionSelectorTest.java Updates test comments to reflect the new pre-check semantics.

…s deduction

Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Copy link
Copy Markdown
Contributor

@matkt matkt left a comment

Choose a reason for hiding this comment

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

LGTM

@daniellehrner daniellehrner enabled auto-merge (squash) April 7, 2026 09:14
@daniellehrner daniellehrner merged commit 300b201 into besu-eth:main Apr 7, 2026
33 checks passed
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