@@ -401,7 +401,7 @@ pub trait EthCall: EstimateCall + Call + LoadPendingBlock + LoadBlock + FullEthA
401401 evm_env. cfg_env . disable_eip3607 = true ;
402402
403403 if request. as_ref ( ) . gas_limit ( ) . is_none ( ) && tx_env. gas_price ( ) > 0 {
404- let cap = this. caller_gas_allowance ( & mut db, & tx_env) ?;
404+ let cap = this. caller_gas_allowance ( & mut db, & evm_env , & tx_env) ?;
405405 // no gas limit was provided in the request, so we need to cap the request's gas
406406 // limit
407407 tx_env. set_gas_limit ( cap. min ( evm_env. block_env . gas_limit ) ) ;
@@ -479,9 +479,10 @@ pub trait Call:
479479 fn caller_gas_allowance (
480480 & self ,
481481 mut db : impl Database < Error : Into < EthApiError > > ,
482- env : & TxEnvFor < Self :: Evm > ,
482+ _evm_env : & EvmEnvFor < Self :: Evm > ,
483+ tx_env : & TxEnvFor < Self :: Evm > ,
483484 ) -> Result < u64 , Self :: Error > {
484- alloy_evm:: call:: caller_gas_allowance ( & mut db, env ) . map_err ( Self :: Error :: from_eth_err)
485+ alloy_evm:: call:: caller_gas_allowance ( & mut db, tx_env ) . map_err ( Self :: Error :: from_eth_err)
485486 }
486487
487488 /// Executes the closure with the state that corresponds to the given [`BlockId`].
@@ -799,7 +800,7 @@ pub trait Call:
799800 if tx_env. gas_price ( ) > 0 {
800801 // If gas price is specified, cap transaction gas limit with caller allowance
801802 trace ! ( target: "rpc::eth::call" , ?tx_env, "Applying gas limit cap with caller allowance" ) ;
802- let cap = self . caller_gas_allowance ( db, & tx_env) ?;
803+ let cap = self . caller_gas_allowance ( db, & evm_env , & tx_env) ?;
803804 // ensure we cap gas_limit to the block's
804805 tx_env. set_gas_limit ( cap. min ( evm_env. block_env . gas_limit ) ) ;
805806 }
0 commit comments