Update depth for precompile calls

This commit is contained in:
codchen 2024-05-01 12:32:54 +08:00
parent d6ee041f53
commit beaf8119e7

View file

@ -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)
}