From 8e33cdeaae5f923c4549818a6797b33bf402e36b Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 23 Oct 2025 17:46:52 +0200 Subject: [PATCH] internal/ethapi: fix error code for revert in eth_simulateV1 --- 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 30711a01679..e406c36d6c3 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 0d1a59b371a..bb7b98f5059 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} }