@@ -26,8 +26,8 @@ use tracing::warn;
2626use alloy_eips:: eip7702:: SignedAuthorization ;
2727use polkadot_sdk:: {
2828 pallet_revive:: {
29- self , AccountInfo , AddressMapper , BalanceOf , BytecodeType , Code , ContractInfo , ExecConfig ,
30- Executable , Pallet , evm:: CallTrace ,
29+ self , AccountInfo , AddressMapper , BalanceOf , BytecodeType , Code , ContractInfo ,
30+ DebugSettings , ExecConfig , Executable , Pallet , evm:: CallTrace ,
3131 } ,
3232 polkadot_sdk_frame:: prelude:: OriginFor ,
3333 sp_core:: { self , H160 , H256 } ,
@@ -891,6 +891,13 @@ impl foundry_cheatcodes::CheatcodeInspectorStrategyExt for PvmCheatcodeInspector
891891 _ => None ,
892892 } ;
893893
894+ // If limits are set to max, enable debug mode to bypass them in revive
895+ if ecx. cfg . limit_contract_code_size == Some ( usize:: MAX )
896+ || ecx. cfg . limit_contract_initcode_size == Some ( usize:: MAX )
897+ {
898+ let debug_settings = DebugSettings :: new ( true ) ;
899+ debug_settings. write_to_storage :: < Runtime > ( ) ;
900+ }
894901 Pallet :: < Runtime > :: bare_instantiate (
895902 origin,
896903 evm_value,
@@ -1025,6 +1032,14 @@ impl foundry_cheatcodes::CheatcodeInspectorStrategyExt for PvmCheatcodeInspector
10251032 mock_handler : Some ( Box :: new ( mock_handler. clone ( ) ) ) ,
10261033 is_dry_run : false ,
10271034 } ;
1035+ // If limits are set to max, enable debug mode to bypass them in revive
1036+ if ecx. cfg . limit_contract_code_size == Some ( usize:: MAX )
1037+ || ecx. cfg . limit_contract_initcode_size == Some ( usize:: MAX )
1038+ {
1039+ let debug_settings = DebugSettings :: new ( true ) ;
1040+ debug_settings. write_to_storage :: < Runtime > ( ) ;
1041+ }
1042+
10281043 Pallet :: < Runtime > :: bare_call (
10291044 origin,
10301045 target,
0 commit comments