mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
core/vm: don't wrap ErrOutOfGas errors returned from the dynamic gas check in ErrOutOfGas
This commit is contained in:
parent
01036bed83
commit
e28a4730a2
1 changed files with 6 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue