Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: actually configure the custom gas limit #11565

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading