From e28a4730a2b230ba6f2142cf83612ecb1b3966f6 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Thu, 30 Apr 2026 15:46:58 +0200 Subject: [PATCH] core/vm: don't wrap ErrOutOfGas errors returned from the dynamic gas check in ErrOutOfGas --- core/vm/interpreter.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 4c278fc857..550a5b1350 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -17,6 +17,7 @@ package vm import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/common" @@ -222,7 +223,11 @@ func (evm *EVM) Run(contract *Contract, input []byte, readOnly bool) (ret []byte dynamicCost, err = operation.dynamicGas(evm, contract, stack, mem, memorySize) cost += dynamicCost.RegularGas // for tracing if err != nil { - return nil, fmt.Errorf("%w: %v", ErrOutOfGas, err) + if errors.Is(err, ErrOutOfGas) { + return nil, err + } else { + return nil, fmt.Errorf("%w: %v", ErrOutOfGas, err) + } } // for tracing: this gas consumption event is emitted below in the debug section. if contract.Gas.RegularGas < dynamicCost.RegularGas {