mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-09 15:28:01 -05:00
feat: add --rpc.evm-memory-limit flag (#19279)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -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"] }
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user