diff --git a/crates/revm/src/processor.rs b/crates/revm/src/processor.rs index da329991a..be9886c64 100644 --- a/crates/revm/src/processor.rs +++ b/crates/revm/src/processor.rs @@ -34,7 +34,7 @@ use reth_provider::BundleStateWithReceipts; use revm::DatabaseCommit; #[cfg(not(feature = "optimism"))] use tracing::{debug, trace}; -use reth_primitives::revm_primitives::RWASM_MAX_INITCODE_SIZE; +use reth_primitives::revm_primitives::WASM_MAX_CODE_SIZE; use crate::primitives::EVMError; /// EVMProcessor is a block executor that uses revm to execute blocks or multiple blocks. @@ -181,7 +181,7 @@ where header, total_difficulty, ); - cfg.cfg_env.limit_contract_code_size = Some(RWASM_MAX_INITCODE_SIZE); + cfg.cfg_env.limit_contract_code_size = Some(WASM_MAX_CODE_SIZE); *self.evm.cfg_mut() = cfg.cfg_env; // This will update the spec in case it changed diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index 6f1981de0..f476020b9 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -59,6 +59,7 @@ use reth_revm::optimism::RethL1BlockInfo; use reth_rpc_types::OptimismTransactionReceiptFields; #[cfg(feature = "optimism")] use revm::L1BlockInfo; +use revm_primitives::WASM_MAX_CODE_SIZE; /// Helper alias type for the state's [CacheDB] pub(crate) type StateCacheDB = CacheDB>; @@ -922,7 +923,8 @@ where F: FnOnce(StateCacheDB, EnvWithHandlerCfg) -> EthResult + Send + 'static, R: Send + 'static, { - let (cfg, block_env, at) = self.evm_env_at(at).await?; + let (mut cfg, block_env, at) = self.evm_env_at(at).await?; + cfg.limit_contract_code_size = Some(WASM_MAX_CODE_SIZE); let this = self.clone(); self.inner .blocking_task_pool diff --git a/crates/transaction-pool/src/validate/constants.rs b/crates/transaction-pool/src/validate/constants.rs index e1d44cf01..2bb56e1d1 100644 --- a/crates/transaction-pool/src/validate/constants.rs +++ b/crates/transaction-pool/src/validate/constants.rs @@ -9,10 +9,10 @@ pub const TX_SLOT_BYTE_SIZE: usize = 32 * 1024; /// more expensive to propagate; larger transactions also take more resources /// to validate whether they fit into the pool or not. Default is 4 times [`TX_SLOT_BYTE_SIZE`], /// which defaults to 32 KiB, so 128 KiB. -pub const DEFAULT_MAX_TX_INPUT_BYTES: usize = 4 * TX_SLOT_BYTE_SIZE; // 128KB +pub const DEFAULT_MAX_TX_INPUT_BYTES: usize = 4 * TX_SLOT_BYTE_SIZE * 8; // 1MB /// Maximum bytecode to permit for a contract. -pub const MAX_CODE_BYTE_SIZE: usize = 24576; +pub const MAX_CODE_BYTE_SIZE: usize = 0x100000; // 1MB /// Maximum initcode to permit in a creation transaction and create instructions. pub const MAX_INIT_CODE_BYTE_SIZE: usize = 2 * MAX_CODE_BYTE_SIZE;