Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions prdoc/pr_10224.prdoc
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions substrate/frame/revive/src/vm/evm/instructions/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -58,7 +58,9 @@ pub fn create<const IS_CREATE2: bool, E: Ext>(
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::<E::T>()
{
return ControlFlow::Break(Error::<E::T>::BlobTooLarge.into());
}

Expand Down