From 5f3f06facedd579760c25adadce04077974e12b6 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Tue, 9 Sep 2025 16:26:36 +0200 Subject: [PATCH 01/15] Add storage weight reclaim to Kusama system chains --- CHANGELOG.md | 4 ++ Cargo.lock | 41 ++++++++++++ Cargo.toml | 1 + .../asset-hubs/asset-hub-kusama/Cargo.toml | 3 + .../asset-hubs/asset-hub-kusama/src/lib.rs | 12 +++- .../weights/cumulus_pallet_weight_reclaim.rs | 59 ++++++++++++++++ .../asset-hub-kusama/src/weights/mod.rs | 1 + .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 3 + .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 10 ++- .../weights/cumulus_pallet_weight_reclaim.rs | 59 ++++++++++++++++ .../bridge-hub-kusama/src/weights/mod.rs | 1 + .../coretime/coretime-kusama/Cargo.toml | 3 + .../coretime/coretime-kusama/src/lib.rs | 10 ++- .../weights/cumulus_pallet_weight_reclaim.rs | 67 +++++++++++++++++++ .../coretime-kusama/src/weights/mod.rs | 1 + 15 files changed, 268 insertions(+), 7 deletions(-) create mode 100644 system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs create mode 100644 system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs create mode 100644 system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d0746c842..3821f95bcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). 🚨 For DOT|KSM cross-chain transfers please use `transfer_assets_using_type_and_then` or `execute`. Please see this [Polkadot forum post](https://forum.polkadot.network/t/mandatory-action-guide-for-ahm-broken-native-crosschain-transfers/) for more details. +### Added + +- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality + ## [1.7.1] 28.08.2025 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 100ba2389b..e834631092 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -874,6 +874,7 @@ dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", @@ -2059,6 +2060,7 @@ dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", @@ -3025,6 +3027,7 @@ dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", @@ -3538,6 +3541,26 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "cumulus-pallet-weight-reclaim" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e769fee4f1778fcbb3b4de3a17f94387c5615825276a472d5a95cd6091f56547" +dependencies = [ + "cumulus-primitives-storage-weight-reclaim", + "derive-where", + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-trie", +] + [[package]] name = "cumulus-pallet-xcm" version = "0.21.0" @@ -3635,6 +3658,24 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "cumulus-primitives-storage-weight-reclaim" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f87007f38c71a72af40dfedb22288220e1ffa54ec06c53640a27c6b5a77938" +dependencies = [ + "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "cumulus-primitives-utility" version = "0.22.0" diff --git a/Cargo.toml b/Cargo.toml index eaf9f7ec71..cea56bffca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,6 +60,7 @@ cumulus-pallet-parachain-system = { version = "0.22.0", default-features = false cumulus-pallet-session-benchmarking = { version = "23.0.0", default-features = false } cumulus-pallet-xcm = { version = "0.21.0", default-features = false } cumulus-pallet-xcmp-queue = { version = "0.22.1", default-features = false } +cumulus-pallet-weight-reclaim = { version = "0.4.0", default-features = false } cumulus-primitives-aura = { version = "0.19.0", default-features = false } cumulus-primitives-core = { version = "0.20.0", default-features = false } cumulus-primitives-utility = { version = "0.22.0", default-features = false } diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 52a4db7504..3b67100c8e 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -120,6 +120,7 @@ xcm-runtime-apis = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } +cumulus-pallet-weight-reclaim = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } @@ -154,6 +155,7 @@ runtime-benchmarks = [ "bp-bridge-hub-polkadot/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-weight-reclaim/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", @@ -296,6 +298,7 @@ std = [ "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-weight-reclaim/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 383966fbc9..de2d9c9fcd 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -1560,6 +1560,10 @@ impl pallet_society::Config for Runtime { type BlockNumberProvider = RelaychainDataProvider; } +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime @@ -1574,6 +1578,7 @@ construct_runtime!( Preimage: pallet_preimage = 6, Scheduler: pallet_scheduler = 7, Parameters: pallet_parameters = 8, + WeightReclaim: cumulus_pallet_weight_reclaim = 9, // Monetary stuff. Balances: pallet_balances = 10, @@ -1657,7 +1662,7 @@ pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; /// The TransactionExtension to the basic transaction logic. -pub type TxExtension = ( +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, @@ -1667,7 +1672,7 @@ pub type TxExtension = ( frame_system::CheckWeight, pallet_asset_conversion_tx_payment::ChargeAssetTxPayment, frame_metadata_hash_extension::CheckMetadataHash, -); +)>; /// Default extensions applied to Ethereum transactions. #[derive(Clone, PartialEq, Eq, Debug)] @@ -1688,7 +1693,7 @@ impl EthExtra for EthExtraImpl { frame_system::CheckWeight::::new(), pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::::from(tip, None), frame_metadata_hash_extension::CheckMetadataHash::::new(false), - ) + ).into() } } @@ -1836,6 +1841,7 @@ mod benches { [pallet_transaction_payment, TransactionPayment] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_parachain_system, ParachainSystem] + [cumulus_pallet_weight_reclaim, WeightReclaim] [cumulus_pallet_xcmp_queue, XcmpQueue] [pallet_conviction_voting, ConvictionVoting] [pallet_referenda, Referenda] diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs new file mode 100644 index 0000000000..8a9253ba68 --- /dev/null +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -0,0 +1,59 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `cumulus_pallet_weight_reclaim` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/release/wbuild/asset-hub-kusama-runtime/asset_hub_kusama_runtime.wasm +// --pallet=cumulus_pallet_weight_reclaim +// --header=.github/scripts/cmd/file_header.txt +// --output=./system-parachains/asset-hubs/asset-hub-kusama/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_weight_reclaim`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { + fn storage_weight_reclaim() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_770_000 picoseconds. + Weight::from_parts(6_022_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } +} diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/mod.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/mod.rs index 58c4f3ed73..5c85ac77b6 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/mod.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/mod.rs @@ -16,6 +16,7 @@ pub mod block_weights; pub mod cumulus_pallet_parachain_system; +pub mod cumulus_pallet_weight_reclaim; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index 4449f71760..c38bc74e4f 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -76,6 +76,7 @@ xcm-runtime-apis = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } +cumulus-pallet-weight-reclaim = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } @@ -133,6 +134,7 @@ std = [ "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-weight-reclaim/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", @@ -206,6 +208,7 @@ runtime-benchmarks = [ "bridge-runtime-common/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-weight-reclaim/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index a185e9e705..4c4a78ee41 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -110,7 +110,7 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The `TransactionExtension` to the basic transaction logic. -pub type TxExtension = ( +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, @@ -122,7 +122,7 @@ pub type TxExtension = ( BridgeRejectObsoleteHeadersAndMessages, bridge_to_polkadot_config::OnBridgeHubPolkadotRefundBridgeHubKusamaMessages, frame_metadata_hash_extension::CheckMetadataHash, -); +)>; bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! { RuntimeCall, AccountId, @@ -394,6 +394,10 @@ impl pallet_message_queue::Config for Runtime { impl cumulus_pallet_aura_ext::Config for Runtime {} +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + parameter_types! { // Fellows pluralistic body. pub const FellowsBodyId: BodyId = BodyId::Technical; @@ -539,6 +543,7 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system = 1, Timestamp: pallet_timestamp = 2, ParachainInfo: parachain_info = 3, + WeightReclaim: cumulus_pallet_weight_reclaim = 4, // Monetary stuff. Balances: pallet_balances = 10, @@ -597,6 +602,7 @@ mod benches { [pallet_transaction_payment, TransactionPayment] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_parachain_system, ParachainSystem] + [cumulus_pallet_weight_reclaim, WeightReclaim] [cumulus_pallet_xcmp_queue, XcmpQueue] // XCM [pallet_xcm, PalletXcmExtrinsicsBenchmark::] diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs new file mode 100644 index 0000000000..52cf8fb3e5 --- /dev/null +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -0,0 +1,59 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `cumulus_pallet_weight_reclaim` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/release/wbuild/bridge-hub-kusama-runtime/bridge_hub_kusama_runtime.wasm +// --pallet=cumulus_pallet_weight_reclaim +// --header=.github/scripts/cmd/file_header.txt +// --output=./system-parachains/bridge-hubs/bridge-hub-kusama/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_weight_reclaim`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { + fn storage_weight_reclaim() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_551_000 picoseconds. + Weight::from_parts(5_751_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } +} diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index 2a83d0fc78..44352be876 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -26,6 +26,7 @@ use frame_support::weights::Weight; pub mod block_weights; pub mod cumulus_pallet_parachain_system; +pub mod cumulus_pallet_weight_reclaim; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; diff --git a/system-parachains/coretime/coretime-kusama/Cargo.toml b/system-parachains/coretime/coretime-kusama/Cargo.toml index f6dbbbfeda..ac996dafda 100644 --- a/system-parachains/coretime/coretime-kusama/Cargo.toml +++ b/system-parachains/coretime/coretime-kusama/Cargo.toml @@ -69,6 +69,7 @@ xcm-runtime-apis = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } +cumulus-pallet-weight-reclaim = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-aura = { workspace = true } @@ -91,6 +92,7 @@ std = [ "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-weight-reclaim/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", @@ -152,6 +154,7 @@ std = [ runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-weight-reclaim/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index b243f5210b..cf9d9d1347 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -99,7 +99,7 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The `TransactionExtension` to the basic transaction logic. -pub type TxExtensions = ( +pub type TxExtensions = cumulus_pallet_weight_reclaim::StorageWeightReclaim, frame_system::CheckSpecVersion, frame_system::CheckTxVersion, @@ -109,7 +109,7 @@ pub type TxExtensions = ( frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, frame_metadata_hash_extension::CheckMetadataHash, -); +)>; /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = @@ -372,6 +372,10 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + /// Privileged origin that represents Root or Fellows pluralistic body. pub type RootOrFellows = EitherOfDiverse< EnsureRoot, @@ -657,6 +661,7 @@ construct_runtime!( ParachainSystem: cumulus_pallet_parachain_system = 1, Timestamp: pallet_timestamp = 3, ParachainInfo: parachain_info = 4, + WeightReclaim: cumulus_pallet_weight_reclaim = 5, // Monetary stuff. Balances: pallet_balances = 10, @@ -696,6 +701,7 @@ mod benches { [frame_system, SystemBench::] [frame_system_extensions, SystemExtensionsBench::] [cumulus_pallet_parachain_system, ParachainSystem] + [cumulus_pallet_weight_reclaim, WeightReclaim] [pallet_timestamp, Timestamp] [pallet_balances, Balances] [pallet_broker, Broker] diff --git a/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs new file mode 100644 index 0000000000..8a077ede9c --- /dev/null +++ b/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -0,0 +1,67 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `cumulus_pallet_weight_reclaim` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/release/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm +// --pallet=cumulus_pallet_weight_reclaim +// --header=.github/scripts/cmd/file_header.txt +// --output=./system-parachains/coretime/coretime-kusama/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_weight_reclaim`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { + /// Storage: `System::BlockWeight` (r:1 w:1) + /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) + /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `System::AllExtrinsicsLen` (r:1 w:0) + /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn storage_weight_reclaim() -> Weight { + // Proof Size summary in bytes: + // Measured: `24` + // Estimated: `1533` + // Minimum execution time: 6_863_000 picoseconds. + Weight::from_parts(7_114_000, 0) + .saturating_add(Weight::from_parts(0, 1533)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/system-parachains/coretime/coretime-kusama/src/weights/mod.rs b/system-parachains/coretime/coretime-kusama/src/weights/mod.rs index 15b1a398ec..df006b51a4 100644 --- a/system-parachains/coretime/coretime-kusama/src/weights/mod.rs +++ b/system-parachains/coretime/coretime-kusama/src/weights/mod.rs @@ -18,6 +18,7 @@ pub mod block_weights; pub mod cumulus_pallet_parachain_system; +pub mod cumulus_pallet_weight_reclaim; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; From 5074d62806bf100436e8b1d6d9fa1cabfb71854c Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Wed, 1 Oct 2025 17:34:17 +0200 Subject: [PATCH 02/15] fmt + test fixes --- .../asset-hubs/asset-hub-kusama/src/lib.rs | 30 +++++++++++-------- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 29 ++++++++++-------- .../bridge-hub-kusama/tests/tests.rs | 2 +- .../coretime/coretime-kusama/src/lib.rs | 25 +++++++++------- 4 files changed, 48 insertions(+), 38 deletions(-) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index de2d9c9fcd..748fbd8e1b 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -1578,7 +1578,7 @@ construct_runtime!( Preimage: pallet_preimage = 6, Scheduler: pallet_scheduler = 7, Parameters: pallet_parameters = 8, - WeightReclaim: cumulus_pallet_weight_reclaim = 9, + WeightReclaim: cumulus_pallet_weight_reclaim = 9, // Monetary stuff. Balances: pallet_balances = 10, @@ -1662,17 +1662,20 @@ pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; /// The TransactionExtension to the basic transaction logic. -pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_asset_conversion_tx_payment::ChargeAssetTxPayment, - frame_metadata_hash_extension::CheckMetadataHash, -)>; +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_asset_conversion_tx_payment::ChargeAssetTxPayment, + frame_metadata_hash_extension::CheckMetadataHash, + ), +>; /// Default extensions applied to Ethereum transactions. #[derive(Clone, PartialEq, Eq, Debug)] @@ -1693,7 +1696,8 @@ impl EthExtra for EthExtraImpl { frame_system::CheckWeight::::new(), pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::::from(tip, None), frame_metadata_hash_extension::CheckMetadataHash::::new(false), - ).into() + ) + .into() } } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 4c4a78ee41..b29919fbd5 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -110,19 +110,22 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The `TransactionExtension` to the basic transaction logic. -pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - BridgeRejectObsoleteHeadersAndMessages, - bridge_to_polkadot_config::OnBridgeHubPolkadotRefundBridgeHubKusamaMessages, - frame_metadata_hash_extension::CheckMetadataHash, -)>; +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, + BridgeRejectObsoleteHeadersAndMessages, + bridge_to_polkadot_config::OnBridgeHubPolkadotRefundBridgeHubKusamaMessages, + frame_metadata_hash_extension::CheckMetadataHash, + ), +>; bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! { RuntimeCall, AccountId, diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs index e4939ae00b..99157d1bcd 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs @@ -99,7 +99,7 @@ fn construct_extrinsic( BridgeRejectObsoleteHeadersAndMessages, (OnBridgeHubPolkadotRefundBridgeHubKusamaMessages::default()), frame_metadata_hash_extension::CheckMetadataHash::::new(false), - ); + ).into(); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); UncheckedExtrinsic::new_signed(call, account_id.into(), Signature::Sr25519(signature), extra) diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index cf9d9d1347..1c6431cfef 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -99,17 +99,20 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The `TransactionExtension` to the basic transaction logic. -pub type TxExtensions = cumulus_pallet_weight_reclaim::StorageWeightReclaim, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - frame_metadata_hash_extension::CheckMetadataHash, -)>; +pub type TxExtensions = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, + ), +>; /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = From fa6ecb756f8c4f01c3838b4c3844bd176cc8684e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Oct 2025 07:15:29 +0000 Subject: [PATCH 03/15] Update from skunert running command 'fmt' --- system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs index 99157d1bcd..2f80fac8f7 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs @@ -99,7 +99,8 @@ fn construct_extrinsic( BridgeRejectObsoleteHeadersAndMessages, (OnBridgeHubPolkadotRefundBridgeHubKusamaMessages::default()), frame_metadata_hash_extension::CheckMetadataHash::::new(false), - ).into(); + ) + .into(); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); UncheckedExtrinsic::new_signed(call, account_id.into(), Signature::Sr25519(signature), extra) From bc650202526d46333395cddd40ed36f56bf52026 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Oct 2025 17:46:36 +0000 Subject: [PATCH 04/15] Update from skunert running command 'bench --runtime asset-hub-kusama bridge-hub-kusama coretime-kusama --pallet cumulus_pallet_weight_reclaim' --- .../src/weights/cumulus_pallet_weight_reclaim.rs | 14 +++++++------- .../src/weights/cumulus_pallet_weight_reclaim.rs | 14 +++++++------- .../src/weights/cumulus_pallet_weight_reclaim.rs | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs index 8a9253ba68..c4fb690b20 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 +//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -28,9 +28,9 @@ // benchmark // pallet // --extrinsic=* -// --runtime=target/release/wbuild/asset-hub-kusama-runtime/asset_hub_kusama_runtime.wasm +// --runtime=target/production/wbuild/asset-hub-kusama-runtime/asset_hub_kusama_runtime.wasm // --pallet=cumulus_pallet_weight_reclaim -// --header=.github/scripts/cmd/file_header.txt +// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt // --output=./system-parachains/asset-hubs/asset-hub-kusama/src/weights // --wasm-execution=compiled // --steps=50 @@ -52,8 +52,8 @@ impl cumulus_pallet_weight_reclaim::WeightInfo for Weig // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_770_000 picoseconds. - Weight::from_parts(6_022_000, 0) + // Minimum execution time: 14_579_000 picoseconds. + Weight::from_parts(21_110_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs index 52cf8fb3e5..0766c1ed90 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 +//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -28,9 +28,9 @@ // benchmark // pallet // --extrinsic=* -// --runtime=target/release/wbuild/bridge-hub-kusama-runtime/bridge_hub_kusama_runtime.wasm +// --runtime=target/production/wbuild/bridge-hub-kusama-runtime/bridge_hub_kusama_runtime.wasm // --pallet=cumulus_pallet_weight_reclaim -// --header=.github/scripts/cmd/file_header.txt +// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt // --output=./system-parachains/bridge-hubs/bridge-hub-kusama/src/weights // --wasm-execution=compiled // --steps=50 @@ -52,8 +52,8 @@ impl cumulus_pallet_weight_reclaim::WeightInfo for Weig // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_551_000 picoseconds. - Weight::from_parts(5_751_000, 0) + // Minimum execution time: 11_610_000 picoseconds. + Weight::from_parts(12_400_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs index 8a077ede9c..fe8c92ed7e 100644 --- a/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 +//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -28,9 +28,9 @@ // benchmark // pallet // --extrinsic=* -// --runtime=target/release/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm +// --runtime=target/production/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm // --pallet=cumulus_pallet_weight_reclaim -// --header=.github/scripts/cmd/file_header.txt +// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt // --output=./system-parachains/coretime/coretime-kusama/src/weights // --wasm-execution=compiled // --steps=50 @@ -58,8 +58,8 @@ impl cumulus_pallet_weight_reclaim::WeightInfo for Weig // Proof Size summary in bytes: // Measured: `24` // Estimated: `1533` - // Minimum execution time: 6_863_000 picoseconds. - Weight::from_parts(7_114_000, 0) + // Minimum execution time: 13_270_000 picoseconds. + Weight::from_parts(14_210_000, 0) .saturating_add(Weight::from_parts(0, 1533)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) From 7db4745bb4d480a0a618d1d87df8353e5e8186e3 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Mon, 6 Oct 2025 09:28:06 +0200 Subject: [PATCH 05/15] Changelog update --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3821f95bcb..13ff656a38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Added + +- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality + ## [1.9.1] 30.09.2025 ### Fixed @@ -26,10 +32,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). 🚨 For DOT|KSM cross-chain transfers please use `transfer_assets_using_type_and_then` or `execute`. Please see this [Polkadot forum post](https://forum.polkadot.network/t/mandatory-action-guide-for-ahm-broken-native-crosschain-transfers/) for more details. -### Added - -- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality - ## [1.7.1] 28.08.2025 ### Fixed From 3042bf50d7637d9c9c254e36de0c2ebc846ed32b Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Wed, 8 Oct 2025 14:59:12 +0200 Subject: [PATCH 06/15] Add try-runtime flag --- system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml | 1 + system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml | 1 + system-parachains/coretime/coretime-kusama/Cargo.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 3b67100c8e..451ea0e644 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -228,6 +228,7 @@ try-runtime = [ "assets-common/try-runtime", "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-weight-reclaim/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", "frame-election-provider-support/try-runtime", diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index c38bc74e4f..50b2d09609 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -246,6 +246,7 @@ runtime-benchmarks = [ try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-weight-reclaim/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", diff --git a/system-parachains/coretime/coretime-kusama/Cargo.toml b/system-parachains/coretime/coretime-kusama/Cargo.toml index ac996dafda..2d7ffd0b9c 100644 --- a/system-parachains/coretime/coretime-kusama/Cargo.toml +++ b/system-parachains/coretime/coretime-kusama/Cargo.toml @@ -188,6 +188,7 @@ runtime-benchmarks = [ try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-weight-reclaim/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", From b45889d36677599b387c43087c38a9906cd70182 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Thu, 9 Oct 2025 09:32:22 +0200 Subject: [PATCH 07/15] Add to people-kusama too --- Cargo.lock | 1 + .../people/people-kusama/Cargo.toml | 4 +++ .../people/people-kusama/src/lib.rs | 31 ++++++++++++------- .../people/people-kusama/src/weights/mod.rs | 1 + 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e834631092..17f0a0d492 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10760,6 +10760,7 @@ dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", diff --git a/system-parachains/people/people-kusama/Cargo.toml b/system-parachains/people/people-kusama/Cargo.toml index 09f8fedc44..8efb38eb36 100644 --- a/system-parachains/people/people-kusama/Cargo.toml +++ b/system-parachains/people/people-kusama/Cargo.toml @@ -69,6 +69,7 @@ cumulus-primitives-aura = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } cumulus-pallet-session-benchmarking = { workspace = true } +cumulus-pallet-weight-reclaim = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-core = { workspace = true } @@ -91,6 +92,7 @@ std = [ "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", "cumulus-pallet-session-benchmarking/std", + "cumulus-pallet-weight-reclaim/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", @@ -154,6 +156,7 @@ std = [ runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-weight-reclaim/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", @@ -189,6 +192,7 @@ runtime-benchmarks = [ try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-weight-reclaim/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index ed4c6f6c98..b7a1504b1f 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -117,17 +117,20 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The TransactionExtension to the basic transaction logic. -pub type TxExtension = ( - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - frame_metadata_hash_extension::CheckMetadataHash, -); +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, + ), +>; /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = @@ -313,6 +316,10 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< UNINCLUDED_SEGMENT_CAPACITY, >; +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = (); +} + parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; @@ -634,6 +641,7 @@ construct_runtime!( Timestamp: pallet_timestamp = 2, ParachainInfo: parachain_info = 3, MultiBlockMigrations: pallet_migrations = 4, + WeightReclaim: cumulus_pallet_weight_reclaim = 5, // Monetary stuff. Balances: pallet_balances = 10, @@ -685,6 +693,7 @@ mod benches { [pallet_utility, Utility] // Cumulus [cumulus_pallet_parachain_system, ParachainSystem] + [cumulus_pallet_weight_reclaim, WeightReclaim] [cumulus_pallet_xcmp_queue, XcmpQueue] [pallet_collator_selection, CollatorSelection] // XCM diff --git a/system-parachains/people/people-kusama/src/weights/mod.rs b/system-parachains/people/people-kusama/src/weights/mod.rs index fa7f8c108d..329738c2de 100644 --- a/system-parachains/people/people-kusama/src/weights/mod.rs +++ b/system-parachains/people/people-kusama/src/weights/mod.rs @@ -17,6 +17,7 @@ pub mod block_weights; pub mod cumulus_pallet_parachain_system; +pub mod cumulus_pallet_weight_reclaim; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; From 76dea5f37044aeabaf7bb0cfe55ed3f12e781de2 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Thu, 9 Oct 2025 10:00:41 +0200 Subject: [PATCH 08/15] Add to people-kusama weight --- Cargo.lock | 14 ++-- .../people/people-kusama/src/lib.rs | 2 +- .../weights/cumulus_pallet_weight_reclaim.rs | 67 +++++++++++++++++++ 3 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs diff --git a/Cargo.lock b/Cargo.lock index 17f0a0d492..2cdcb21282 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3855,7 +3855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] @@ -4503,9 +4503,9 @@ dependencies = [ [[package]] name = "encointer-primitives" -version = "20.5.0" +version = "20.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fd87346c56bb7b2034bbecae6a40e604f62b357aff07e482f343be1f11f37c" +checksum = "fc7e044392be671ef64d5f0924bf07b37b33876bf098599a104887910b6f82ec" dependencies = [ "bs58", "crc", @@ -9222,9 +9222,9 @@ dependencies = [ [[package]] name = "pallet-encointer-democracy" -version = "20.6.0" +version = "20.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d9dc656fbebbf9f59591642d6f23470d8a912882bcaefc7582659e936aade68" +checksum = "3253d5e8d9b37348e13e415528cb7588f0623909bda30fe5816e4c07db78f9e3" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -9311,9 +9311,9 @@ dependencies = [ [[package]] name = "pallet-encointer-treasuries" -version = "20.7.0" +version = "20.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884fc4e531d51ffc69c20d1a0d8695fd28497080df2d6be4d839cdf2c70e7d1d" +checksum = "4c7744026a0e76fb82e9c766fd8aa055a01235b45a61e73d248d5e01d0c56d39" dependencies = [ "approx", "encointer-primitives", diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index b7a1504b1f..a512e65563 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -317,7 +317,7 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< >; impl cumulus_pallet_weight_reclaim::Config for Runtime { - type WeightInfo = (); + type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; } parameter_types! { diff --git a/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs new file mode 100644 index 0000000000..fe8c92ed7e --- /dev/null +++ b/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -0,0 +1,67 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `cumulus_pallet_weight_reclaim` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 +//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm +// --pallet=cumulus_pallet_weight_reclaim +// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt +// --output=./system-parachains/coretime/coretime-kusama/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_weight_reclaim`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { + /// Storage: `System::BlockWeight` (r:1 w:1) + /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) + /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `System::AllExtrinsicsLen` (r:1 w:0) + /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn storage_weight_reclaim() -> Weight { + // Proof Size summary in bytes: + // Measured: `24` + // Estimated: `1533` + // Minimum execution time: 13_270_000 picoseconds. + Weight::from_parts(14_210_000, 0) + .saturating_add(Weight::from_parts(0, 1533)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} From c3cbf757b3cd3e2ce458eb3df4b738939dfbd2bf Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 9 Oct 2025 09:41:18 +0000 Subject: [PATCH 09/15] Update from skunert running command 'bench --runtime people-kusama --pallet cumulus_pallet_weight_reclaim' --- .../weights/cumulus_pallet_weight_reclaim.rs | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs index fe8c92ed7e..f96c5944a1 100644 --- a/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/people/people-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 -//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 51.0.0 +//! DATE: 2025-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` +//! HOSTNAME: `8c1119ba3ddd`, CPU: `QEMU Virtual CPU version 2.5+` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -28,10 +28,10 @@ // benchmark // pallet // --extrinsic=* -// --runtime=target/production/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm +// --runtime=target/production/wbuild/people-kusama-runtime/people_kusama_runtime.wasm // --pallet=cumulus_pallet_weight_reclaim // --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt -// --output=./system-parachains/coretime/coretime-kusama/src/weights +// --output=./system-parachains/people/people-kusama/src/weights // --wasm-execution=compiled // --steps=50 // --repeat=20 @@ -48,20 +48,12 @@ use core::marker::PhantomData; /// Weight functions for `cumulus_pallet_weight_reclaim`. pub struct WeightInfo(PhantomData); impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) - /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `System::AllExtrinsicsLen` (r:1 w:0) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn storage_weight_reclaim() -> Weight { // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 13_270_000 picoseconds. - Weight::from_parts(14_210_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_690_000 picoseconds. + Weight::from_parts(11_179_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } } From 0aea826c42ca706669939b67d416942d5b55a289 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Thu, 9 Oct 2025 12:23:22 +0200 Subject: [PATCH 10/15] Add to encointer weight --- Cargo.lock | 1 + system-parachains/encointer/Cargo.toml | 4 ++ system-parachains/encointer/src/lib.rs | 31 ++++++--- .../weights/cumulus_pallet_weight_reclaim.rs | 67 +++++++++++++++++++ .../encointer/src/weights/mod.rs | 1 + 5 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs diff --git a/Cargo.lock b/Cargo.lock index eb1b4ce28a..88f0a5452f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4406,6 +4406,7 @@ dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", "cumulus-pallet-session-benchmarking", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", diff --git a/system-parachains/encointer/Cargo.toml b/system-parachains/encointer/Cargo.toml index d4499d2a4b..156a5ba06b 100644 --- a/system-parachains/encointer/Cargo.toml +++ b/system-parachains/encointer/Cargo.toml @@ -95,6 +95,7 @@ xcm-runtime-apis = { workspace = true } cumulus-pallet-aura-ext = { workspace = true } cumulus-pallet-parachain-system = { workspace = true } cumulus-pallet-session-benchmarking = { optional = true, workspace = true } +cumulus-pallet-weight-reclaim = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-aura = { workspace = true } @@ -121,6 +122,7 @@ default = ["std"] runtime-benchmarks = [ "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-weight-reclaim/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", "cumulus-primitives-utility/runtime-benchmarks", @@ -170,6 +172,7 @@ std = [ "cumulus-pallet-aura-ext/std", "cumulus-pallet-parachain-system/std", "cumulus-pallet-session-benchmarking?/std", + "cumulus-pallet-weight-reclaim/std", "cumulus-pallet-xcm/std", "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", @@ -254,6 +257,7 @@ std = [ try-runtime = [ "cumulus-pallet-aura-ext/try-runtime", "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-weight-reclaim/try-runtime", "cumulus-pallet-xcm/try-runtime", "cumulus-pallet-xcmp-queue/try-runtime", "encointer-balances-tx-payment/try-runtime", diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index b39eb65f48..e1d0c6806d 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -438,6 +438,10 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + parameter_types! { pub const ExecutiveBody: BodyId = BodyId::Executive; /// The asset ID for the asset that we use to pay for message delivery fees. @@ -805,6 +809,7 @@ construct_runtime! { RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip = 2, Timestamp: pallet_timestamp = 3, ParachainInfo: parachain_info = 4, + WeightReclaim: cumulus_pallet_weight_reclaim = 5, // Monetary stuff. Balances: pallet_balances = 10, @@ -891,17 +896,20 @@ pub type SignedBlock = generic::SignedBlock; /// BlockId type as expected by this runtime. pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. -pub type TxExtension = ( - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_asset_tx_payment::ChargeAssetTxPayment, - frame_metadata_hash_extension::CheckMetadataHash, -); +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_asset_tx_payment::ChargeAssetTxPayment, + frame_metadata_hash_extension::CheckMetadataHash, + ), +>; /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; @@ -965,6 +973,7 @@ mod benches { [pallet_encointer_scheduler, EncointerScheduler] [pallet_encointer_treasuries, EncointerTreasuries] [cumulus_pallet_parachain_system, ParachainSystem] + [cumulus_pallet_weight_reclaim, WeightReclaim] [cumulus_pallet_xcmp_queue, XcmpQueue] // XCM [pallet_xcm, PalletXcmExtrinsicsBenchmark::] diff --git a/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs new file mode 100644 index 0000000000..fe8c92ed7e --- /dev/null +++ b/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs @@ -0,0 +1,67 @@ +// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md +// for a list of specific contributors. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `cumulus_pallet_weight_reclaim` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 +//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// frame-omni-bencher +// v1 +// benchmark +// pallet +// --extrinsic=* +// --runtime=target/production/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm +// --pallet=cumulus_pallet_weight_reclaim +// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt +// --output=./system-parachains/coretime/coretime-kusama/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `cumulus_pallet_weight_reclaim`. +pub struct WeightInfo(PhantomData); +impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { + /// Storage: `System::BlockWeight` (r:1 w:1) + /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) + /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `System::AllExtrinsicsLen` (r:1 w:0) + /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn storage_weight_reclaim() -> Weight { + // Proof Size summary in bytes: + // Measured: `24` + // Estimated: `1533` + // Minimum execution time: 13_270_000 picoseconds. + Weight::from_parts(14_210_000, 0) + .saturating_add(Weight::from_parts(0, 1533)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/system-parachains/encointer/src/weights/mod.rs b/system-parachains/encointer/src/weights/mod.rs index 4878336d04..8fd12ea50c 100644 --- a/system-parachains/encointer/src/weights/mod.rs +++ b/system-parachains/encointer/src/weights/mod.rs @@ -21,6 +21,7 @@ pub mod block_weights; pub mod cumulus_pallet_parachain_system; +pub mod cumulus_pallet_weight_reclaim; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; From 66025c133ed866821d9bee45d17af46fc55fb92b Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Fri, 10 Oct 2025 14:01:16 +0200 Subject: [PATCH 11/15] Fix whitelisted keys in coretime-kusama --- .../coretime/coretime-kusama/src/lib.rs | 14 ++------ .../weights/cumulus_pallet_weight_reclaim.rs | 33 ++++++++----------- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index 1c6431cfef..84e06bde1d 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -699,6 +699,7 @@ mod benches { use alloc::boxed::Box; use kusama_runtime_constants::system_parachain::AssetHubParaId; use system_parachains_constants::kusama::locations::AssetHubLocation; + pub use frame_support::traits::WhitelistedStorageKeys; frame_benchmarking::define_benchmarks!( [frame_system, SystemBench::] @@ -1202,18 +1203,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, alloc::string::String> { - let whitelist: Vec = vec![ - // Block Number - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), - // Total Issuance - hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), - // Execution Phase - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), - // Event Count - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), - // System Events - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), - ]; + let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); let mut batches = Vec::::new(); let params = (&config, &whitelist); diff --git a/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs index fe8c92ed7e..f86cc80336 100644 --- a/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 -//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-10-10, STEPS: `50`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` +//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -28,13 +28,14 @@ // benchmark // pallet // --extrinsic=* -// --runtime=target/production/wbuild/coretime-kusama-runtime/coretime_kusama_runtime.wasm +// --runtime=target/release/wbuild/encointer-kusama-runtime/encointer_kusama_runtime.wasm // --pallet=cumulus_pallet_weight_reclaim -// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt -// --output=./system-parachains/coretime/coretime-kusama/src/weights +// --header=./.github/scripts/cmd/file_header.txt +// --output=./system-parachains/encointer/src/weights // --wasm-execution=compiled +// --runtime-log=trace // --steps=50 -// --repeat=20 +// --repeat=5 // --heap-pages=4096 #![cfg_attr(rustfmt, rustfmt_skip)] @@ -48,20 +49,12 @@ use core::marker::PhantomData; /// Weight functions for `cumulus_pallet_weight_reclaim`. pub struct WeightInfo(PhantomData); impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) - /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `System::AllExtrinsicsLen` (r:1 w:0) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn storage_weight_reclaim() -> Weight { // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 13_270_000 picoseconds. - Weight::from_parts(14_210_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_320_000 picoseconds. + Weight::from_parts(10_740_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } } From ef20bd4f43b5761cc36603f1b1aed7a587d854f2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 10 Oct 2025 20:38:35 +0000 Subject: [PATCH 12/15] Update from skunert running command 'bench --runtime coretime-kusama encointer-kusama --pallet cumulus_pallet_weight_reclaim' --- .../weights/cumulus_pallet_weight_reclaim.rs | 24 +++++++------------ .../weights/cumulus_pallet_weight_reclaim.rs | 17 +++++++------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs index fe8c92ed7e..6f4dba1dd5 100644 --- a/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/coretime/coretime-kusama/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 50.0.0 -//! DATE: 2025-10-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 51.0.0 +//! DATE: 2025-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `e77a4c0682fd`, CPU: `QEMU Virtual CPU version 2.5+` +//! HOSTNAME: `3bb14f546ead`, CPU: `QEMU Virtual CPU version 2.5+` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -48,20 +48,12 @@ use core::marker::PhantomData; /// Weight functions for `cumulus_pallet_weight_reclaim`. pub struct WeightInfo(PhantomData); impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) - /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `System::AllExtrinsicsLen` (r:1 w:0) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn storage_weight_reclaim() -> Weight { // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 13_270_000 picoseconds. - Weight::from_parts(14_210_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_680_000 picoseconds. + Weight::from_parts(11_790_000, 0) + .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs b/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs index f86cc80336..d7a4f6019a 100644 --- a/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs +++ b/system-parachains/encointer/src/weights/cumulus_pallet_weight_reclaim.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `cumulus_pallet_weight_reclaim` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-10, STEPS: `50`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 51.0.0 +//! DATE: 2025-10-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` +//! HOSTNAME: `3bb14f546ead`, CPU: `QEMU Virtual CPU version 2.5+` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -28,14 +28,13 @@ // benchmark // pallet // --extrinsic=* -// --runtime=target/release/wbuild/encointer-kusama-runtime/encointer_kusama_runtime.wasm +// --runtime=target/production/wbuild/encointer-kusama-runtime/encointer_kusama_runtime.wasm // --pallet=cumulus_pallet_weight_reclaim -// --header=./.github/scripts/cmd/file_header.txt +// --header=/_work/fellowship-001/runtimes/runtimes/.github/scripts/cmd/file_header.txt // --output=./system-parachains/encointer/src/weights // --wasm-execution=compiled -// --runtime-log=trace // --steps=50 -// --repeat=5 +// --repeat=20 // --heap-pages=4096 #![cfg_attr(rustfmt, rustfmt_skip)] @@ -53,8 +52,8 @@ impl cumulus_pallet_weight_reclaim::WeightInfo for Weig // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_320_000 picoseconds. - Weight::from_parts(10_740_000, 0) + // Minimum execution time: 10_530_000 picoseconds. + Weight::from_parts(11_170_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } From 3816c40e2b7fb2aab8429bab8334c35b53515eee Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 12 Nov 2025 18:59:26 +0000 Subject: [PATCH 13/15] Update from skunert running command 'fmt' --- system-parachains/coretime/coretime-kusama/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index 3d17a4e8dd..be8f101503 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -693,9 +693,9 @@ construct_runtime!( mod benches { use super::*; use alloc::boxed::Box; + pub use frame_support::traits::WhitelistedStorageKeys; use kusama_runtime_constants::system_parachain::AssetHubParaId; use system_parachains_constants::kusama::locations::AssetHubLocation; - pub use frame_support::traits::WhitelistedStorageKeys; frame_benchmarking::define_benchmarks!( [frame_system, SystemBench::] From 45e1f16e8a25ed563f0336983d987ac3b8e2eb03 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Thu, 13 Nov 2025 09:03:58 +0100 Subject: [PATCH 14/15] Update CHANGELOG.md --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d2f33fb5..421298903a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Added + +- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality + ## [2.0.2] 07.11.2025 ### Fixed @@ -60,7 +66,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality - Kusama Asset Hub: add missing staking Runtime APIs and re-enable vested transfers ([polkadot-fellows/runtimes/pull/946](https://github.com/polkadot-fellows/runtimes/pull/946)) - Polkadot Asset Hub: add missing staking Runtime APIs ([polkadot-fellows/runtimes/pull/946](https://github.com/polkadot-fellows/runtimes/pull/949)) From 4ce3c40aabc4666ba110e2b41c33575854156ef5 Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Tue, 25 Nov 2025 08:35:26 +0100 Subject: [PATCH 15/15] Update CHANGELOG.md --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58abfd1717..459e9f0d00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,16 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Added + +- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality ([#941](https://github.com/polkadot-fellows/runtimes/pull/941)) + ## [2.0.3] 21.11.2025 ### Added -- Add `cumulus-pallet-weight-reclaim` to all Kusama system parachains for storage weight reclaim functionality - Set Ethereum Fulu fork epoch ([#1005](https://github.com/polkadot-fellows/runtimes/pull/1005)) ### Changed