Skip to content

Commit

Permalink
Merge pull request #25 from sei-protocol/update-depth-for-precompile-…
Browse files Browse the repository at this point in the history
…calls

Update depth for precompile calls
  • Loading branch information
codchen authored May 1, 2024
2 parents d6ee041 + beaf811 commit ce2e4cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit ce2e4cb

Please sign in to comment.