Merge pull request #25 from sei-protocol/update-depth-for-precompile-calls

Update depth for precompile calls
This commit is contained in:
codchen 2024-05-01 12:52:12 +08:00 committed by GitHub
commit ce2e4cb154
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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