Skip to content

Commit

Permalink
fix: actually configure the custom gas limit (paradigmxyz#11565)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored and ebo committed Oct 14, 2024
1 parent 980137b commit 87b2b04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/rpc/rpc-eth-api/src/helpers/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ pub trait Call: LoadState + SpawnBlocking {
// Keep a copy of gas related request values
let tx_request_gas_limit = request.gas;
let tx_request_gas_price = request.gas_price;
// the gas limit of the corresponding block
let block_env_gas_limit = block.gas_limit;

// Determine the highest possible gas limit, considering both the request's specified limit
Expand Down Expand Up @@ -1083,6 +1084,8 @@ pub trait Call: LoadState + SpawnBlocking {
/// - `disable_eip3607` is set to `true`
/// - `disable_base_fee` is set to `true`
/// - `nonce` is set to `None`
///
/// In addition, this changes the block's gas limit to the configured [`Self::call_gas_limit`].
fn prepare_call_env<DB>(
&self,
mut cfg: CfgEnvWithHandlerCfg,
Expand All @@ -1102,6 +1105,9 @@ pub trait Call: LoadState + SpawnBlocking {
)
}

// apply configured gas cap
block.gas_limit = U256::from(self.call_gas_limit());

// Disabled because eth_call is sometimes used with eoa senders
// See <https://github.com/paradigmxyz/reth/issues/1959>
cfg.disable_eip3607 = true;
Expand Down

0 comments on commit 87b2b04

Please sign in to comment.