From 6312262b335ad98fc5ed9bad0693e57d4ba4b4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Mon, 10 Aug 2026 02:22:29 +0000 Subject: [PATCH 1/3] Register storage-proof-size host function The CLI registered only sp_io::SubstrateHostFunctions. Runtimes that use cumulus-pallet-weight-reclaim call the storage_proof_size host function during extrinsic dispatch. With execute-block or follow-chain, any block that contains a signed extrinsic then fails with: Execution aborted due to trap: call to a missing function env:ext_storage_proof_size_storage_proof_size_version_1 All current system-chain runtimes (polkadot-sdk and fellowship) use that pallet, so the two commands were unusable against them. Fix: register the cumulus proof-size host function next to the substrate ones. It returns u64::MAX when no proof recording is active, which weight-reclaim treats as disabled - correct for try-runtime use. --- Cargo.lock | 1 + Cargo.toml | 1 + cli/Cargo.toml | 1 + cli/main.rs | 5 ++++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 0b1a929edd3..f341586d2c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19010,6 +19010,7 @@ version = "0.10.1" dependencies = [ "assert_cmd", "clap", + "cumulus-primitives-proof-size-hostfunction", "env_logger", "frame-remote-externalities", "frame-support", diff --git a/Cargo.toml b/Cargo.toml index 12dcb4d05dc..4b222a5cf4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,6 +72,7 @@ substrate-rpc-client = { version = "~0.33", git = "https://github.com/paritytech polkadot-primitives = { version = "~7.0", git = "https://github.com/paritytech/polkadot-sdk", rev = "e1c5425b23f1" } cumulus-primitives-parachain-inherent = { version = "~0.7", git = "https://github.com/paritytech/polkadot-sdk", rev = "e1c5425b23f1" } cumulus-primitives-core = { version = "~0.7", git = "https://github.com/paritytech/polkadot-sdk", rev = "e1c5425b23f1" } +cumulus-primitives-proof-size-hostfunction = { version = "~0.2", git = "https://github.com/paritytech/polkadot-sdk", rev = "e1c5425b23f1" } cumulus-client-parachain-inherent = { version = "~0.1", git = "https://github.com/paritytech/polkadot-sdk", rev = "e1c5425b23f1" } # Local diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 25e5ca5caa5..cf4608cf396 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -22,6 +22,7 @@ parity-scale-codec = { workspace = true, features = ["derive"] } tokio = { workspace = true, features = ["full"] } sp-io = { workspace = true } +cumulus-primitives-proof-size-hostfunction = { workspace = true } sp-core = { workspace = true } sp-runtime = { workspace = true } sp-state-machine = { workspace = true } diff --git a/cli/main.rs b/cli/main.rs index f0fbde3c6d0..0e8b7d6ec86 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -360,7 +360,10 @@ async fn main() { init_env(); let cmd = TryRuntime::parse(); - cmd.run::, OpaqueExtrinsic>, sp_io::SubstrateHostFunctions>() + cmd.run::, OpaqueExtrinsic>, ( + sp_io::SubstrateHostFunctions, + cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions, + )>() .await .unwrap(); } From 442adb679a915d7c359ff249efd32420e7f15c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Mon, 10 Aug 2026 13:59:09 +0000 Subject: [PATCH 2/3] Apply rustfmt --- cli/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/main.rs b/cli/main.rs index 0e8b7d6ec86..e1d71a801f9 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -364,6 +364,6 @@ async fn main() { sp_io::SubstrateHostFunctions, cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions, )>() - .await - .unwrap(); + .await + .unwrap(); } From 335bcc22a4e6f948d45e06b75fc78747cb4313ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Mon, 10 Aug 2026 13:59:47 +0000 Subject: [PATCH 3/3] Document why the proof-size host function is registered --- cli/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/main.rs b/cli/main.rs index e1d71a801f9..45ee153b8e7 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -360,6 +360,11 @@ async fn main() { init_env(); let cmd = TryRuntime::parse(); + // The cumulus `storage_proof_size` host function must be registered in addition to the + // substrate ones: runtimes built with `cumulus-pallet-weight-reclaim` (all current system + // chains) call it during the dispatch of every signed extrinsic, and block execution traps + // with "call to a missing function" if it is absent. Without proof recording (the case + // here) it returns `u64::MAX`, which weight-reclaim interprets as "recording disabled". cmd.run::, OpaqueExtrinsic>, ( sp_io::SubstrateHostFunctions, cumulus_primitives_proof_size_hostfunction::storage_proof_size::HostFunctions,