feat: add --rpc.evm-memory-limit flag (#19279)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Wojtek Łopata
2025-10-30 20:53:43 +01:00
committed by GitHub
parent fccf76a19a
commit dc8efbf9b3
19 changed files with 87 additions and 24 deletions

View File

@@ -13,7 +13,7 @@ workspace = true
[dependencies]
# reth
revm = { workspace = true, features = ["optional_block_gas_limit", "optional_eip3607", "optional_no_base_fee", "optional_fee_charge"] }
revm = { workspace = true, features = ["optional_block_gas_limit", "optional_eip3607", "optional_no_base_fee", "optional_fee_charge", "memory_limit"] }
reth-chain-state.workspace = true
revm-inspectors.workspace = true
reth-primitives-traits = { workspace = true, features = ["rpc-compat"] }

View File

@@ -493,6 +493,9 @@ pub trait Call:
/// Returns the maximum number of blocks accepted for `eth_simulateV1`.
fn max_simulate_blocks(&self) -> u64;
/// Returns the maximum memory the EVM can allocate per RPC request.
fn evm_memory_limit(&self) -> u64;
/// Returns the max gas limit that the caller can afford given a transaction environment.
fn caller_gas_allowance(
&self,
@@ -811,6 +814,8 @@ pub trait Call:
// <https://github.com/paradigmxyz/reth/issues/18470>
evm_env.cfg_env.disable_fee_charge = true;
evm_env.cfg_env.memory_limit = self.evm_memory_limit();
// set nonce to None so that the correct nonce is chosen by the EVM
request.as_mut().take_nonce();