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
@@ -918,6 +918,23 @@ mod benches {
Ok(())
}
#[benchmark]
fn swap_leases() -> Result<(), BenchmarkError> {
let admin_origin =
T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
// Add two leases in `Leases`
let n = (T::MaxLeasedCores::get() / 2) as usize;
let mut leases = vec![LeaseRecordItem { task: 1, until: 10u32.into() }; n];
leases.extend(vec![LeaseRecordItem { task: 2, until: 20u32.into() }; n]);
Leases::<T>::put(BoundedVec::try_from(leases).unwrap());
#[extrinsic_call]
_(admin_origin as T::RuntimeOrigin, 1, 2);
Ok(())
}
// Implements a test for each benchmark. Execute with:
// `cargo test -p pallet-broker --features runtime-benchmarks`.
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test);
@@ -437,4 +437,22 @@ impl<T: Config> Pallet<T> {
Self::deposit_event(Event::AllowedRenewalDropped { core, when });
Ok(())
}
pub(crate) fn do_swap_leases(id: TaskId, other: TaskId) -> DispatchResult {
let mut id_leases_count = 0;
let mut other_leases_count = 0;
Leases::<T>::mutate(|leases| {
leases.iter_mut().for_each(|lease| {
if lease.task == id {
lease.task = other;
id_leases_count += 1;
} else if lease.task == other {
lease.task = id;
other_leases_count += 1;
}
})
});
Ok(())
}
}
+8
View File
@@ -786,5 +786,13 @@ pub mod pallet {
Self::do_notify_core_count(core_count)?;
Ok(())
}
#[pallet::call_index(99)]
#[pallet::weight(T::WeightInfo::swap_leases())]
pub fn swap_leases(origin: OriginFor<T>, id: TaskId, other: TaskId) -> DispatchResult {
T::AdminOrigin::ensure_origin_or_root(origin)?;
Self::do_swap_leases(id, other)?;
Ok(())
}
}
}
+200 -168
View File
@@ -17,10 +17,10 @@
//! Autogenerated weights for `pallet_broker`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-04, 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-pzhd7p6z-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("dev")`, DB CACHE: `1024`
// Executed Command:
@@ -76,6 +76,7 @@ pub trait WeightInfo {
fn request_revenue_info_at() -> Weight;
fn notify_core_count() -> Weight;
fn do_tick_base() -> Weight;
fn swap_leases() -> Weight;
}
/// Weights for `pallet_broker` using the Substrate node and recommended hardware.
@@ -87,8 +88,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_040_000 picoseconds.
Weight::from_parts(3_344_000, 0)
// Minimum execution time: 2_865_000 picoseconds.
Weight::from_parts(3_061_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `Broker::Reservations` (r:1 w:1)
@@ -97,8 +98,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `5016`
// Estimated: `7496`
// Minimum execution time: 21_259_000 picoseconds.
Weight::from_parts(22_110_000, 7496)
// Minimum execution time: 18_431_000 picoseconds.
Weight::from_parts(19_558_000, 7496)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -108,8 +109,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `6218`
// Estimated: `7496`
// Minimum execution time: 20_330_000 picoseconds.
Weight::from_parts(20_826_000, 7496)
// Minimum execution time: 17_724_000 picoseconds.
Weight::from_parts(18_688_000, 7496)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -119,8 +120,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `239`
// Estimated: `1526`
// Minimum execution time: 13_411_000 picoseconds.
Weight::from_parts(13_960_000, 1526)
// Minimum execution time: 10_513_000 picoseconds.
Weight::from_parts(11_138_000, 1526)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -139,14 +140,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: `Broker::Workplan` (r:0 w:10)
/// 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: `6330`
// Estimated: `8499`
// Minimum execution time: 57_770_000 picoseconds.
Weight::from_parts(61_047_512, 8499)
// Standard Error: 165
.saturating_add(Weight::from_parts(3, 0).saturating_mul(n.into()))
// Minimum execution time: 50_864_000 picoseconds.
Weight::from_parts(54_000_280, 8499)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(16_u64))
}
@@ -162,10 +161,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
fn purchase() -> Weight {
// Proof Size summary in bytes:
// Measured: `568`
// Estimated: `2053`
// Minimum execution time: 51_196_000 picoseconds.
Weight::from_parts(52_382_000, 2053)
// Measured: `635`
// Estimated: `2120`
// Minimum execution time: 43_630_000 picoseconds.
Weight::from_parts(44_622_000, 2120)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -185,10 +184,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`)
fn renew() -> Weight {
// Proof Size summary in bytes:
// Measured: `686`
// Measured: `753`
// Estimated: `4698`
// Minimum execution time: 71_636_000 picoseconds.
Weight::from_parts(73_679_000, 4698)
// Minimum execution time: 62_453_000 picoseconds.
Weight::from_parts(63_882_000, 4698)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
@@ -198,8 +197,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `495`
// Estimated: `3550`
// Minimum execution time: 19_182_000 picoseconds.
Weight::from_parts(19_775_000, 3550)
// Minimum execution time: 17_237_000 picoseconds.
Weight::from_parts(17_757_000, 3550)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -209,21 +208,21 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `495`
// Estimated: `3550`
// Minimum execution time: 20_688_000 picoseconds.
Weight::from_parts(21_557_000, 3550)
// Minimum execution time: 18_504_000 picoseconds.
Weight::from_parts(19_273_000, 3550)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
/// Storage: `Broker::Regions` (r:1 w:2)
/// Storage: `Broker::Regions` (r:1 w:3)
/// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
fn interlace() -> Weight {
// Proof Size summary in bytes:
// Measured: `495`
// Estimated: `3550`
// Minimum execution time: 21_190_000 picoseconds.
Weight::from_parts(22_215_000, 3550)
// Minimum execution time: 20_477_000 picoseconds.
Weight::from_parts(21_328_000, 3550)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
/// Storage: `Broker::Configuration` (r:1 w:0)
/// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`)
@@ -237,8 +236,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `740`
// Estimated: `4681`
// Minimum execution time: 34_591_000 picoseconds.
Weight::from_parts(36_227_000, 4681)
// Minimum execution time: 31_815_000 picoseconds.
Weight::from_parts(32_700_000, 4681)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -256,8 +255,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `775`
// Estimated: `5996`
// Minimum execution time: 40_346_000 picoseconds.
Weight::from_parts(41_951_000, 5996)
// Minimum execution time: 38_313_000 picoseconds.
Weight::from_parts(38_985_000, 5996)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
@@ -272,10 +271,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `859`
// Estimated: `6196 + m * (2520 ±0)`
// Minimum execution time: 75_734_000 picoseconds.
Weight::from_parts(78_168_395, 6196)
// Standard Error: 63_180
.saturating_add(Weight::from_parts(1_076_259, 0).saturating_mul(m.into()))
// Minimum execution time: 70_170_000 picoseconds.
Weight::from_parts(71_245_388, 6196)
// Standard Error: 54_382
.saturating_add(Weight::from_parts(1_488_794, 0).saturating_mul(m.into()))
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(T::DbWeight::get().writes(5_u64))
@@ -287,8 +286,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `3593`
// Minimum execution time: 46_383_000 picoseconds.
Weight::from_parts(47_405_000, 3593)
// Minimum execution time: 43_414_000 picoseconds.
Weight::from_parts(44_475_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -300,8 +299,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `603`
// Estimated: `3550`
// Minimum execution time: 30_994_000 picoseconds.
Weight::from_parts(31_979_000, 3550)
// Minimum execution time: 31_327_000 picoseconds.
Weight::from_parts(32_050_000, 3550)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -315,8 +314,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `601`
// Estimated: `3533`
// Minimum execution time: 37_584_000 picoseconds.
Weight::from_parts(44_010_000, 3533)
// Minimum execution time: 41_315_000 picoseconds.
Weight::from_parts(42_421_000, 3533)
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -330,10 +329,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn drop_history() -> Weight {
// Proof Size summary in bytes:
// Measured: `830`
// Measured: `995`
// Estimated: `3593`
// Minimum execution time: 45_266_000 picoseconds.
Weight::from_parts(48_000_000, 3593)
// Minimum execution time: 49_707_000 picoseconds.
Weight::from_parts(51_516_000, 3593)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -343,10 +342,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Broker::AllowedRenewals` (`max_values`: None, `max_size`: Some(1233), added: 3708, mode: `MaxEncodedLen`)
fn drop_renewal() -> Weight {
// Proof Size summary in bytes:
// Measured: `525`
// Measured: `661`
// Estimated: `4698`
// Minimum execution time: 25_365_000 picoseconds.
Weight::from_parts(26_920_000, 4698)
// Minimum execution time: 26_207_000 picoseconds.
Weight::from_parts(27_227_000, 4698)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -355,22 +354,22 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_519_000 picoseconds.
Weight::from_parts(7_098_698, 0)
// Standard Error: 20
.saturating_add(Weight::from_parts(8, 0).saturating_mul(n.into()))
// Minimum execution time: 4_670_000 picoseconds.
Weight::from_parts(5_170_450, 0)
// Standard Error: 16
.saturating_add(Weight::from_parts(37, 0).saturating_mul(n.into()))
}
/// Storage: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// Proof: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// 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 {
// Proof Size summary in bytes:
// Measured: `98`
// Estimated: `3563`
// Minimum execution time: 7_608_000 picoseconds.
Weight::from_parts(8_157_815, 3563)
// Standard Error: 26
.saturating_add(Weight::from_parts(48, 0).saturating_mul(n.into()))
// Measured: `404`
// Estimated: `1487`
// Minimum execution time: 6_916_000 picoseconds.
Weight::from_parts(7_485_053, 1487)
// Standard Error: 23
.saturating_add(Weight::from_parts(30, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -386,10 +385,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn process_revenue() -> Weight {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `4370`
// Minimum execution time: 59_993_000 picoseconds.
Weight::from_parts(61_752_000, 4370)
// Measured: `972`
// Estimated: `4437`
// Minimum execution time: 50_987_000 picoseconds.
Weight::from_parts(52_303_000, 4437)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
@@ -408,10 +407,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `6281`
// Estimated: `8499`
// Minimum execution time: 41_863_000 picoseconds.
Weight::from_parts(44_033_031, 8499)
// Standard Error: 116
.saturating_add(Weight::from_parts(764, 0).saturating_mul(n.into()))
// Minimum execution time: 38_334_000 picoseconds.
Weight::from_parts(40_517_609, 8499)
// Standard Error: 90
.saturating_add(Weight::from_parts(338, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(15_u64))
}
@@ -423,8 +422,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `180`
// Estimated: `3493`
// Minimum execution time: 9_588_000 picoseconds.
Weight::from_parts(9_925_000, 3493)
// Minimum execution time: 7_850_000 picoseconds.
Weight::from_parts(8_157_000, 3493)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -436,8 +435,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `1423`
// Estimated: `4681`
// Minimum execution time: 19_308_000 picoseconds.
Weight::from_parts(20_482_000, 4681)
// Minimum execution time: 17_313_000 picoseconds.
Weight::from_parts(17_727_000, 4681)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -445,28 +444,46 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 147_000 picoseconds.
Weight::from_parts(184_000, 0)
// Minimum execution time: 171_000 picoseconds.
Weight::from_parts(196_000, 0)
}
/// Storage: `Broker::CoreCountInbox` (r:0 w:1)
/// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
fn notify_core_count() -> Weight {
T::DbWeight::get().reads_writes(1, 1)
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_413_000 picoseconds.
Weight::from_parts(2_587_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `Broker::Status` (r:1 w:1)
/// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`)
/// Storage: `Broker::Configuration` (r:1 w:0)
/// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// Proof: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// Storage: `Broker::CoreCountInbox` (r:1 w:0)
/// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0xf308d869daf021a7724e69c557dd8dbe` (r:1 w:1)
/// Proof: UNKNOWN KEY `0xf308d869daf021a7724e69c557dd8dbe` (r:1 w:1)
fn do_tick_base() -> Weight {
// Proof Size summary in bytes:
// Measured: `699`
// Estimated: `4164`
// Minimum execution time: 19_824_000 picoseconds.
Weight::from_parts(20_983_000, 4164)
// Measured: `603`
// Estimated: `4068`
// Minimum execution time: 13_121_000 picoseconds.
Weight::from_parts(13_685_000, 4068)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
/// Storage: `Broker::Leases` (r:1 w:1)
/// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(41), added: 536, mode: `MaxEncodedLen`)
fn swap_leases() -> Weight {
// Proof Size summary in bytes:
// Measured: `239`
// Estimated: `1526`
// Minimum execution time: 6_847_000 picoseconds.
Weight::from_parts(7_185_000, 1526)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
}
@@ -478,8 +495,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_040_000 picoseconds.
Weight::from_parts(3_344_000, 0)
// Minimum execution time: 2_865_000 picoseconds.
Weight::from_parts(3_061_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `Broker::Reservations` (r:1 w:1)
@@ -488,8 +505,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `5016`
// Estimated: `7496`
// Minimum execution time: 21_259_000 picoseconds.
Weight::from_parts(22_110_000, 7496)
// Minimum execution time: 18_431_000 picoseconds.
Weight::from_parts(19_558_000, 7496)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -499,8 +516,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `6218`
// Estimated: `7496`
// Minimum execution time: 20_330_000 picoseconds.
Weight::from_parts(20_826_000, 7496)
// Minimum execution time: 17_724_000 picoseconds.
Weight::from_parts(18_688_000, 7496)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -510,8 +527,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `239`
// Estimated: `1526`
// Minimum execution time: 13_411_000 picoseconds.
Weight::from_parts(13_960_000, 1526)
// Minimum execution time: 10_513_000 picoseconds.
Weight::from_parts(11_138_000, 1526)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -530,14 +547,12 @@ impl WeightInfo for () {
/// Storage: `Broker::Workplan` (r:0 w:10)
/// 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: `6330`
// Estimated: `8499`
// Minimum execution time: 57_770_000 picoseconds.
Weight::from_parts(61_047_512, 8499)
// Standard Error: 165
.saturating_add(Weight::from_parts(3, 0).saturating_mul(n.into()))
// Minimum execution time: 50_864_000 picoseconds.
Weight::from_parts(54_000_280, 8499)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(16_u64))
}
@@ -553,10 +568,10 @@ impl WeightInfo for () {
/// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
fn purchase() -> Weight {
// Proof Size summary in bytes:
// Measured: `568`
// Estimated: `2053`
// Minimum execution time: 51_196_000 picoseconds.
Weight::from_parts(52_382_000, 2053)
// Measured: `635`
// Estimated: `2120`
// Minimum execution time: 43_630_000 picoseconds.
Weight::from_parts(44_622_000, 2120)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -576,10 +591,10 @@ impl WeightInfo for () {
/// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`)
fn renew() -> Weight {
// Proof Size summary in bytes:
// Measured: `686`
// Measured: `753`
// Estimated: `4698`
// Minimum execution time: 71_636_000 picoseconds.
Weight::from_parts(73_679_000, 4698)
// Minimum execution time: 62_453_000 picoseconds.
Weight::from_parts(63_882_000, 4698)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
@@ -589,8 +604,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `495`
// Estimated: `3550`
// Minimum execution time: 19_182_000 picoseconds.
Weight::from_parts(19_775_000, 3550)
// Minimum execution time: 17_237_000 picoseconds.
Weight::from_parts(17_757_000, 3550)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -600,21 +615,21 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `495`
// Estimated: `3550`
// Minimum execution time: 20_688_000 picoseconds.
Weight::from_parts(21_557_000, 3550)
// Minimum execution time: 18_504_000 picoseconds.
Weight::from_parts(19_273_000, 3550)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
/// Storage: `Broker::Regions` (r:1 w:2)
/// Storage: `Broker::Regions` (r:1 w:3)
/// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `MaxEncodedLen`)
fn interlace() -> Weight {
// Proof Size summary in bytes:
// Measured: `495`
// Estimated: `3550`
// Minimum execution time: 21_190_000 picoseconds.
Weight::from_parts(22_215_000, 3550)
// Minimum execution time: 20_477_000 picoseconds.
Weight::from_parts(21_328_000, 3550)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
/// Storage: `Broker::Configuration` (r:1 w:0)
/// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`)
@@ -628,8 +643,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `740`
// Estimated: `4681`
// Minimum execution time: 34_591_000 picoseconds.
Weight::from_parts(36_227_000, 4681)
// Minimum execution time: 31_815_000 picoseconds.
Weight::from_parts(32_700_000, 4681)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -647,8 +662,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `775`
// Estimated: `5996`
// Minimum execution time: 40_346_000 picoseconds.
Weight::from_parts(41_951_000, 5996)
// Minimum execution time: 38_313_000 picoseconds.
Weight::from_parts(38_985_000, 5996)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
@@ -663,10 +678,10 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `859`
// Estimated: `6196 + m * (2520 ±0)`
// Minimum execution time: 75_734_000 picoseconds.
Weight::from_parts(78_168_395, 6196)
// Standard Error: 63_180
.saturating_add(Weight::from_parts(1_076_259, 0).saturating_mul(m.into()))
// Minimum execution time: 70_170_000 picoseconds.
Weight::from_parts(71_245_388, 6196)
// Standard Error: 54_382
.saturating_add(Weight::from_parts(1_488_794, 0).saturating_mul(m.into()))
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(m.into())))
.saturating_add(RocksDbWeight::get().writes(5_u64))
@@ -678,8 +693,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `3593`
// Minimum execution time: 46_383_000 picoseconds.
Weight::from_parts(47_405_000, 3593)
// Minimum execution time: 43_414_000 picoseconds.
Weight::from_parts(44_475_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -691,8 +706,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `603`
// Estimated: `3550`
// Minimum execution time: 30_994_000 picoseconds.
Weight::from_parts(31_979_000, 3550)
// Minimum execution time: 31_327_000 picoseconds.
Weight::from_parts(32_050_000, 3550)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -706,8 +721,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `601`
// Estimated: `3533`
// Minimum execution time: 37_584_000 picoseconds.
Weight::from_parts(44_010_000, 3533)
// Minimum execution time: 41_315_000 picoseconds.
Weight::from_parts(42_421_000, 3533)
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -721,10 +736,10 @@ impl WeightInfo for () {
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn drop_history() -> Weight {
// Proof Size summary in bytes:
// Measured: `830`
// Measured: `995`
// Estimated: `3593`
// Minimum execution time: 45_266_000 picoseconds.
Weight::from_parts(48_000_000, 3593)
// Minimum execution time: 49_707_000 picoseconds.
Weight::from_parts(51_516_000, 3593)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -734,10 +749,10 @@ impl WeightInfo for () {
/// Proof: `Broker::AllowedRenewals` (`max_values`: None, `max_size`: Some(1233), added: 3708, mode: `MaxEncodedLen`)
fn drop_renewal() -> Weight {
// Proof Size summary in bytes:
// Measured: `525`
// Measured: `661`
// Estimated: `4698`
// Minimum execution time: 25_365_000 picoseconds.
Weight::from_parts(26_920_000, 4698)
// Minimum execution time: 26_207_000 picoseconds.
Weight::from_parts(27_227_000, 4698)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -746,22 +761,22 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_519_000 picoseconds.
Weight::from_parts(7_098_698, 0)
// Standard Error: 20
.saturating_add(Weight::from_parts(8, 0).saturating_mul(n.into()))
// Minimum execution time: 4_670_000 picoseconds.
Weight::from_parts(5_170_450, 0)
// Standard Error: 16
.saturating_add(Weight::from_parts(37, 0).saturating_mul(n.into()))
}
/// Storage: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// Proof: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// 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 {
// Proof Size summary in bytes:
// Measured: `98`
// Estimated: `3563`
// Minimum execution time: 7_608_000 picoseconds.
Weight::from_parts(8_157_815, 3563)
// Standard Error: 26
.saturating_add(Weight::from_parts(48, 0).saturating_mul(n.into()))
// Measured: `404`
// Estimated: `1487`
// Minimum execution time: 6_916_000 picoseconds.
Weight::from_parts(7_485_053, 1487)
// Standard Error: 23
.saturating_add(Weight::from_parts(30, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -777,10 +792,10 @@ impl WeightInfo for () {
/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn process_revenue() -> Weight {
// Proof Size summary in bytes:
// Measured: `905`
// Estimated: `4370`
// Minimum execution time: 59_993_000 picoseconds.
Weight::from_parts(61_752_000, 4370)
// Measured: `972`
// Estimated: `4437`
// Minimum execution time: 50_987_000 picoseconds.
Weight::from_parts(52_303_000, 4437)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}
@@ -799,10 +814,10 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `6281`
// Estimated: `8499`
// Minimum execution time: 41_863_000 picoseconds.
Weight::from_parts(44_033_031, 8499)
// Standard Error: 116
.saturating_add(Weight::from_parts(764, 0).saturating_mul(n.into()))
// Minimum execution time: 38_334_000 picoseconds.
Weight::from_parts(40_517_609, 8499)
// Standard Error: 90
.saturating_add(Weight::from_parts(338, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(15_u64))
}
@@ -814,8 +829,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `180`
// Estimated: `3493`
// Minimum execution time: 9_588_000 picoseconds.
Weight::from_parts(9_925_000, 3493)
// Minimum execution time: 7_850_000 picoseconds.
Weight::from_parts(8_157_000, 3493)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -827,8 +842,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `1423`
// Estimated: `4681`
// Minimum execution time: 19_308_000 picoseconds.
Weight::from_parts(20_482_000, 4681)
// Minimum execution time: 17_313_000 picoseconds.
Weight::from_parts(17_727_000, 4681)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -836,28 +851,45 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 147_000 picoseconds.
Weight::from_parts(184_000, 0)
// Minimum execution time: 171_000 picoseconds.
Weight::from_parts(196_000, 0)
}
/// Storage: `Broker::CoreCountInbox` (r:0 w:1)
/// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
fn notify_core_count() -> Weight {
RocksDbWeight::get().reads(1)
.saturating_add(RocksDbWeight::get().writes(1))
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_413_000 picoseconds.
Weight::from_parts(2_587_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `Broker::Status` (r:1 w:1)
/// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`)
/// Storage: `Broker::Configuration` (r:1 w:0)
/// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// Proof: UNKNOWN KEY `0x18194fcb5c1fcace44d2d0a004272614` (r:1 w:1)
/// Storage: `Broker::CoreCountInbox` (r:1 w:0)
/// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0xf308d869daf021a7724e69c557dd8dbe` (r:1 w:1)
/// Proof: UNKNOWN KEY `0xf308d869daf021a7724e69c557dd8dbe` (r:1 w:1)
fn do_tick_base() -> Weight {
// Proof Size summary in bytes:
// Measured: `699`
// Estimated: `4164`
// Minimum execution time: 19_824_000 picoseconds.
Weight::from_parts(20_983_000, 4164)
// Measured: `603`
// Estimated: `4068`
// Minimum execution time: 13_121_000 picoseconds.
Weight::from_parts(13_685_000, 4068)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
/// Storage: `Broker::Leases` (r:1 w:1)
/// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(41), added: 536, mode: `MaxEncodedLen`)
fn swap_leases() -> Weight {
// Proof Size summary in bytes:
// Measured: `239`
// Estimated: `1526`
// Minimum execution time: 6_847_000 picoseconds.
Weight::from_parts(7_185_000, 1526)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
}