From beaf8119e77fb5706e0978e254d554e12c6342ce Mon Sep 17 00:00:00 2001 From: codchen Date: Wed, 1 May 2024 12:32:54 +0800 Subject: [PATCH] Update depth for precompile calls --- core/vm/contracts.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 7c1a2d58f0..5accdc0c73 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) }