diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 7c1a2d58f0e9..5accdc0c732e 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -174,6 +174,8 @@ func ActivePrecompiles(rules params.Rules) []common.Address { // - the _remaining_ gas, // - any error that occurred func RunPrecompiledContract(p PrecompiledContract, evm *EVM, sender common.Address, callingContract common.Address, input []byte, suppliedGas uint64, value *big.Int, logger *tracing.Hooks, readOnly bool) (ret []byte, remainingGas uint64, err error) { + evm.depth++ + defer func() { evm.depth-- }() if dp, ok := p.(DynamicGasPrecompiledContract); ok { return dp.RunAndCalculateGas(evm, sender, callingContract, input, suppliedGas, value, logger, readOnly) }