diff --git a/Cargo.lock b/Cargo.lock index 7293934f0..70fa64ad2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15671,6 +15671,7 @@ version = "0.0.0" dependencies = [ "cumulus-pallet-aura-ext 0.20.0", "cumulus-pallet-parachain-system 0.20.0", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcmp-queue 0.20.0", "docify", "frame-support 40.1.0", @@ -15718,11 +15719,11 @@ dependencies = [ "cumulus-pallet-aura-ext 0.20.0", "cumulus-pallet-parachain-system 0.20.0", "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.19.1", "cumulus-pallet-xcmp-queue 0.20.0", "cumulus-primitives-aura 0.17.0", "cumulus-primitives-core 0.18.1", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility 0.20.0", "docify", "enumflags2", @@ -15801,11 +15802,11 @@ dependencies = [ "cumulus-pallet-aura-ext 0.20.0", "cumulus-pallet-parachain-system 0.20.0", "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.19.1", "cumulus-pallet-xcmp-queue 0.20.0", "cumulus-primitives-aura 0.17.0", "cumulus-primitives-core 0.18.1", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility 0.20.0", "docify", "enumflags2", @@ -15882,11 +15883,11 @@ dependencies = [ "cumulus-pallet-aura-ext 0.20.0", "cumulus-pallet-parachain-system 0.20.0", "cumulus-pallet-session-benchmarking 21.0.0", + "cumulus-pallet-weight-reclaim", "cumulus-pallet-xcm 0.19.1", "cumulus-pallet-xcmp-queue 0.20.0", "cumulus-primitives-aura 0.17.0", "cumulus-primitives-core 0.18.1", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility 0.20.0", "docify", "enumflags2", diff --git a/Cargo.toml b/Cargo.toml index a8c26105c..7db5d8a6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,12 +177,12 @@ cumulus-client-service = { version = "0.23.0" } cumulus-pallet-aura-ext = { version = "0.20.0", default-features = false } cumulus-pallet-parachain-system = { version = "0.20.0", default-features = false } cumulus-pallet-session-benchmarking = { version = "21.0.0", default-features = false } +cumulus-pallet-weight-reclaim = { version = "0.2.0", default-features = false } cumulus-pallet-xcm = { version = "0.19.1", default-features = false } cumulus-pallet-xcmp-queue = { version = "0.20.0", default-features = false } cumulus-primitives-aura = { version = "0.17.0", default-features = false } cumulus-primitives-core = { version = "0.18.1", default-features = false } cumulus-primitives-parachain-inherent = { version = "0.18.1" } -cumulus-primitives-storage-weight-reclaim = { version = "11.0.0", default-features = false } cumulus-primitives-utility = { version = "0.20.0", default-features = false } cumulus-relay-chain-interface = { version = "0.22.0" } emulated-integration-tests-common = { version = "20.0.0", default-features = false } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index e64946eab..1da9d871c 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -54,6 +54,7 @@ xcm-executor.workspace = true # Cumulus cumulus-pallet-aura-ext.workspace = true cumulus-pallet-parachain-system.workspace = true +cumulus-pallet-weight-reclaim.workspace = true cumulus-pallet-xcmp-queue.workspace = true pallet-collator-selection.workspace = true parachains-common.workspace = true @@ -63,6 +64,7 @@ polkadot-primitives.workspace = true [features] default = [ "std" ] runtime-benchmarks = [ + "cumulus-pallet-weight-reclaim/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", @@ -94,6 +96,7 @@ runtime-benchmarks = [ std = [ "codec/std", "cumulus-pallet-aura-ext/std", + "cumulus-pallet-weight-reclaim/std", "cumulus-pallet-xcmp-queue/std", "frame-support/std", "frame-system/std", diff --git a/runtime/common/src/weights/cumulus_pallet_weight_reclaim.rs b/runtime/common/src/weights/cumulus_pallet_weight_reclaim.rs new file mode 100644 index 000000000..1fe63c813 --- /dev/null +++ b/runtime/common/src/weights/cumulus_pallet_weight_reclaim.rs @@ -0,0 +1,49 @@ +//! Autogenerated weights for `cumulus_pallet_weight_reclaim` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.0.0 +//! DATE: 2025-02-28, STEPS: `5`, REPEAT: `5`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `tux`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("pop")`, DB CACHE: `1024` + +// Executed Command: +// ./target/release//pop-node +// benchmark +// pallet +// --template=./scripts/templates/runtime-weight-template.hbs +// --chain=pop +// --wasm-execution=compiled +// --pallet=cumulus_pallet_weight_reclaim +// --extrinsic=* +// --steps=5 +// --repeat=5 +// --output=./runtime/mainnet/src/weights/ + +#![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: 7_470_000 picoseconds. + Weight::from_parts(7_695_000, 0) + .saturating_add(Weight::from_parts(0, 1533)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} \ No newline at end of file diff --git a/runtime/common/src/weights/frame_system_extensions.rs b/runtime/common/src/weights/frame_system_extensions.rs index 5d2e82898..b5f78001f 100644 --- a/runtime/common/src/weights/frame_system_extensions.rs +++ b/runtime/common/src/weights/frame_system_extensions.rs @@ -91,4 +91,18 @@ impl frame_system::ExtensionsWeightInfo for WeightInfo< // Minimum execution time: 3_409_000 picoseconds. Weight::from_parts(3_811_000, 0) } + /// Storage: `System::ExtrinsicWeightReclaimed` (r:1 w:1) + /// Proof: `System::ExtrinsicWeightReclaimed` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `System::BlockWeight` (r:1 w:1) + /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) + fn weight_reclaim() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `1533` + // Minimum execution time: 4_890_000 picoseconds. + Weight::from_parts(5_163_000, 0) + .saturating_add(Weight::from_parts(0, 1533)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } } diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index fcb1dffd6..2d08f41f0 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -23,6 +23,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/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 29f7063a7..802277faa 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -83,11 +83,11 @@ xcm-executor.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 cumulus-primitives-core.workspace = true -cumulus-primitives-storage-weight-reclaim.workspace = true cumulus-primitives-utility.workspace = true pallet-collator-selection.workspace = true parachain-info.workspace = true @@ -112,11 +112,11 @@ 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", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "enumflags2/std", "frame-benchmarking/std", @@ -185,6 +185,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", @@ -223,6 +224,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/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index c5eb343fb..08878c640 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -98,18 +98,20 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The extension to the basic transaction logic. -pub type TxExtension = ( - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckMortality, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, - 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::CheckMortality, + 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 = @@ -299,6 +301,11 @@ impl frame_system::Config for Runtime { type Version = Version; } +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = + pop_runtime_common::weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + impl pallet_timestamp::Config for Runtime { type MinimumPeriod = ConstU64<0>; /// A timestamp: milliseconds since the unix epoch. @@ -588,6 +595,8 @@ mod runtime { pub type Timestamp = pallet_timestamp::Pallet; #[runtime::pallet_index(3)] pub type ParachainInfo = parachain_info::Pallet; + #[runtime::pallet_index(4)] + pub type WeightReclaim: cumulus_pallet_weight_reclaim::Pallet; // Monetary stuff. #[runtime::pallet_index(10)] @@ -677,6 +686,7 @@ mod benches { [pallet_collator_selection, CollatorSelection] [cumulus_pallet_parachain_system, ParachainSystem] [cumulus_pallet_xcmp_queue, XcmpQueue] + [cumulus_pallet_weight_reclaim, WeightReclaim] ); } diff --git a/runtime/mainnet/Cargo.toml b/runtime/mainnet/Cargo.toml index d56381945..9ad2c3491 100644 --- a/runtime/mainnet/Cargo.toml +++ b/runtime/mainnet/Cargo.toml @@ -81,11 +81,11 @@ 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 cumulus-primitives-core.workspace = true -cumulus-primitives-storage-weight-reclaim.workspace = true cumulus-primitives-utility.workspace = true pallet-collator-selection.workspace = true parachain-info.workspace = true @@ -106,11 +106,11 @@ 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", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "enumflags2/std", "frame-benchmarking/std", @@ -172,6 +172,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", @@ -211,6 +212,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/runtime/mainnet/src/benchmarks.rs b/runtime/mainnet/src/benchmarks.rs index 0c5f011bf..ef1e23adb 100644 --- a/runtime/mainnet/src/benchmarks.rs +++ b/runtime/mainnet/src/benchmarks.rs @@ -32,6 +32,7 @@ frame_benchmarking::define_benchmarks!( [frame_system_extensions, SystemExtensionsBench::] [cumulus_pallet_parachain_system, ParachainSystem] [pallet_timestamp, Timestamp] + [cumulus_pallet_weight_reclaim, WeightReclaim] // Monetary [pallet_balances, Balances] [pallet_transaction_payment, TransactionPayment] diff --git a/runtime/mainnet/src/config/system.rs b/runtime/mainnet/src/config/system.rs index 14fb1abdd..24aecb5b1 100644 --- a/runtime/mainnet/src/config/system.rs +++ b/runtime/mainnet/src/config/system.rs @@ -163,6 +163,10 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type XcmpMessageHandler = XcmpQueue; } +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + impl pallet_timestamp::Config for Runtime { type MinimumPeriod = ConstU64<0>; /// A timestamp: milliseconds since the unix epoch. @@ -582,6 +586,18 @@ mod tests { } } + mod weight_reclaim { + use super::*; + + #[test] + fn does_not_use_default_weights() { + assert_ne!( + TypeId::of::<::WeightInfo>(), + TypeId::of::<()>(), + ); + } + } + mod timestamp { use super::*; diff --git a/runtime/mainnet/src/lib.rs b/runtime/mainnet/src/lib.rs index 68a8b16d4..31d5d1c1c 100644 --- a/runtime/mainnet/src/lib.rs +++ b/runtime/mainnet/src/lib.rs @@ -24,7 +24,6 @@ use alloc::{borrow::Cow, vec::Vec}; pub use apis::{RuntimeApi, RUNTIME_API_VERSIONS}; use config::{monetary::deposit, system::ConsensusHook}; use cumulus_primitives_core::AggregateMessageOrigin; -use cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim; use frame_metadata_hash_extension::CheckMetadataHash; use frame_support::{ dispatch::DispatchClass, @@ -84,18 +83,20 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. -pub type TxExtension = ( - CheckNonZeroSender, - CheckSpecVersion, - CheckTxVersion, - CheckGenesis, - CheckMortality, - CheckNonce, - CheckWeight, - ChargeTransactionPayment, - StorageWeightReclaim, - CheckMetadataHash, -); +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + CheckNonZeroSender, + CheckSpecVersion, + CheckTxVersion, + CheckGenesis, + CheckMortality, + CheckNonce, + CheckWeight, + ChargeTransactionPayment, + CheckMetadataHash, + ), +>; /// EthExtra converts an unsigned Call::eth_transact into a CheckedExtrinsic. #[derive(Clone, PartialEq, Eq, Debug)] @@ -115,9 +116,9 @@ impl pallet_revive::evm::runtime::EthExtra for EthExtraImpl { CheckNonce::::from(nonce), CheckWeight::::new(), ChargeTransactionPayment::::from(tip), - StorageWeightReclaim::::new(), CheckMetadataHash::::new(false), ) + .into() } } @@ -223,6 +224,8 @@ mod runtime { pub type Timestamp = pallet_timestamp::Pallet; #[runtime::pallet_index(3)] pub type ParachainInfo = parachain_info::Pallet; + #[runtime::pallet_index(4)] + pub type WeightReclaim = cumulus_pallet_weight_reclaim::Pallet; // Monetary stuff. #[runtime::pallet_index(10)] @@ -342,32 +345,35 @@ mod tests { fn transaction_extension_checks() { assert_eq!( TypeId::of::(), - TypeId::of::<( - // Ensures sender is not the zero address. - CheckNonZeroSender, - // Ensures the runtime version included within in the transaction is the same as at - // present. - CheckSpecVersion, - // Ensures the transaction version included in the transaction is the same as at - // present. - CheckTxVersion, - // Genesis hash check to provide replay protection between different networks. - CheckGenesis, - // Checks transaction mortality. - CheckMortality, - // Nonce check and increment to give replay protection for transactions. - CheckNonce, - // Block resource (weight) limit check. - CheckWeight, - // Require the transactor pay for the transaction, optionally including a tip to - // gain additional priority in the queue. - ChargeTransactionPayment, - // Checks the size of the node-side storage proof before and after executing a - // given extrinsic. - StorageWeightReclaim, - // Extension for optionally verifying the metadata hash. - CheckMetadataHash - )>(), + TypeId::of::< + cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + // Ensures sender is not the zero address. + CheckNonZeroSender, + // Ensures the runtime version included within in the transaction is the + // same as at present. + CheckSpecVersion, + // Ensures the transaction version included in the transaction is the same + // as at present. + CheckTxVersion, + // Genesis hash check to provide replay protection between different + // networks. + CheckGenesis, + // Checks transaction mortality. + CheckMortality, + // Nonce check and increment to give replay protection for transactions. + CheckNonce, + // Block resource (weight) limit check. + CheckWeight, + // Require the transactor pay for the transaction, optionally including a + // tip to gain additional priority in the queue. + ChargeTransactionPayment, + // Extension for optionally verifying the metadata hash. + CheckMetadataHash + ), + >, + >(), ); } } diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index 051fd5099..1cae3917e 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -87,11 +87,11 @@ xcm-executor.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 cumulus-primitives-core.workspace = true -cumulus-primitives-storage-weight-reclaim.workspace = true cumulus-primitives-utility.workspace = true pallet-collator-selection.workspace = true parachain-info.workspace = true @@ -117,11 +117,11 @@ 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", "cumulus-primitives-core/std", - "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "enumflags2/std", "frame-benchmarking/std", @@ -193,6 +193,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", @@ -235,6 +236,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/runtime/testnet/src/config/system.rs b/runtime/testnet/src/config/system.rs index 04a692155..dd7c4c58e 100644 --- a/runtime/testnet/src/config/system.rs +++ b/runtime/testnet/src/config/system.rs @@ -153,6 +153,11 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type XcmpMessageHandler = XcmpQueue; } +impl cumulus_pallet_weight_reclaim::Config for Runtime { + type WeightInfo = + pop_runtime_common::weights::cumulus_pallet_weight_reclaim::WeightInfo; +} + impl pallet_timestamp::Config for Runtime { type MinimumPeriod = ConstU64<0>; /// A timestamp: milliseconds since the unix epoch. diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index d81d58307..c65919299 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -27,7 +27,6 @@ use codec::Encode; use config::system::ConsensusHook; use cumulus_pallet_parachain_system::RelayChainState; use cumulus_primitives_core::AggregateMessageOrigin; -use cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim; use frame_metadata_hash_extension::CheckMetadataHash; use frame_support::{ dispatch::{DispatchClass, DispatchInfo}, @@ -112,18 +111,20 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. -pub type TxExtension = ( - CheckNonZeroSender, - CheckSpecVersion, - CheckTxVersion, - CheckGenesis, - CheckMortality, - CheckNonce, - CheckWeight, - ChargeTransactionPayment, - StorageWeightReclaim, - CheckMetadataHash, -); +pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< + Runtime, + ( + CheckNonZeroSender, + CheckSpecVersion, + CheckTxVersion, + CheckGenesis, + CheckMortality, + CheckNonce, + CheckWeight, + ChargeTransactionPayment, + CheckMetadataHash, + ), +>; /// EthExtra converts an unsigned Call::eth_transact into a CheckedExtrinsic. #[derive(Clone, PartialEq, Eq, Debug)] @@ -143,9 +144,9 @@ impl pallet_revive::evm::runtime::EthExtra for EthExtraImpl { CheckNonce::::from(nonce), CheckWeight::::new(), ChargeTransactionPayment::::from(tip), - StorageWeightReclaim::::new(), CheckMetadataHash::::new(false), ) + .into() } } @@ -303,6 +304,8 @@ mod runtime { pub type Timestamp = pallet_timestamp::Pallet; #[runtime::pallet_index(3)] pub type ParachainInfo = parachain_info::Pallet; + #[runtime::pallet_index(4)] + pub type WeightReclaim = cumulus_pallet_weight_reclaim::Pallet; // Monetary stuff. #[runtime::pallet_index(10)] @@ -400,6 +403,7 @@ mod benches { [pallet_collator_selection, CollatorSelection] [cumulus_pallet_parachain_system, ParachainSystem] [cumulus_pallet_xcmp_queue, XcmpQueue] + [cumulus_pallet_weight_reclaim, WeightReclaim] ); }