Migrate parachain swaps to Coretime (#3714)

This PR notifies broker pallet for any parachain slot swaps performed on
the relay chain. This is achieved by registering an `OnSwap` for the the
`coretime` pallet. The hook sends XCM message to the broker chain and
invokes a new extrinsic `swap_leases` which updates `Leases` storage
item (which keeps the legacy parachain leases).

I made two assumptions in this PR:
1.
[`Leases`](https://github.com/paritytech/polkadot-sdk/blob/4987d7982461e2e5ffe219cdf71ec697284cea7c/substrate/frame/broker/src/lib.rs#L120)
in `broker` pallet and
[`Leases`](https://github.com/paritytech/polkadot-sdk/blob/4987d7982461e2e5ffe219cdf71ec697284cea7c/polkadot/runtime/common/src/slots/mod.rs#L118)
in `slots` pallet are in sync.
2. `swap_leases` extrinsic from `broker` pallet can be triggered only by
root or by the XCM message from the relay chain. If not - the extrinsic
will generate an error and do nothing.

As a side effect from the changes `OnSwap` trait is moved from
runtime/common/traits.rs to runtime/parachains. Otherwise it is not
accessible from `broker` pallet.

Closes https://github.com/paritytech/polkadot-sdk/issues/3552

TODOs:

- [x] Weights
- [x] Tests

---------

Co-authored-by: command-bot <>
Co-authored-by: eskimor <eskimor@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Tsvetomir Dimitrov
2024-03-26 17:54:24 +02:00
committed by GitHub
parent fd79b3b08a
commit 90234543f3
10 changed files with 461 additions and 322 deletions
@@ -16,26 +16,24 @@
//! Autogenerated weights for `pallet_broker`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-01-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-03-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-h2rr8wx7-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// target/production/polkadot-parachain
// benchmark
// pallet
// --chain=coretime-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_broker
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_broker
// --chain=coretime-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/
@@ -56,8 +54,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_462_000 picoseconds.
Weight::from_parts(2_552_000, 0)
// Minimum execution time: 1_918_000 picoseconds.
Weight::from_parts(2_092_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -67,8 +65,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `10888`
// Estimated: `13506`
// Minimum execution time: 25_494_000 picoseconds.
Weight::from_parts(26_063_000, 0)
// Minimum execution time: 21_943_000 picoseconds.
Weight::from_parts(22_570_000, 0)
.saturating_add(Weight::from_parts(0, 13506))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -79,8 +77,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `12090`
// Estimated: `13506`
// Minimum execution time: 22_299_000 picoseconds.
Weight::from_parts(22_911_000, 0)
// Minimum execution time: 20_923_000 picoseconds.
Weight::from_parts(21_354_000, 0)
.saturating_add(Weight::from_parts(0, 13506))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -95,8 +93,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `466`
// Estimated: `1951`
// Minimum execution time: 11_590_000 picoseconds.
Weight::from_parts(12_007_000, 0)
// Minimum execution time: 10_687_000 picoseconds.
Weight::from_parts(11_409_000, 0)
.saturating_add(Weight::from_parts(0, 1951))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
@@ -124,11 +122,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `12567`
// Estimated: `14052`
// Minimum execution time: 120_928_000 picoseconds.
Weight::from_parts(124_947_252, 0)
// Minimum execution time: 111_288_000 picoseconds.
Weight::from_parts(117_804_282, 0)
.saturating_add(Weight::from_parts(0, 14052))
// Standard Error: 435
.saturating_add(Weight::from_parts(1_246, 0).saturating_mul(n.into()))
// Standard Error: 391
.saturating_add(Weight::from_parts(1_243, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(66))
}
@@ -144,8 +142,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `316`
// Estimated: `3593`
// Minimum execution time: 32_826_000 picoseconds.
Weight::from_parts(33_889_000, 0)
// Minimum execution time: 33_006_000 picoseconds.
Weight::from_parts(34_256_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
@@ -166,8 +164,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `434`
// Estimated: `4698`
// Minimum execution time: 57_362_000 picoseconds.
Weight::from_parts(58_994_000, 0)
// Minimum execution time: 61_473_000 picoseconds.
Weight::from_parts(66_476_000, 0)
.saturating_add(Weight::from_parts(0, 4698))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
@@ -178,8 +176,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `357`
// Estimated: `3550`
// Minimum execution time: 13_982_000 picoseconds.
Weight::from_parts(14_447_000, 0)
// Minimum execution time: 13_771_000 picoseconds.
Weight::from_parts(14_374_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -190,8 +188,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `357`
// Estimated: `3550`
// Minimum execution time: 15_070_000 picoseconds.
Weight::from_parts(15_735_000, 0)
// Minimum execution time: 15_162_000 picoseconds.
Weight::from_parts(15_742_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
@@ -202,8 +200,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `357`
// Estimated: `3550`
// Minimum execution time: 16_527_000 picoseconds.
Weight::from_parts(16_894_000, 0)
// Minimum execution time: 16_196_000 picoseconds.
Weight::from_parts(16_796_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(3))
@@ -220,8 +218,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `936`
// Estimated: `4681`
// Minimum execution time: 25_493_000 picoseconds.
Weight::from_parts(26_091_000, 0)
// Minimum execution time: 25_653_000 picoseconds.
Weight::from_parts(27_006_000, 0)
.saturating_add(Weight::from_parts(0, 4681))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
@@ -240,8 +238,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `1002`
// Estimated: `5996`
// Minimum execution time: 31_498_000 picoseconds.
Weight::from_parts(32_560_000, 0)
// Minimum execution time: 31_114_000 picoseconds.
Weight::from_parts(32_235_000, 0)
.saturating_add(Weight::from_parts(0, 5996))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
@@ -257,11 +255,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `652`
// Estimated: `6196 + m * (2520 ±0)`
// Minimum execution time: 57_183_000 picoseconds.
Weight::from_parts(58_024_898, 0)
// Minimum execution time: 57_280_000 picoseconds.
Weight::from_parts(58_127_480, 0)
.saturating_add(Weight::from_parts(0, 6196))
// Standard Error: 35_831
.saturating_add(Weight::from_parts(1_384_446, 0).saturating_mul(m.into()))
// Standard Error: 41_670
.saturating_add(Weight::from_parts(1_203_066, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(T::DbWeight::get().writes(5))
@@ -283,8 +281,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `215`
// Estimated: `3680`
// Minimum execution time: 59_762_000 picoseconds.
Weight::from_parts(61_114_000, 0)
// Minimum execution time: 59_968_000 picoseconds.
Weight::from_parts(62_315_000, 0)
.saturating_add(Weight::from_parts(0, 3680))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
@@ -297,8 +295,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `465`
// Estimated: `3550`
// Minimum execution time: 41_473_000 picoseconds.
Weight::from_parts(44_155_000, 0)
// Minimum execution time: 50_887_000 picoseconds.
Weight::from_parts(57_366_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
@@ -313,8 +311,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `463`
// Estimated: `3533`
// Minimum execution time: 56_672_000 picoseconds.
Weight::from_parts(58_086_000, 0)
// Minimum execution time: 84_472_000 picoseconds.
Weight::from_parts(96_536_000, 0)
.saturating_add(Weight::from_parts(0, 3533))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
@@ -331,8 +329,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `857`
// Estimated: `3593`
// Minimum execution time: 64_460_000 picoseconds.
Weight::from_parts(65_894_000, 0)
// Minimum execution time: 96_371_000 picoseconds.
Weight::from_parts(104_659_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
@@ -345,8 +343,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `957`
// Estimated: `4698`
// Minimum execution time: 37_447_000 picoseconds.
Weight::from_parts(42_318_000, 0)
// Minimum execution time: 51_741_000 picoseconds.
Weight::from_parts(54_461_000, 0)
.saturating_add(Weight::from_parts(0, 4698))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
@@ -366,8 +364,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 21_219_000 picoseconds.
Weight::from_parts(22_084_648, 0)
// Minimum execution time: 19_901_000 picoseconds.
Weight::from_parts(21_028_116, 0)
.saturating_add(Weight::from_parts(0, 3539))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
@@ -379,11 +377,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `266`
// Estimated: `1487`
// Minimum execution time: 5_792_000 picoseconds.
Weight::from_parts(6_358_588, 0)
// Minimum execution time: 5_987_000 picoseconds.
Weight::from_parts(6_412_478, 0)
.saturating_add(Weight::from_parts(0, 1487))
// Standard Error: 20
.saturating_add(Weight::from_parts(26, 0).saturating_mul(n.into()))
// Standard Error: 16
.saturating_add(Weight::from_parts(47, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -397,8 +395,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `447`
// Estimated: `6196`
// Minimum execution time: 38_690_000 picoseconds.
Weight::from_parts(39_706_000, 0)
// Minimum execution time: 38_623_000 picoseconds.
Weight::from_parts(39_773_000, 0)
.saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -414,15 +412,13 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
/// Storage: `Broker::Workplan` (r:0 w:60)
/// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 1000]`.
fn rotate_sale(n: u32, ) -> Weight {
fn rotate_sale(_n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `12514`
// Estimated: `13506`
// Minimum execution time: 93_531_000 picoseconds.
Weight::from_parts(95_836_318, 0)
// Minimum execution time: 97_074_000 picoseconds.
Weight::from_parts(101_247_740, 0)
.saturating_add(Weight::from_parts(0, 13506))
// Standard Error: 113
.saturating_add(Weight::from_parts(329, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(65))
}
@@ -434,8 +430,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3493`
// Minimum execution time: 6_506_000 picoseconds.
Weight::from_parts(6_783_000, 0)
// Minimum execution time: 6_317_000 picoseconds.
Weight::from_parts(6_521_000, 0)
.saturating_add(Weight::from_parts(0, 3493))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -458,8 +454,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `1321`
// Estimated: `4786`
// Minimum execution time: 31_927_000 picoseconds.
Weight::from_parts(32_748_000, 0)
// Minimum execution time: 32_575_000 picoseconds.
Weight::from_parts(33_299_000, 0)
.saturating_add(Weight::from_parts(0, 4786))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
@@ -478,8 +474,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 15_682_000 picoseconds.
Weight::from_parts(16_012_000, 0)
// Minimum execution time: 15_256_000 picoseconds.
Weight::from_parts(15_927_000, 0)
.saturating_add(Weight::from_parts(0, 3539))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
@@ -490,8 +486,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_147_000 picoseconds.
Weight::from_parts(2_281_000, 0)
// Minimum execution time: 1_783_000 picoseconds.
Weight::from_parts(1_904_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -509,10 +505,22 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `398`
// Estimated: `3863`
// Minimum execution time: 12_015_000 picoseconds.
Weight::from_parts(12_619_000, 0)
// Minimum execution time: 12_307_000 picoseconds.
Weight::from_parts(12_967_000, 0)
.saturating_add(Weight::from_parts(0, 3863))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Broker::Leases` (r:1 w:1)
/// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(401), added: 896, mode: `MaxEncodedLen`)
fn swap_leases() -> Weight {
// Proof Size summary in bytes:
// Measured: `470`
// Estimated: `1886`
// Minimum execution time: 6_597_000 picoseconds.
Weight::from_parts(6_969_000, 0)
.saturating_add(Weight::from_parts(0, 1886))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -17,25 +17,23 @@
//! Autogenerated weights for `pallet_broker`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-02-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-03-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-h2rr8wx7-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-westend-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// target/production/polkadot-parachain
// benchmark
// pallet
// --chain=coretime-westend-dev
// --wasm-execution=compiled
// --pallet=pallet_broker
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_broker
// --chain=coretime-westend-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/
@@ -56,8 +54,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_944_000 picoseconds.
Weight::from_parts(2_045_000, 0)
// Minimum execution time: 1_897_000 picoseconds.
Weight::from_parts(2_053_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -67,8 +65,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `10888`
// Estimated: `13506`
// Minimum execution time: 21_158_000 picoseconds.
Weight::from_parts(21_572_000, 0)
// Minimum execution time: 22_550_000 picoseconds.
Weight::from_parts(22_871_000, 0)
.saturating_add(Weight::from_parts(0, 13506))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -79,8 +77,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `12090`
// Estimated: `13506`
// Minimum execution time: 20_497_000 picoseconds.
Weight::from_parts(20_995_000, 0)
// Minimum execution time: 21_170_000 picoseconds.
Weight::from_parts(21_645_000, 0)
.saturating_add(Weight::from_parts(0, 13506))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -95,8 +93,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `146`
// Estimated: `1631`
// Minimum execution time: 10_280_000 picoseconds.
Weight::from_parts(10_686_000, 0)
// Minimum execution time: 10_494_000 picoseconds.
Weight::from_parts(10_942_000, 0)
.saturating_add(Weight::from_parts(0, 1631))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
@@ -120,15 +118,13 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
/// Storage: `Broker::Workplan` (r:0 w:20)
/// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 1000]`.
fn start_sales(n: u32, ) -> Weight {
fn start_sales(_n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `12247`
// Estimated: `13732`
// Minimum execution time: 61_020_000 picoseconds.
Weight::from_parts(63_240_622, 0)
// Minimum execution time: 61_014_000 picoseconds.
Weight::from_parts(63_267_651, 0)
.saturating_add(Weight::from_parts(0, 13732))
// Standard Error: 102
.saturating_add(Weight::from_parts(255, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(26))
}
@@ -144,8 +140,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `316`
// Estimated: `3593`
// Minimum execution time: 30_627_000 picoseconds.
Weight::from_parts(31_648_000, 0)
// Minimum execution time: 30_931_000 picoseconds.
Weight::from_parts(31_941_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
@@ -166,8 +162,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `434`
// Estimated: `4698`
// Minimum execution time: 57_701_000 picoseconds.
Weight::from_parts(59_825_000, 0)
// Minimum execution time: 57_466_000 picoseconds.
Weight::from_parts(65_042_000, 0)
.saturating_add(Weight::from_parts(0, 4698))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
@@ -178,8 +174,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `357`
// Estimated: `3550`
// Minimum execution time: 12_898_000 picoseconds.
Weight::from_parts(13_506_000, 0)
// Minimum execution time: 12_799_000 picoseconds.
Weight::from_parts(13_401_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -190,8 +186,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `357`
// Estimated: `3550`
// Minimum execution time: 14_284_000 picoseconds.
Weight::from_parts(14_791_000, 0)
// Minimum execution time: 14_107_000 picoseconds.
Weight::from_parts(14_630_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
@@ -202,8 +198,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `357`
// Estimated: `3550`
// Minimum execution time: 15_570_000 picoseconds.
Weight::from_parts(16_158_000, 0)
// Minimum execution time: 15_254_000 picoseconds.
Weight::from_parts(16_062_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(3))
@@ -220,8 +216,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `735`
// Estimated: `4681`
// Minimum execution time: 23_329_000 picoseconds.
Weight::from_parts(24_196_000, 0)
// Minimum execution time: 23_557_000 picoseconds.
Weight::from_parts(24_382_000, 0)
.saturating_add(Weight::from_parts(0, 4681))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
@@ -240,8 +236,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `801`
// Estimated: `5996`
// Minimum execution time: 29_288_000 picoseconds.
Weight::from_parts(30_066_000, 0)
// Minimum execution time: 29_371_000 picoseconds.
Weight::from_parts(30_200_000, 0)
.saturating_add(Weight::from_parts(0, 5996))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
@@ -257,11 +253,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `652`
// Estimated: `6196 + m * (2520 ±0)`
// Minimum execution time: 54_833_000 picoseconds.
Weight::from_parts(55_577_423, 0)
// Minimum execution time: 54_331_000 picoseconds.
Weight::from_parts(55_322_165, 0)
.saturating_add(Weight::from_parts(0, 6196))
// Standard Error: 35_105
.saturating_add(Weight::from_parts(1_267_911, 0).saturating_mul(m.into()))
// Standard Error: 35_225
.saturating_add(Weight::from_parts(1_099_614, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(T::DbWeight::get().writes(5))
@@ -283,8 +279,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `215`
// Estimated: `3680`
// Minimum execution time: 55_289_000 picoseconds.
Weight::from_parts(56_552_000, 0)
// Minimum execution time: 53_789_000 picoseconds.
Weight::from_parts(55_439_000, 0)
.saturating_add(Weight::from_parts(0, 3680))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
@@ -297,8 +293,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `465`
// Estimated: `3550`
// Minimum execution time: 39_736_000 picoseconds.
Weight::from_parts(41_346_000, 0)
// Minimum execution time: 43_941_000 picoseconds.
Weight::from_parts(49_776_000, 0)
.saturating_add(Weight::from_parts(0, 3550))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
@@ -313,8 +309,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `463`
// Estimated: `3533`
// Minimum execution time: 57_319_000 picoseconds.
Weight::from_parts(60_204_000, 0)
// Minimum execution time: 64_917_000 picoseconds.
Weight::from_parts(70_403_000, 0)
.saturating_add(Weight::from_parts(0, 3533))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
@@ -331,8 +327,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `857`
// Estimated: `3593`
// Minimum execution time: 85_216_000 picoseconds.
Weight::from_parts(91_144_000, 0)
// Minimum execution time: 72_633_000 picoseconds.
Weight::from_parts(79_305_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
@@ -345,8 +341,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `556`
// Estimated: `4698`
// Minimum execution time: 32_331_000 picoseconds.
Weight::from_parts(39_877_000, 0)
// Minimum execution time: 36_643_000 picoseconds.
Weight::from_parts(48_218_000, 0)
.saturating_add(Weight::from_parts(0, 4698))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
@@ -362,28 +358,28 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// The range of component `n` is `[0, 1000]`.
fn request_core_count(n: u32, ) -> Weight {
fn request_core_count(_n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 18_128_000 picoseconds.
Weight::from_parts(19_061_234, 0)
// Minimum execution time: 17_617_000 picoseconds.
Weight::from_parts(18_904_788, 0)
.saturating_add(Weight::from_parts(0, 3539))
// Standard Error: 48
.saturating_add(Weight::from_parts(141, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Broker::CoreCountInbox` (r:1 w:1)
/// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 1000]`.
fn process_core_count(_n: u32, ) -> Weight {
fn process_core_count(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `266`
// Estimated: `1487`
// Minimum execution time: 5_368_000 picoseconds.
Weight::from_parts(5_837_005, 0)
// Minimum execution time: 5_575_000 picoseconds.
Weight::from_parts(5_887_598, 0)
.saturating_add(Weight::from_parts(0, 1487))
// Standard Error: 16
.saturating_add(Weight::from_parts(41, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -397,8 +393,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `447`
// Estimated: `6196`
// Minimum execution time: 36_047_000 picoseconds.
Weight::from_parts(37_101_000, 0)
// Minimum execution time: 36_415_000 picoseconds.
Weight::from_parts(37_588_000, 0)
.saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -414,13 +410,15 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
/// Storage: `Broker::Workplan` (r:0 w:20)
/// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`)
/// The range of component `n` is `[0, 1000]`.
fn rotate_sale(_n: u32, ) -> Weight {
fn rotate_sale(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `12194`
// Estimated: `13506`
// Minimum execution time: 48_158_000 picoseconds.
Weight::from_parts(49_891_920, 0)
// Minimum execution time: 48_362_000 picoseconds.
Weight::from_parts(49_616_106, 0)
.saturating_add(Weight::from_parts(0, 13506))
// Standard Error: 61
.saturating_add(Weight::from_parts(59, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(25))
}
@@ -432,8 +430,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3493`
// Minimum execution time: 5_911_000 picoseconds.
Weight::from_parts(6_173_000, 0)
// Minimum execution time: 6_148_000 picoseconds.
Weight::from_parts(6_374_000, 0)
.saturating_add(Weight::from_parts(0, 3493))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -456,8 +454,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `1321`
// Estimated: `4786`
// Minimum execution time: 30_140_000 picoseconds.
Weight::from_parts(30_912_000, 0)
// Minimum execution time: 30_267_000 picoseconds.
Weight::from_parts(30_825_000, 0)
.saturating_add(Weight::from_parts(0, 4786))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(4))
@@ -476,8 +474,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 13_684_000 picoseconds.
Weight::from_parts(14_252_000, 0)
// Minimum execution time: 13_491_000 picoseconds.
Weight::from_parts(13_949_000, 0)
.saturating_add(Weight::from_parts(0, 3539))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
@@ -488,8 +486,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_718_000 picoseconds.
Weight::from_parts(1_843_000, 0)
// Minimum execution time: 1_711_000 picoseconds.
Weight::from_parts(1_913_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -507,10 +505,22 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `398`
// Estimated: `3863`
// Minimum execution time: 11_771_000 picoseconds.
Weight::from_parts(12_120_000, 0)
// Minimum execution time: 12_035_000 picoseconds.
Weight::from_parts(12_383_000, 0)
.saturating_add(Weight::from_parts(0, 3863))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Broker::Leases` (r:1 w:1)
/// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(81), added: 576, mode: `MaxEncodedLen`)
fn swap_leases() -> Weight {
// Proof Size summary in bytes:
// Measured: `150`
// Estimated: `1566`
// Minimum execution time: 6_142_000 picoseconds.
Weight::from_parts(6_538_000, 0)
.saturating_add(Weight::from_parts(0, 1566))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}