Skip to content

fix(rpc): use correct error codes for eth_simulateV1 reverts and halts#21412

Merged
mattsse merged 1 commit intoparadigmxyz:mainfrom
mattsse:fix/eth-simulate-error-codes
Jan 26, 2026
Merged

fix(rpc): use correct error codes for eth_simulateV1 reverts and halts#21412
mattsse merged 1 commit intoparadigmxyz:mainfrom
mattsse:fix/eth-simulate-error-codes

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Jan 25, 2026

Summary

Fixes error codes in eth_simulateV1 response to match geth:

Scenario Before After
Revert 3 (ExecutionError) -32000
Halt/VM error 3 (ExecutionError) -32015

Also sets returnData to empty bytes for reverts - the revert data will go in error.data once alloy adds support (PR pending).

Test

Fixes multiple hive eth_simulateV1 test failures including:

  • ethSimulate-eth-send-should-not-produce-logs-on-revert
  • ethSimulate-run-out-of-gas-in-block-38015

Related

  • Alloy PR for error.data field: pending

@mattsse mattsse requested a review from Rjected as a code owner January 25, 2026 15:28
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Jan 25, 2026
@mattsse mattsse added the A-rpc Related to the RPC implementation label Jan 25, 2026
Defines constants for eth_simulateV1 specific error codes:
- SIMULATE_REVERT_CODE (-32000) for execution reverts
- SIMULATE_VM_ERROR_CODE (-32015) for VM execution errors (e.g., out of gas)

These match geth's behavior per the execution-apis spec.

Amp-Thread-ID: https://ampcode.com/threads/T-019bf5ac-dd59-76c0-8ba8-8739e84b6a33
Co-authored-by: Amp <amp@ampcode.com>
@mattsse mattsse force-pushed the fix/eth-simulate-error-codes branch from 95ea466 to f4d8b70 Compare January 25, 2026 15:29
@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Jan 26, 2026
@mattsse mattsse added this pull request to the merge queue Jan 26, 2026
Merged via the queue into paradigmxyz:main with commit 935a2cc Jan 26, 2026
45 checks passed
@mattsse mattsse deleted the fix/eth-simulate-error-codes branch January 26, 2026 14:15
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jan 26, 2026
rakita pushed a commit that referenced this pull request Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants