diff --git a/prdoc/pr_10224.prdoc b/prdoc/pr_10224.prdoc new file mode 100644 index 0000000000000..cf2068e6d6c46 --- /dev/null +++ b/prdoc/pr_10224.prdoc @@ -0,0 +1,10 @@ +title: make contracts create consider is_unlimited_contract_size_allowed +doc: +- audience: Runtime Dev + description: |- + While running foundry tests from https://github.com/balancer/balancer-v3-monorepo/tree/main/pkg/pool-weighted, found we hit this limit. + + Foundry environment is configured with unlimited code size, so we need to make sure pallet-revive respects those configurations everywhere. +crates: +- name: pallet-revive + bump: minor diff --git a/substrate/frame/revive/src/vm/evm/instructions/contract.rs b/substrate/frame/revive/src/vm/evm/instructions/contract.rs index 421f592b8462f..732094ce6b71a 100644 --- a/substrate/frame/revive/src/vm/evm/instructions/contract.rs +++ b/substrate/frame/revive/src/vm/evm/instructions/contract.rs @@ -23,7 +23,7 @@ use crate::{ evm::{interpreter::Halt, util::as_usize_or_halt, Interpreter}, Ext, RuntimeCosts, }, - Code, Error, Pallet, Weight, H160, LOG_TARGET, U256, + Code, DebugSettings, Error, Pallet, Weight, H160, LOG_TARGET, U256, }; use alloc::{vec, vec::Vec}; pub use call_helpers::{calc_call_gas, get_memory_in_and_out_ranges}; @@ -58,7 +58,9 @@ pub fn create( let mut code = Vec::new(); if len != 0 { // EIP-3860: Limit initcode - if len > revm::primitives::eip3860::MAX_INITCODE_SIZE { + if len > revm::primitives::eip3860::MAX_INITCODE_SIZE && + !DebugSettings::is_unlimited_contract_size_allowed::() + { return ControlFlow::Break(Error::::BlobTooLarge.into()); }