Skip to content

fix: eth_simulateV1 future blocks and validation error#9837

Merged
macfarla merged 8 commits intobesu-eth:mainfrom
macfarla:fix-eth-simulate-error-codes
Feb 23, 2026
Merged

fix: eth_simulateV1 future blocks and validation error#9837
macfarla merged 8 commits intobesu-eth:mainfrom
macfarla:fix-eth-simulate-error-codes

Conversation

@macfarla
Copy link
Copy Markdown
Contributor

@macfarla macfarla commented Feb 18, 2026

PR description

  • Return BLOCK_NOT_FOUND error instead of null success response when eth_simulateV1 is called with a future/unknown block number, per the execution-apis spec
  • Map UPFRONT_COST_EXCEEDS_BALANCE (-38014) error code to -32602 (invalid params) when validation is enabled, per the execution-apis spec. When validation is not enabled, the original -38014 code is preserved.

Fixed Issue(s)

Ref #9636
fixes #9829

Hive rpc-compat tests fixed (6)

  • eth_simulateV1/ethSimulate-empty-with-block-num-set-plus1
  • eth_simulateV1/ethSimulate-make-call-with-future-block
  • eth_simulateV1/ethSimulate-gas-fees-and-value-error-38014-with-validation
  • eth_simulateV1/ethSimulate-simple-no-funds-with-validation
  • eth_simulateV1/ethSimulate-simple-no-funds-with-validation-without-nonces
  • eth_simulateV1/ethSimulate-simple-send-from-contract-with-validation

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?

macfarla and others added 2 commits February 18, 2026 14:12
…rrors

- Return BLOCK_NOT_FOUND error instead of null for future/unknown block numbers
- Map UPFRONT_COST_EXCEEDS_BALANCE error code to -32602 (invalid params)
  when validation is enabled, per the execution-apis spec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla macfarla added the hive relating to hive tests label Feb 18, 2026
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla macfarla marked this pull request as ready for review February 18, 2026 05:27
Copilot AI review requested due to automatic review settings February 18, 2026 05:27
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

Updates eth_simulateV1 to align with execution-apis spec behavior for future blocks and validation-related error codes.

Changes:

  • Return BLOCK_NOT_FOUND instead of a null success when simulating against a future/unknown block.
  • Map UPFRONT_COST_EXCEEDS_BALANCE (-38014) to -32602 (invalid params) when validation is enabled.
  • Update unit test expectations and document the behavior change in the changelog.

Reviewed changes

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

File Description
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthSimulateV1Test.java Updates test to expect BLOCK_NOT_FOUND error for future block numbers.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthSimulateV1.java Implements error mapping for validation and converts null-success responses to BLOCK_NOT_FOUND.
CHANGELOG.md Notes the RPC behavior changes as breaking changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla macfarla enabled auto-merge (squash) February 22, 2026 23:41
@macfarla macfarla merged commit ea9e7b5 into besu-eth:main Feb 23, 2026
46 checks passed
@macfarla macfarla deleted the fix-eth-simulate-error-codes branch February 24, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hive relating to hive tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Amsterdam: eth_simulateV1: fix revert err code

3 participants