Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
3 changes: 3 additions & 0 deletions runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
49 changes: 49 additions & 0 deletions runtime/common/src/weights/cumulus_pallet_weight_reclaim.rs
Original file line number Diff line number Diff line change
@@ -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<T>(PhantomData<T>);
impl<T: frame_system::Config> cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo<T> {
/// 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))
}
}
14 changes: 14 additions & 0 deletions runtime/common/src/weights/frame_system_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,18 @@ impl<T: frame_system::Config> 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))
}
}
1 change: 1 addition & 0 deletions runtime/common/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions runtime/devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
34 changes: 22 additions & 12 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,20 @@ pub type SignedBlock = generic::SignedBlock<Block>;
pub type BlockId = generic::BlockId<Block>;

/// The extension to the basic transaction logic.
pub type TxExtension = (
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>,
frame_system::CheckMortality<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);
pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
Runtime,
(
frame_system::CheckNonZeroSender<Runtime>,
frame_system::CheckSpecVersion<Runtime>,
frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>,
frame_system::CheckMortality<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
),
>;

/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down Expand Up @@ -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<Runtime>;
}

impl pallet_timestamp::Config for Runtime {
type MinimumPeriod = ConstU64<0>;
/// A timestamp: milliseconds since the unix epoch.
Expand Down Expand Up @@ -588,6 +595,8 @@ mod runtime {
pub type Timestamp = pallet_timestamp::Pallet<Runtime>;
#[runtime::pallet_index(3)]
pub type ParachainInfo = parachain_info::Pallet<Runtime>;
#[runtime::pallet_index(4)]
pub type WeightReclaim: cumulus_pallet_weight_reclaim::Pallet<Runtime>;

// Monetary stuff.
#[runtime::pallet_index(10)]
Expand Down Expand Up @@ -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]
);
}

Expand Down
6 changes: 4 additions & 2 deletions runtime/mainnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions runtime/mainnet/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ frame_benchmarking::define_benchmarks!(
[frame_system_extensions, SystemExtensionsBench::<Runtime>]
[cumulus_pallet_parachain_system, ParachainSystem]
[pallet_timestamp, Timestamp]
[cumulus_pallet_weight_reclaim, WeightReclaim]
// Monetary
[pallet_balances, Balances]
[pallet_transaction_payment, TransactionPayment]
Expand Down
16 changes: 16 additions & 0 deletions runtime/mainnet/src/config/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Runtime>;
}

impl pallet_timestamp::Config for Runtime {
type MinimumPeriod = ConstU64<0>;
/// A timestamp: milliseconds since the unix epoch.
Expand Down Expand Up @@ -582,6 +586,18 @@ mod tests {
}
}

mod weight_reclaim {
use super::*;

#[test]
fn does_not_use_default_weights() {
assert_ne!(
TypeId::of::<<Runtime as cumulus_pallet_weight_reclaim::Config>::WeightInfo>(),
TypeId::of::<()>(),
);
}
}

mod timestamp {
use super::*;

Expand Down
Loading
Loading