From d8c23130bbaebafa9c4b4f87b92c65129183917e Mon Sep 17 00:00:00 2001 From: xermicus Date: Tue, 6 Jan 2026 18:31:45 +0100 Subject: [PATCH] revive-runner: enable PVM logs (#442) This PR fixes a small oversight from #431: Set the debug config of the revive-runner `Runtime` such that we get the PVM logs back. Since the revive runner runtime is mainly meant for debugging, I further decided to enable unlimited contract sizes and disable [EIP 3607](https://eips.ethereum.org/EIPS/eip-3607) too. --------- Signed-off-by: xermicus --- CHANGELOG.md | 1 + crates/integration/contracts/BlockHash.sol | 2 +- crates/runner/src/lib.rs | 13 ++++++++++++- crates/runner/src/runtime.rs | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d349e04..b1b3dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Supported `polkadot-sdk` rev: `unstable2507` - The supported `polkadot-sdk` release is `unstable2507`. - The `INVALID` opcode and OOB memory accesses now consume all remaining gas. - Emit the `call_evm` and `delegate_call_evm` syscalls for contract calls. +- The `revive-runner` can execute arbitrarily large contract blobs. ### Fixed: - The missing `STOP` instruction at the end of `code` blocks. diff --git a/crates/integration/contracts/BlockHash.sol b/crates/integration/contracts/BlockHash.sol index fdb4e0a..02f9ede 100644 --- a/crates/integration/contracts/BlockHash.sol +++ b/crates/integration/contracts/BlockHash.sol @@ -13,7 +13,7 @@ pragma solidity ^0.8; "contract": "BlockHash" } }, - "data": "4545454545454545454545454545454545454545454545454545454545454545" + "data": "e8ec043305d4cfbb51936ae25b50e0a4352d8eaab03d0f66d8d543e65a9a9668" } } ] diff --git a/crates/runner/src/lib.rs b/crates/runner/src/lib.rs index 604e0a7..b992145 100644 --- a/crates/runner/src/lib.rs +++ b/crates/runner/src/lib.rs @@ -28,7 +28,7 @@ use std::time::Duration; use hex::{FromHex, ToHex}; use pallet_revive::{AddressMapper, ExecReturnValue, InstantiateReturnValue}; use polkadot_sdk::frame_support::traits::Currency; -use polkadot_sdk::pallet_revive::{Config, Pallet}; +use polkadot_sdk::pallet_revive::{Config, DebugSettings, Pallet}; use polkadot_sdk::*; use polkadot_sdk::{ pallet_revive::ContractResult, @@ -89,6 +89,17 @@ impl ExtBuilder { .build_storage() .unwrap(); + pallet_revive::GenesisConfig:: { + debug_settings: Some(DebugSettings::new( + true, // allow unlimited contract size + true, // bypass EIP 3607 + true, // enable PVM logs + )), + ..Default::default() + } + .assimilate_storage(&mut t) + .unwrap(); + pallet_balances::GenesisConfig:: { balances: self.balance_genesis_config, dev_accounts: None, diff --git a/crates/runner/src/runtime.rs b/crates/runner/src/runtime.rs index be9aebd..d787812 100644 --- a/crates/runner/src/runtime.rs +++ b/crates/runner/src/runtime.rs @@ -61,6 +61,7 @@ impl pallet_timestamp::Config for Runtime {} parameter_types! { pub const UnstableInterface: bool = true; + pub const DebugFlag: bool = true; pub const DepositPerByte: Balance = 1; pub const DepositPerItem: Balance = 2; pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); @@ -87,6 +88,7 @@ impl pallet_revive::Config for Runtime { type ChainId = ConstU64<420_420_420>; type FindAuthor = Self; type NativeToEthRatio = ConstU32<{ crate::ETH_RATIO as u32 }>; + type DebugEnabled = DebugFlag; } impl FindAuthor<::AccountId> for Runtime {