From 14c2408957599c096409375d33d59ca3b7048733 Mon Sep 17 00:00:00 2001 From: Sina M <1591639+s1na@users.noreply.github.com> Date: Fri, 6 Feb 2026 07:57:41 +0100 Subject: [PATCH] internal/ethapi: fix error code for revert in eth_simulateV1 (#33007) The error code for revert should be consistent with eth_call and be 3. --- internal/ethapi/errors.go | 1 - internal/ethapi/simulate.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/ethapi/errors.go b/internal/ethapi/errors.go index 30711a0167..e406c36d6c 100644 --- a/internal/ethapi/errors.go +++ b/internal/ethapi/errors.go @@ -112,7 +112,6 @@ const ( errCodeClientLimitExceeded = -38026 errCodeInternalError = -32603 errCodeInvalidParams = -32602 - errCodeReverted = -32000 errCodeVMError = -32015 errCodeTxSyncTimeout = 4 ) diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index 3c08061313..c9396cd327 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -310,7 +310,7 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header, if errors.Is(result.Err, vm.ErrExecutionReverted) { // If the result contains a revert reason, try to unpack it. revertErr := newRevertError(result.Revert()) - callRes.Error = &callError{Message: revertErr.Error(), Code: errCodeReverted, Data: revertErr.ErrorData().(string)} + callRes.Error = &callError{Message: revertErr.Error(), Code: revertErr.ErrorCode(), Data: revertErr.ErrorData().(string)} } else { callRes.Error = &callError{Message: result.Err.Error(), Code: errCodeVMError} }