From bd41848788383f39410c326508b052f94afb3130 Mon Sep 17 00:00:00 2001 From: Jonathan Brown <jbrown@acuity.social> Date: Thu, 20 Feb 2025 05:17:52 +0700 Subject: [PATCH] [pallet-broker] add extrinsic to remove an assignment (#7080) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description #6929 requests more extrinsics for "managing the network's coretime allocations without needing to dabble with migration+runtime upgrade or set/kill storage patterns" This pull request implements the remove_assignment() extrinsic. ## Integration Downstream projects need to benchmark the weight for the remove_assignment() extrinsic. --------- Co-authored-by: Jonathan Brown <jbrown@acuity.network> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dónal Murray <donal.murray@parity.io> --- .../src/weights/pallet_broker.rs | 166 ++++----- .../src/weights/pallet_broker.rs | 165 ++++----- prdoc/pr_7080.prdoc | 17 + substrate/frame/broker/src/benchmarking.rs | 27 ++ .../frame/broker/src/dispatchable_impls.rs | 8 + substrate/frame/broker/src/lib.rs | 17 + substrate/frame/broker/src/tests.rs | 24 +- substrate/frame/broker/src/weights.rs | 315 ++++++++++-------- 8 files changed, 440 insertions(+), 299 deletions(-) create mode 100644 prdoc/pr_7080.prdoc diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs index 1a94a810add..aaa8fd5e2a9 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_broker` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `3d3aa761b4e4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `2da613459306`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -58,8 +58,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_938_000 picoseconds. - Weight::from_parts(2_053_000, 0) + // Minimum execution time: 2_012_000 picoseconds. + Weight::from_parts(2_104_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `10826` // Estimated: `13506` - // Minimum execution time: 21_616_000 picoseconds. - Weight::from_parts(22_103_000, 0) + // Minimum execution time: 21_764_000 picoseconds. + Weight::from_parts(22_375_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -81,8 +81,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `12028` // Estimated: `13506` - // Minimum execution time: 20_780_000 picoseconds. - Weight::from_parts(21_119_000, 0) + // Minimum execution time: 21_047_000 picoseconds. + Weight::from_parts(21_450_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `400` // Estimated: `1886` - // Minimum execution time: 9_092_000 picoseconds. - Weight::from_parts(9_625_000, 0) + // Minimum execution time: 9_746_000 picoseconds. + Weight::from_parts(10_107_000, 0) .saturating_add(Weight::from_parts(0, 1886)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -142,11 +142,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `12505` // Estimated: `14971 + n * (1 ±0)` - // Minimum execution time: 46_159_000 picoseconds. - Weight::from_parts(138_417_372, 0) + // Minimum execution time: 45_856_000 picoseconds. + Weight::from_parts(138_813_298, 0) .saturating_add(Weight::from_parts(0, 14971)) - // Standard Error: 2_456 - .saturating_add(Weight::from_parts(20_567, 0).saturating_mul(n.into())) + // Standard Error: 2_476 + .saturating_add(Weight::from_parts(23_991, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(58)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -165,8 +165,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `356` // Estimated: `3593` - // Minimum execution time: 57_583_000 picoseconds. - Weight::from_parts(58_954_000, 0) + // Minimum execution time: 58_458_000 picoseconds. + Weight::from_parts(60_310_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -189,8 +189,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `577` // Estimated: `4698` - // Minimum execution time: 83_772_000 picoseconds. - Weight::from_parts(89_427_000, 0) + // Minimum execution time: 95_335_000 picoseconds. + Weight::from_parts(102_933_000, 0) .saturating_add(Weight::from_parts(0, 4698)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -201,8 +201,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3551` - // Minimum execution time: 17_886_000 picoseconds. - Weight::from_parts(18_525_000, 0) + // Minimum execution time: 18_079_000 picoseconds. + Weight::from_parts(19_127_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -213,8 +213,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3551` - // Minimum execution time: 19_667_000 picoseconds. - Weight::from_parts(20_437_000, 0) + // Minimum execution time: 19_619_000 picoseconds. + Weight::from_parts(20_325_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -225,8 +225,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3551` - // Minimum execution time: 20_947_000 picoseconds. - Weight::from_parts(21_887_000, 0) + // Minimum execution time: 21_254_000 picoseconds. + Weight::from_parts(21_940_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) @@ -243,8 +243,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `916` // Estimated: `4681` - // Minimum execution time: 33_146_000 picoseconds. - Weight::from_parts(34_424_000, 0) + // Minimum execution time: 33_423_000 picoseconds. + Weight::from_parts(34_716_000, 0) .saturating_add(Weight::from_parts(0, 4681)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -263,8 +263,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `982` // Estimated: `5996` - // Minimum execution time: 40_827_000 picoseconds. - Weight::from_parts(42_091_000, 0) + // Minimum execution time: 40_753_000 picoseconds. + Weight::from_parts(41_553_000, 0) .saturating_add(Weight::from_parts(0, 5996)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -280,11 +280,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `649` // Estimated: `6196 + m * (2520 ±0)` - // Minimum execution time: 67_568_000 picoseconds. - Weight::from_parts(68_621_490, 0) + // Minimum execution time: 68_837_000 picoseconds. + Weight::from_parts(69_547_275, 0) .saturating_add(Weight::from_parts(0, 6196)) - // Standard Error: 50_354 - .saturating_add(Weight::from_parts(1_501_769, 0).saturating_mul(m.into())) + // Standard Error: 56_232 + .saturating_add(Weight::from_parts(1_732_535, 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)) @@ -298,8 +298,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 60_754_000 picoseconds. - Weight::from_parts(62_377_000, 0) + // Minimum execution time: 64_157_000 picoseconds. + Weight::from_parts(65_469_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -312,8 +312,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `445` // Estimated: `3551` - // Minimum execution time: 37_832_000 picoseconds. - Weight::from_parts(41_790_000, 0) + // Minimum execution time: 39_160_000 picoseconds. + Weight::from_parts(42_106_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -328,8 +328,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `442` // Estimated: `3533` - // Minimum execution time: 45_268_000 picoseconds. - Weight::from_parts(49_260_000, 0) + // Minimum execution time: 51_875_000 picoseconds. + Weight::from_parts(56_175_000, 0) .saturating_add(Weight::from_parts(0, 3533)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -346,8 +346,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `855` // Estimated: `3593` - // Minimum execution time: 57_254_000 picoseconds. - Weight::from_parts(66_693_000, 0) + // Minimum execution time: 67_412_000 picoseconds. + Weight::from_parts(75_499_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -360,8 +360,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `936` // Estimated: `4698` - // Minimum execution time: 35_473_000 picoseconds. - Weight::from_parts(38_959_000, 0) + // Minimum execution time: 40_563_000 picoseconds. + Weight::from_parts(45_359_000, 0) .saturating_add(Weight::from_parts(0, 4698)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -369,13 +369,15 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `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: `0` // Estimated: `3465` - // Minimum execution time: 13_587_000 picoseconds. - Weight::from_parts(17_521_302, 0) + // Minimum execution time: 21_828_000 picoseconds. + Weight::from_parts(35_880_725, 0) .saturating_add(Weight::from_parts(0, 3465)) + // Standard Error: 1_415 + .saturating_add(Weight::from_parts(3_256, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Broker::CoreCountInbox` (r:1 w:1) @@ -385,8 +387,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `208` // Estimated: `1487` - // Minimum execution time: 6_952_000 picoseconds. - Weight::from_parts(7_430_700, 0) + // Minimum execution time: 6_911_000 picoseconds. + Weight::from_parts(7_609_428, 0) .saturating_add(Weight::from_parts(0, 1487)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -401,8 +403,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `440` // Estimated: `6196` - // Minimum execution time: 54_469_000 picoseconds. - Weight::from_parts(55_909_000, 0) + // Minimum execution time: 55_057_000 picoseconds. + Weight::from_parts(56_475_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -433,12 +435,12 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { fn rotate_sale(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `32278` - // Estimated: `233641 + n * (198 ±0)` - // Minimum execution time: 26_967_000 picoseconds. - Weight::from_parts(2_608_120_906, 0) + // Estimated: `233641 + n * (198 ±9)` + // Minimum execution time: 27_257_000 picoseconds. + Weight::from_parts(2_662_011_487, 0) .saturating_add(Weight::from_parts(0, 233641)) - // Standard Error: 158_189 - .saturating_add(Weight::from_parts(3_910_138, 0).saturating_mul(n.into())) + // Standard Error: 162_108 + .saturating_add(Weight::from_parts(4_134_195, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(126)) .saturating_add(T::DbWeight::get().writes(181)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -452,8 +454,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3493` - // Minimum execution time: 4_947_000 picoseconds. - Weight::from_parts(5_218_000, 0) + // Minimum execution time: 5_245_000 picoseconds. + Weight::from_parts(5_537_000, 0) .saturating_add(Weight::from_parts(0, 3493)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -468,8 +470,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `1223` // Estimated: `4688` - // Minimum execution time: 26_345_000 picoseconds. - Weight::from_parts(27_141_000, 0) + // Minimum execution time: 26_782_000 picoseconds. + Weight::from_parts(27_767_000, 0) .saturating_add(Weight::from_parts(0, 4688)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -480,8 +482,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 7_982_000 picoseconds. - Weight::from_parts(10_628_000, 0) + // Minimum execution time: 8_475_000 picoseconds. + Weight::from_parts(11_257_000, 0) .saturating_add(Weight::from_parts(0, 3465)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -491,8 +493,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_893_000 picoseconds. - Weight::from_parts(2_080_000, 0) + // Minimum execution time: 1_899_000 picoseconds. + Weight::from_parts(2_021_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -502,8 +504,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_900_000 picoseconds. - Weight::from_parts(2_028_000, 0) + // Minimum execution time: 1_980_000 picoseconds. + Weight::from_parts(2_053_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -521,8 +523,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `327` // Estimated: `1812` - // Minimum execution time: 12_838_000 picoseconds. - Weight::from_parts(13_387_000, 0) + // Minimum execution time: 12_474_000 picoseconds. + Weight::from_parts(12_970_000, 0) .saturating_add(Weight::from_parts(0, 1812)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) @@ -539,8 +541,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `11120` // Estimated: `13506` - // Minimum execution time: 38_247_000 picoseconds. - Weight::from_parts(40_006_000, 0) + // Minimum execution time: 38_182_000 picoseconds. + Weight::from_parts(39_394_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -551,8 +553,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `408` // Estimated: `1886` - // Minimum execution time: 5_293_000 picoseconds. - Weight::from_parts(5_636_000, 0) + // Minimum execution time: 5_317_000 picoseconds. + Weight::from_parts(5_693_000, 0) .saturating_add(Weight::from_parts(0, 1886)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -577,8 +579,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `2748` // Estimated: `6196` - // Minimum execution time: 118_555_000 picoseconds. - Weight::from_parts(124_311_000, 0) + // Minimum execution time: 123_214_000 picoseconds. + Weight::from_parts(132_950_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(7)) @@ -589,8 +591,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `1286` // Estimated: `2487` - // Minimum execution time: 23_909_000 picoseconds. - Weight::from_parts(26_797_000, 0) + // Minimum execution time: 24_008_000 picoseconds. + Weight::from_parts(25_836_000, 0) .saturating_add(Weight::from_parts(0, 2487)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -603,10 +605,22 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 49_039_000 picoseconds. - Weight::from_parts(50_172_000, 0) + // Minimum execution time: 49_816_000 picoseconds. + Weight::from_parts(51_389_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `Broker::Workplan` (r:1 w:1) + /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) + fn remove_assignment() -> Weight { + // Proof Size summary in bytes: + // Measured: `777` + // Estimated: `4681` + // Minimum execution time: 18_714_000 picoseconds. + Weight::from_parts(19_800_000, 0) + .saturating_add(Weight::from_parts(0, 4681)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_broker.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_broker.rs index e865f7e3a36..84b79da713c 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_broker.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_broker.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_broker` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `3d3aa761b4e4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `2da613459306`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -58,8 +58,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_965_000 picoseconds. - Weight::from_parts(2_076_000, 0) + // Minimum execution time: 2_220_000 picoseconds. + Weight::from_parts(2_304_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `10826` // Estimated: `13506` - // Minimum execution time: 21_785_000 picoseconds. - Weight::from_parts(22_243_000, 0) + // Minimum execution time: 22_227_000 picoseconds. + Weight::from_parts(22_647_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -81,8 +81,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `12028` // Estimated: `13506` - // Minimum execution time: 20_848_000 picoseconds. - Weight::from_parts(21_014_000, 0) + // Minimum execution time: 21_649_000 picoseconds. + Weight::from_parts(22_185_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `80` // Estimated: `1566` - // Minimum execution time: 9_102_000 picoseconds. - Weight::from_parts(9_645_000, 0) + // Minimum execution time: 9_208_000 picoseconds. + Weight::from_parts(9_647_000, 0) .saturating_add(Weight::from_parts(0, 1566)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -142,11 +142,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `12185` // Estimated: `14711 + n * (1 ±0)` - // Minimum execution time: 46_724_000 picoseconds. - Weight::from_parts(91_319_033, 0) + // Minimum execution time: 47_150_000 picoseconds. + Weight::from_parts(92_303_734, 0) .saturating_add(Weight::from_parts(0, 14711)) - // Standard Error: 1_009 - .saturating_add(Weight::from_parts(6_084, 0).saturating_mul(n.into())) + // Standard Error: 1_006 + .saturating_add(Weight::from_parts(5_339, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(25)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) @@ -165,8 +165,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `356` // Estimated: `3593` - // Minimum execution time: 56_441_000 picoseconds. - Weight::from_parts(58_144_000, 0) + // Minimum execution time: 55_570_000 picoseconds. + Weight::from_parts(57_144_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -189,8 +189,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `577` // Estimated: `4698` - // Minimum execution time: 89_738_000 picoseconds. - Weight::from_parts(91_728_000, 0) + // Minimum execution time: 94_812_000 picoseconds. + Weight::from_parts(107_167_000, 0) .saturating_add(Weight::from_parts(0, 4698)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) @@ -201,8 +201,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3551` - // Minimum execution time: 17_422_000 picoseconds. - Weight::from_parts(17_953_000, 0) + // Minimum execution time: 17_630_000 picoseconds. + Weight::from_parts(18_504_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -213,8 +213,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3551` - // Minimum execution time: 19_091_000 picoseconds. - Weight::from_parts(19_825_000, 0) + // Minimum execution time: 19_737_000 picoseconds. + Weight::from_parts(20_986_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -225,8 +225,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `337` // Estimated: `3551` - // Minimum execution time: 20_538_000 picoseconds. - Weight::from_parts(21_018_000, 0) + // Minimum execution time: 20_954_000 picoseconds. + Weight::from_parts(21_730_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) @@ -243,8 +243,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `715` // Estimated: `4681` - // Minimum execution time: 31_287_000 picoseconds. - Weight::from_parts(32_190_000, 0) + // Minimum execution time: 32_156_000 picoseconds. + Weight::from_parts(33_365_000, 0) .saturating_add(Weight::from_parts(0, 4681)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -263,8 +263,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `781` // Estimated: `5996` - // Minimum execution time: 38_372_000 picoseconds. - Weight::from_parts(39_684_000, 0) + // Minimum execution time: 38_327_000 picoseconds. + Weight::from_parts(39_866_000, 0) .saturating_add(Weight::from_parts(0, 5996)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -280,11 +280,11 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `649` // Estimated: `6196 + m * (2520 ±0)` - // Minimum execution time: 68_600_000 picoseconds. - Weight::from_parts(69_000_986, 0) + // Minimum execution time: 68_467_000 picoseconds. + Weight::from_parts(69_050_766, 0) .saturating_add(Weight::from_parts(0, 6196)) - // Standard Error: 48_024 - .saturating_add(Weight::from_parts(1_786_360, 0).saturating_mul(m.into())) + // Standard Error: 47_529 + .saturating_add(Weight::from_parts(1_772_345, 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)) @@ -298,8 +298,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 60_734_000 picoseconds. - Weight::from_parts(62_365_000, 0) + // Minimum execution time: 60_373_000 picoseconds. + Weight::from_parts(62_315_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -312,8 +312,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `445` // Estimated: `3551` - // Minimum execution time: 35_204_000 picoseconds. - Weight::from_parts(38_437_000, 0) + // Minimum execution time: 40_559_000 picoseconds. + Weight::from_parts(48_345_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -328,8 +328,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `442` // Estimated: `3533` - // Minimum execution time: 45_583_000 picoseconds. - Weight::from_parts(51_523_000, 0) + // Minimum execution time: 53_667_000 picoseconds. + Weight::from_parts(60_966_000, 0) .saturating_add(Weight::from_parts(0, 3533)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -346,8 +346,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `855` // Estimated: `3593` - // Minimum execution time: 58_254_000 picoseconds. - Weight::from_parts(62_156_000, 0) + // Minimum execution time: 63_550_000 picoseconds. + Weight::from_parts(69_714_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -360,8 +360,7 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `535` // Estimated: `4698` - // Minimum execution time: 33_857_000 picoseconds. - Weight::from_parts(37_186_000, 0) + Weight::from_parts(39_990_000, 0) .saturating_add(Weight::from_parts(0, 4698)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -369,13 +368,15 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `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: `0` // Estimated: `3465` - // Minimum execution time: 13_620_000 picoseconds. - Weight::from_parts(17_342_552, 0) + // Minimum execution time: 13_953_000 picoseconds. + Weight::from_parts(17_419_892, 0) .saturating_add(Weight::from_parts(0, 3465)) + // Standard Error: 54 + .saturating_add(Weight::from_parts(139, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Broker::CoreCountInbox` (r:1 w:1) @@ -385,8 +386,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `208` // Estimated: `1487` - // Minimum execution time: 6_540_000 picoseconds. - Weight::from_parts(7_024_123, 0) + // Minimum execution time: 6_820_000 picoseconds. + Weight::from_parts(7_247_418, 0) .saturating_add(Weight::from_parts(0, 1487)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -401,8 +402,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `440` // Estimated: `6196` - // Minimum execution time: 49_713_000 picoseconds. - Weight::from_parts(53_514_000, 0) + // Minimum execution time: 55_301_000 picoseconds. + Weight::from_parts(56_710_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -433,12 +434,12 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { fn rotate_sale(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `16294` - // Estimated: `69404 + n * (8 ±0)` - // Minimum execution time: 27_718_000 picoseconds. - Weight::from_parts(833_814_401, 0) + // Estimated: `69404 + n * (8 ±1)` + // Minimum execution time: 28_821_000 picoseconds. + Weight::from_parts(985_823_650, 0) .saturating_add(Weight::from_parts(0, 69404)) - // Standard Error: 26_834 - .saturating_add(Weight::from_parts(1_447_378, 0).saturating_mul(n.into())) + // Standard Error: 33_666 + .saturating_add(Weight::from_parts(1_561_298, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(44)) .saturating_add(T::DbWeight::get().writes(57)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -452,8 +453,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3493` - // Minimum execution time: 5_288_000 picoseconds. - Weight::from_parts(5_696_000, 0) + // Minimum execution time: 5_904_000 picoseconds. + Weight::from_parts(6_152_000, 0) .saturating_add(Weight::from_parts(0, 3493)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -468,8 +469,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `1223` // Estimated: `4688` - // Minimum execution time: 26_479_000 picoseconds. - Weight::from_parts(27_129_000, 0) + // Minimum execution time: 28_080_000 picoseconds. + Weight::from_parts(28_560_000, 0) .saturating_add(Weight::from_parts(0, 4688)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -480,8 +481,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3465` - // Minimum execution time: 8_553_000 picoseconds. - Weight::from_parts(11_110_000, 0) + // Minimum execution time: 8_883_000 picoseconds. + Weight::from_parts(11_990_000, 0) .saturating_add(Weight::from_parts(0, 3465)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -491,8 +492,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_899_000 picoseconds. - Weight::from_parts(2_041_000, 0) + // Minimum execution time: 2_010_000 picoseconds. + Weight::from_parts(2_138_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -502,8 +503,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_977_000 picoseconds. - Weight::from_parts(2_092_000, 0) + // Minimum execution time: 2_076_000 picoseconds. + Weight::from_parts(2_241_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -521,8 +522,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `327` // Estimated: `1812` - // Minimum execution time: 12_227_000 picoseconds. - Weight::from_parts(12_849_000, 0) + // Minimum execution time: 12_724_000 picoseconds. + Weight::from_parts(13_255_000, 0) .saturating_add(Weight::from_parts(0, 1812)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) @@ -539,8 +540,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `11120` // Estimated: `13506` - // Minimum execution time: 37_190_000 picoseconds. - Weight::from_parts(38_297_000, 0) + // Minimum execution time: 38_508_000 picoseconds. + Weight::from_parts(39_408_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -551,8 +552,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `88` // Estimated: `1566` - // Minimum execution time: 4_937_000 picoseconds. - Weight::from_parts(5_237_000, 0) + // Minimum execution time: 5_092_000 picoseconds. + Weight::from_parts(5_340_000, 0) .saturating_add(Weight::from_parts(0, 1566)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -577,8 +578,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `1370` // Estimated: `6196` - // Minimum execution time: 112_871_000 picoseconds. - Weight::from_parts(117_045_000, 0) + // Minimum execution time: 143_548_000 picoseconds. + Weight::from_parts(150_897_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(6)) @@ -589,8 +590,8 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `485` // Estimated: `1686` - // Minimum execution time: 17_566_000 picoseconds. - Weight::from_parts(18_037_000, 0) + // Minimum execution time: 17_438_000 picoseconds. + Weight::from_parts(18_326_000, 0) .saturating_add(Weight::from_parts(0, 1686)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -601,9 +602,21 @@ impl<T: frame_system::Config> pallet_broker::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 4_814_000 picoseconds. - Weight::from_parts(4_996_000, 0) + // Minimum execution time: 4_804_000 picoseconds. + Weight::from_parts(5_101_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) } + /// Storage: `Broker::Workplan` (r:1 w:1) + /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) + fn remove_assignment() -> Weight { + // Proof Size summary in bytes: + // Measured: `581` + // Estimated: `4681` + // Minimum execution time: 18_102_000 picoseconds. + Weight::from_parts(18_785_000, 0) + .saturating_add(Weight::from_parts(0, 4681)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/prdoc/pr_7080.prdoc b/prdoc/pr_7080.prdoc new file mode 100644 index 00000000000..ae464483857 --- /dev/null +++ b/prdoc/pr_7080.prdoc @@ -0,0 +1,17 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: "[pallet-broker] add extrinsic to remove an assignment" + +doc: + - audience: Runtime User + description: | + A new `remove_assignment` extrinsic is introduced to the broker pallet to allow an assignment to be removed by the root origin. + +crates: + - name: pallet-broker + bump: major + - name: coretime-rococo-runtime + bump: patch + - name: coretime-westend-runtime + bump: patch diff --git a/substrate/frame/broker/src/benchmarking.rs b/substrate/frame/broker/src/benchmarking.rs index 65a8b1803b0..58c8689c549 100644 --- a/substrate/frame/broker/src/benchmarking.rs +++ b/substrate/frame/broker/src/benchmarking.rs @@ -1225,6 +1225,33 @@ mod benches { Ok(()) } + #[benchmark] + fn remove_assignment() -> Result<(), BenchmarkError> { + setup_and_start_sale::<T>()?; + + advance_to::<T>(2); + + let caller: T::AccountId = whitelisted_caller(); + T::Currency::set_balance( + &caller.clone(), + T::Currency::minimum_balance().saturating_add(10_000_000u32.into()), + ); + + let region = Broker::<T>::do_purchase(caller.clone(), 10_000_000u32.into()) + .expect("Offer not high enough for configuration."); + + Broker::<T>::do_assign(region, None, 1000, Provisional) + .map_err(|_| BenchmarkError::Weightless)?; + + let origin = + T::AdminOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, region); + + 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); diff --git a/substrate/frame/broker/src/dispatchable_impls.rs b/substrate/frame/broker/src/dispatchable_impls.rs index 057e94ca3de..79d671d7432 100644 --- a/substrate/frame/broker/src/dispatchable_impls.rs +++ b/substrate/frame/broker/src/dispatchable_impls.rs @@ -350,6 +350,14 @@ impl<T: Config> Pallet<T> { Ok(()) } + pub(crate) fn do_remove_assignment(region_id: RegionId) -> DispatchResult { + let workplan_key = (region_id.begin, region_id.core); + ensure!(Workplan::<T>::contains_key(&workplan_key), Error::<T>::AssignmentNotFound); + Workplan::<T>::remove(&workplan_key); + Self::deposit_event(Event::<T>::AssignmentRemoved { region_id }); + Ok(()) + } + pub(crate) fn do_pool( region_id: RegionId, maybe_check_owner: Option<T::AccountId>, diff --git a/substrate/frame/broker/src/lib.rs b/substrate/frame/broker/src/lib.rs index 86461e903f6..3ecfec6b643 100644 --- a/substrate/frame/broker/src/lib.rs +++ b/substrate/frame/broker/src/lib.rs @@ -279,6 +279,11 @@ pub mod pallet { /// The task to which the Region was assigned. task: TaskId, }, + /// An assignment has been removed from the workplan. + AssignmentRemoved { + /// The Region which was removed from the workplan. + region_id: RegionId, + }, /// A Region has been added to the Instantaneous Coretime Pool. Pooled { /// The Region which was added to the Instantaneous Coretime Pool. @@ -558,6 +563,8 @@ pub mod pallet { SovereignAccountNotFound, /// Attempted to disable auto-renewal for a core that didn't have it enabled. AutoRenewalNotEnabled, + /// Attempted to force remove an assignment that doesn't exist. + AssignmentNotFound, /// Needed to prevent spam attacks.The amount of credits the user attempted to purchase is /// below `T::MinimumCreditPurchase`. CreditPurchaseTooSmall, @@ -996,6 +1003,16 @@ pub mod pallet { Self::do_remove_lease(task) } + /// Remove an assignment from the Workplan. + /// + /// - `origin`: Must be Root or pass `AdminOrigin`. + /// - `region_id`: The Region to be removed from the workplan. + #[pallet::call_index(26)] + pub fn remove_assignment(origin: OriginFor<T>, region_id: RegionId) -> DispatchResult { + T::AdminOrigin::ensure_origin_or_root(origin)?; + Self::do_remove_assignment(region_id) + } + #[pallet::call_index(99)] #[pallet::weight(T::WeightInfo::swap_leases())] pub fn swap_leases(origin: OriginFor<T>, id: TaskId, other: TaskId) -> DispatchResult { diff --git a/substrate/frame/broker/src/tests.rs b/substrate/frame/broker/src/tests.rs index ffb45e73547..2e04f7201f8 100644 --- a/substrate/frame/broker/src/tests.rs +++ b/substrate/frame/broker/src/tests.rs @@ -25,7 +25,10 @@ use frame_support::{ }; use frame_system::RawOrigin::Root; use pretty_assertions::assert_eq; -use sp_runtime::{traits::Get, Perbill, TokenError}; +use sp_runtime::{ + traits::{BadOrigin, Get}, + Perbill, TokenError, +}; use CoreAssignment::*; use CoretimeTraceItem::*; use Finality::*; @@ -1848,6 +1851,25 @@ fn disable_auto_renew_works() { }); } +#[test] +fn remove_assignment_works() { + TestExt::new().endow(1, 1000).execute_with(|| { + assert_ok!(Broker::do_start_sales(100, 1)); + advance_to(2); + let region_id = Broker::do_purchase(1, u64::max_value()).unwrap(); + assert_ok!(Broker::do_assign(region_id, Some(1), 1001, Final)); + let workplan_key = (region_id.begin, region_id.core); + assert_ne!(Workplan::<Test>::get(workplan_key), None); + assert_noop!(Broker::remove_assignment(RuntimeOrigin::signed(2), region_id), BadOrigin); + assert_ok!(Broker::remove_assignment(RuntimeOrigin::root(), region_id)); + assert_eq!(Workplan::<Test>::get(workplan_key), None); + assert_noop!( + Broker::remove_assignment(RuntimeOrigin::root(), region_id), + Error::<Test>::AssignmentNotFound + ); + }); +} + #[test] fn start_sales_sets_correct_core_count() { TestExt::new().endow(1, 1000).execute_with(|| { diff --git a/substrate/frame/broker/src/weights.rs b/substrate/frame/broker/src/weights.rs index 64392da057f..d26cbcb1426 100644 --- a/substrate/frame/broker/src/weights.rs +++ b/substrate/frame/broker/src/weights.rs @@ -18,9 +18,9 @@ //! Autogenerated weights for `pallet_broker` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-02-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `2df7bb537484`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `9f21ee06036e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` // Executed Command: @@ -48,7 +48,7 @@ #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] -#[allow(dead_code)] +#![allow(dead_code)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; @@ -89,6 +89,7 @@ pub trait WeightInfo { fn enable_auto_renew() -> Weight; fn disable_auto_renew() -> Weight; fn on_new_timeslice() -> Weight; + fn remove_assignment() -> Weight; } /// Weights for `pallet_broker` using the Substrate node and recommended hardware. @@ -100,8 +101,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_017_000 picoseconds. - Weight::from_parts(2_192_000, 0) + // Minimum execution time: 1_970_000 picoseconds. + Weight::from_parts(2_010_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Broker::Reservations` (r:1 w:1) @@ -110,8 +111,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `4816` // Estimated: `7496` - // Minimum execution time: 15_233_000 picoseconds. - Weight::from_parts(15_913_000, 7496) + // Minimum execution time: 15_223_000 picoseconds. + Weight::from_parts(15_546_000, 7496) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -121,8 +122,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `6018` // Estimated: `7496` - // Minimum execution time: 14_470_000 picoseconds. - Weight::from_parts(14_666_000, 7496) + // Minimum execution time: 14_410_000 picoseconds. + Weight::from_parts(14_781_000, 7496) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -169,10 +170,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `6134` // Estimated: `8499` - // Minimum execution time: 28_238_000 picoseconds. - Weight::from_parts(50_117_438, 8499) - // Standard Error: 477 - .saturating_add(Weight::from_parts(2_668, 0).saturating_mul(n.into())) + // Minimum execution time: 27_824_000 picoseconds. + Weight::from_parts(50_610_414, 8499) + // Standard Error: 515 + .saturating_add(Weight::from_parts(3_396, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(16_u64)) } @@ -186,8 +187,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `274` // Estimated: `1542` - // Minimum execution time: 37_190_000 picoseconds. - Weight::from_parts(38_212_000, 1542) + // Minimum execution time: 36_411_000 picoseconds. + Weight::from_parts(38_093_000, 1542) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -205,8 +206,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `392` // Estimated: `4698` - // Minimum execution time: 61_974_000 picoseconds. - Weight::from_parts(63_595_000, 4698) + // Minimum execution time: 61_900_000 picoseconds. + Weight::from_parts(63_344_000, 4698) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -216,8 +217,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3551` - // Minimum execution time: 15_841_000 picoseconds. - Weight::from_parts(16_865_000, 3551) + // Minimum execution time: 15_522_000 picoseconds. + Weight::from_parts(16_609_000, 3551) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -227,8 +228,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3551` - // Minimum execution time: 17_493_000 picoseconds. - Weight::from_parts(18_105_000, 3551) + // Minimum execution time: 17_308_000 picoseconds. + Weight::from_parts(18_043_000, 3551) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -238,8 +239,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3551` - // Minimum execution time: 18_314_000 picoseconds. - Weight::from_parts(18_957_000, 3551) + // Minimum execution time: 18_042_000 picoseconds. + Weight::from_parts(18_911_000, 3551) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -255,8 +256,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `545` // Estimated: `4681` - // Minimum execution time: 30_157_000 picoseconds. - Weight::from_parts(31_094_000, 4681) + // Minimum execution time: 30_363_000 picoseconds. + Weight::from_parts(31_434_000, 4681) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -274,8 +275,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `580` // Estimated: `5996` - // Minimum execution time: 36_356_000 picoseconds. - Weight::from_parts(37_866_000, 5996) + // Minimum execution time: 36_648_000 picoseconds. + Weight::from_parts(37_773_000, 5996) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -290,10 +291,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `682` // Estimated: `6196 + m * (2520 ±0)` - // Minimum execution time: 70_609_000 picoseconds. - Weight::from_parts(71_711_714, 6196) - // Standard Error: 70_993 - .saturating_add(Weight::from_parts(2_058_402, 0).saturating_mul(m.into())) + // Minimum execution time: 68_215_000 picoseconds. + Weight::from_parts(69_303_342, 6196) + // Standard Error: 60_821 + .saturating_add(Weight::from_parts(1_916_553, 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)) @@ -305,8 +306,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 45_375_000 picoseconds. - Weight::from_parts(45_964_000, 3593) + // Minimum execution time: 43_439_000 picoseconds. + Weight::from_parts(44_278_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -318,8 +319,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `408` // Estimated: `3551` - // Minimum execution time: 28_944_000 picoseconds. - Weight::from_parts(32_073_000, 3551) + // Minimum execution time: 28_074_000 picoseconds. + Weight::from_parts(31_676_000, 3551) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -333,8 +334,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `405` // Estimated: `3533` - // Minimum execution time: 39_820_000 picoseconds. - Weight::from_parts(42_933_000, 3533) + // Minimum execution time: 36_964_000 picoseconds. + Weight::from_parts(38_784_000, 3533) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -350,8 +351,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `818` // Estimated: `3593` - // Minimum execution time: 50_850_000 picoseconds. - Weight::from_parts(53_954_000, 3593) + // Minimum execution time: 49_077_000 picoseconds. + Weight::from_parts(54_396_000, 3593) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -363,8 +364,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `465` // Estimated: `4698` - // Minimum execution time: 29_553_000 picoseconds. - Weight::from_parts(31_880_000, 4698) + // Minimum execution time: 29_487_000 picoseconds. + Weight::from_parts(32_079_000, 4698) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -373,10 +374,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_894_000 picoseconds. - Weight::from_parts(4_121_686, 0) + // Minimum execution time: 3_718_000 picoseconds. + Weight::from_parts(3_944_873, 0) // Standard Error: 8 - .saturating_add(Weight::from_parts(30, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(2, 0).saturating_mul(n.into())) } /// Storage: `Broker::CoreCountInbox` (r:1 w:1) /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) @@ -385,8 +386,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `208` // Estimated: `1487` - // Minimum execution time: 5_929_000 picoseconds. - Weight::from_parts(6_256_892, 1487) + // Minimum execution time: 5_828_000 picoseconds. + Weight::from_parts(6_199_804, 1487) // Standard Error: 13 .saturating_add(Weight::from_parts(45, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) @@ -402,8 +403,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3593` - // Minimum execution time: 39_680_000 picoseconds. - Weight::from_parts(40_611_000, 3593) + // Minimum execution time: 38_383_000 picoseconds. + Weight::from_parts(39_390_000, 3593) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -432,10 +433,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `8126` // Estimated: `38070` - // Minimum execution time: 22_694_000 picoseconds. - Weight::from_parts(332_268_249, 38070) - // Standard Error: 7_033 - .saturating_add(Weight::from_parts(1_280_706, 0).saturating_mul(n.into())) + // Minimum execution time: 22_037_000 picoseconds. + Weight::from_parts(323_459_518, 38070) + // Standard Error: 6_945 + .saturating_add(Weight::from_parts(1_356_460, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(26_u64)) .saturating_add(T::DbWeight::get().writes(34_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -448,8 +449,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3493` - // Minimum execution time: 5_087_000 picoseconds. - Weight::from_parts(5_335_000, 3493) + // Minimum execution time: 4_928_000 picoseconds. + Weight::from_parts(5_182_000, 3493) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -461,8 +462,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `1223` // Estimated: `4681` - // Minimum execution time: 12_425_000 picoseconds. - Weight::from_parts(12_645_000, 4681) + // Minimum execution time: 11_814_000 picoseconds. + Weight::from_parts(12_194_000, 4681) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -470,8 +471,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 150_000 picoseconds. - Weight::from_parts(183_000, 0) + // Minimum execution time: 130_000 picoseconds. + Weight::from_parts(138_000, 0) } /// Storage: `Broker::CoreCountInbox` (r:0 w:1) /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) @@ -479,8 +480,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_843_000 picoseconds. - Weight::from_parts(1_956_000, 0) + // Minimum execution time: 1_791_000 picoseconds. + Weight::from_parts(1_898_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Broker::RevenueInbox` (r:0 w:1) @@ -489,8 +490,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_003_000 picoseconds. - Weight::from_parts(2_112_000, 0) + // Minimum execution time: 1_973_000 picoseconds. + Weight::from_parts(2_069_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `Broker::Status` (r:1 w:1) @@ -505,8 +506,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `245` // Estimated: `1516` - // Minimum execution time: 10_788_000 picoseconds. - Weight::from_parts(11_114_000, 1516) + // Minimum execution time: 10_337_000 picoseconds. + Weight::from_parts(10_769_000, 1516) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -522,8 +523,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `5073` // Estimated: `7496` - // Minimum execution time: 27_620_000 picoseconds. - Weight::from_parts(28_574_000, 7496) + // Minimum execution time: 27_540_000 picoseconds. + Weight::from_parts(28_141_000, 7496) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -533,8 +534,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `39` // Estimated: `1526` - // Minimum execution time: 4_592_000 picoseconds. - Weight::from_parts(4_827_000, 1526) + // Minimum execution time: 4_651_000 picoseconds. + Weight::from_parts(4_874_000, 1526) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -556,8 +557,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `888` // Estimated: `4698` - // Minimum execution time: 77_091_000 picoseconds. - Weight::from_parts(79_410_000, 4698) + // Minimum execution time: 76_761_000 picoseconds. + Weight::from_parts(81_115_000, 4698) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -567,8 +568,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `382` // Estimated: `1586` - // Minimum execution time: 14_367_000 picoseconds. - Weight::from_parts(15_206_000, 1586) + // Minimum execution time: 13_934_000 picoseconds. + Weight::from_parts(14_716_000, 1586) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -576,8 +577,19 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 232_000 picoseconds. - Weight::from_parts(257_000, 0) + // Minimum execution time: 241_000 picoseconds. + Weight::from_parts(260_000, 0) + } + /// Storage: `Broker::Workplan` (r:1 w:1) + /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) + fn remove_assignment() -> Weight { + // Proof Size summary in bytes: + // Measured: `408` + // Estimated: `4681` + // Minimum execution time: 14_586_000 picoseconds. + Weight::from_parts(15_270_000, 4681) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } @@ -589,8 +601,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_017_000 picoseconds. - Weight::from_parts(2_192_000, 0) + // Minimum execution time: 1_970_000 picoseconds. + Weight::from_parts(2_010_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Broker::Reservations` (r:1 w:1) @@ -599,8 +611,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `4816` // Estimated: `7496` - // Minimum execution time: 15_233_000 picoseconds. - Weight::from_parts(15_913_000, 7496) + // Minimum execution time: 15_223_000 picoseconds. + Weight::from_parts(15_546_000, 7496) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -610,8 +622,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `6018` // Estimated: `7496` - // Minimum execution time: 14_470_000 picoseconds. - Weight::from_parts(14_666_000, 7496) + // Minimum execution time: 14_410_000 picoseconds. + Weight::from_parts(14_781_000, 7496) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -622,7 +634,7 @@ impl WeightInfo for () { // Measured: `39` // Estimated: `1526` // Minimum execution time: 7_751_000 picoseconds. - Weight::from_parts(8_066_000, 1526) + Weight::from_parts(8_040_000, 1526) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -658,10 +670,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `6134` // Estimated: `8499` - // Minimum execution time: 28_238_000 picoseconds. - Weight::from_parts(50_117_438, 8499) - // Standard Error: 477 - .saturating_add(Weight::from_parts(2_668, 0).saturating_mul(n.into())) + // Minimum execution time: 27_824_000 picoseconds. + Weight::from_parts(50_610_414, 8499) + // Standard Error: 515 + .saturating_add(Weight::from_parts(3_396, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(16_u64)) } @@ -675,8 +687,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `274` // Estimated: `1542` - // Minimum execution time: 37_190_000 picoseconds. - Weight::from_parts(38_212_000, 1542) + // Minimum execution time: 36_411_000 picoseconds. + Weight::from_parts(38_093_000, 1542) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -694,8 +706,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `392` // Estimated: `4698` - // Minimum execution time: 61_974_000 picoseconds. - Weight::from_parts(63_595_000, 4698) + // Minimum execution time: 61_900_000 picoseconds. + Weight::from_parts(63_344_000, 4698) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -705,8 +717,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3551` - // Minimum execution time: 15_841_000 picoseconds. - Weight::from_parts(16_865_000, 3551) + // Minimum execution time: 15_522_000 picoseconds. + Weight::from_parts(16_609_000, 3551) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -716,8 +728,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3551` - // Minimum execution time: 17_493_000 picoseconds. - Weight::from_parts(18_105_000, 3551) + // Minimum execution time: 17_308_000 picoseconds. + Weight::from_parts(18_043_000, 3551) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -727,8 +739,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `300` // Estimated: `3551` - // Minimum execution time: 18_314_000 picoseconds. - Weight::from_parts(18_957_000, 3551) + // Minimum execution time: 18_042_000 picoseconds. + Weight::from_parts(18_911_000, 3551) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -744,8 +756,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `545` // Estimated: `4681` - // Minimum execution time: 30_157_000 picoseconds. - Weight::from_parts(31_094_000, 4681) + // Minimum execution time: 30_363_000 picoseconds. + Weight::from_parts(31_434_000, 4681) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -763,8 +775,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `580` // Estimated: `5996` - // Minimum execution time: 36_356_000 picoseconds. - Weight::from_parts(37_866_000, 5996) + // Minimum execution time: 36_648_000 picoseconds. + Weight::from_parts(37_773_000, 5996) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -779,10 +791,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `682` // Estimated: `6196 + m * (2520 ±0)` - // Minimum execution time: 70_609_000 picoseconds. - Weight::from_parts(71_711_714, 6196) - // Standard Error: 70_993 - .saturating_add(Weight::from_parts(2_058_402, 0).saturating_mul(m.into())) + // Minimum execution time: 68_215_000 picoseconds. + Weight::from_parts(69_303_342, 6196) + // Standard Error: 60_821 + .saturating_add(Weight::from_parts(1_916_553, 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)) @@ -794,8 +806,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 45_375_000 picoseconds. - Weight::from_parts(45_964_000, 3593) + // Minimum execution time: 43_439_000 picoseconds. + Weight::from_parts(44_278_000, 3593) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -807,8 +819,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `408` // Estimated: `3551` - // Minimum execution time: 28_944_000 picoseconds. - Weight::from_parts(32_073_000, 3551) + // Minimum execution time: 28_074_000 picoseconds. + Weight::from_parts(31_676_000, 3551) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -822,8 +834,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `405` // Estimated: `3533` - // Minimum execution time: 39_820_000 picoseconds. - Weight::from_parts(42_933_000, 3533) + // Minimum execution time: 36_964_000 picoseconds. + Weight::from_parts(38_784_000, 3533) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -839,8 +851,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `818` // Estimated: `3593` - // Minimum execution time: 50_850_000 picoseconds. - Weight::from_parts(53_954_000, 3593) + // Minimum execution time: 49_077_000 picoseconds. + Weight::from_parts(54_396_000, 3593) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -852,8 +864,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `465` // Estimated: `4698` - // Minimum execution time: 29_553_000 picoseconds. - Weight::from_parts(31_880_000, 4698) + // Minimum execution time: 29_487_000 picoseconds. + Weight::from_parts(32_079_000, 4698) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -862,10 +874,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_894_000 picoseconds. - Weight::from_parts(4_121_686, 0) + // Minimum execution time: 3_718_000 picoseconds. + Weight::from_parts(3_944_873, 0) // Standard Error: 8 - .saturating_add(Weight::from_parts(30, 0).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(2, 0).saturating_mul(n.into())) } /// Storage: `Broker::CoreCountInbox` (r:1 w:1) /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) @@ -874,8 +886,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `208` // Estimated: `1487` - // Minimum execution time: 5_929_000 picoseconds. - Weight::from_parts(6_256_892, 1487) + // Minimum execution time: 5_828_000 picoseconds. + Weight::from_parts(6_199_804, 1487) // Standard Error: 13 .saturating_add(Weight::from_parts(45, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) @@ -891,8 +903,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `471` // Estimated: `3593` - // Minimum execution time: 39_680_000 picoseconds. - Weight::from_parts(40_611_000, 3593) + // Minimum execution time: 38_383_000 picoseconds. + Weight::from_parts(39_390_000, 3593) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -921,10 +933,10 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `8126` // Estimated: `38070` - // Minimum execution time: 22_694_000 picoseconds. - Weight::from_parts(332_268_249, 38070) - // Standard Error: 7_033 - .saturating_add(Weight::from_parts(1_280_706, 0).saturating_mul(n.into())) + // Minimum execution time: 22_037_000 picoseconds. + Weight::from_parts(323_459_518, 38070) + // Standard Error: 6_945 + .saturating_add(Weight::from_parts(1_356_460, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(26_u64)) .saturating_add(RocksDbWeight::get().writes(34_u64)) .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -937,8 +949,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3493` - // Minimum execution time: 5_087_000 picoseconds. - Weight::from_parts(5_335_000, 3493) + // Minimum execution time: 4_928_000 picoseconds. + Weight::from_parts(5_182_000, 3493) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -950,8 +962,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1223` // Estimated: `4681` - // Minimum execution time: 12_425_000 picoseconds. - Weight::from_parts(12_645_000, 4681) + // Minimum execution time: 11_814_000 picoseconds. + Weight::from_parts(12_194_000, 4681) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -959,8 +971,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 150_000 picoseconds. - Weight::from_parts(183_000, 0) + // Minimum execution time: 130_000 picoseconds. + Weight::from_parts(138_000, 0) } /// Storage: `Broker::CoreCountInbox` (r:0 w:1) /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) @@ -968,8 +980,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_843_000 picoseconds. - Weight::from_parts(1_956_000, 0) + // Minimum execution time: 1_791_000 picoseconds. + Weight::from_parts(1_898_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Broker::RevenueInbox` (r:0 w:1) @@ -978,8 +990,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_003_000 picoseconds. - Weight::from_parts(2_112_000, 0) + // Minimum execution time: 1_973_000 picoseconds. + Weight::from_parts(2_069_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `Broker::Status` (r:1 w:1) @@ -994,8 +1006,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `245` // Estimated: `1516` - // Minimum execution time: 10_788_000 picoseconds. - Weight::from_parts(11_114_000, 1516) + // Minimum execution time: 10_337_000 picoseconds. + Weight::from_parts(10_769_000, 1516) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1011,8 +1023,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `5073` // Estimated: `7496` - // Minimum execution time: 27_620_000 picoseconds. - Weight::from_parts(28_574_000, 7496) + // Minimum execution time: 27_540_000 picoseconds. + Weight::from_parts(28_141_000, 7496) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -1022,8 +1034,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `39` // Estimated: `1526` - // Minimum execution time: 4_592_000 picoseconds. - Weight::from_parts(4_827_000, 1526) + // Minimum execution time: 4_651_000 picoseconds. + Weight::from_parts(4_874_000, 1526) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1045,8 +1057,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `888` // Estimated: `4698` - // Minimum execution time: 77_091_000 picoseconds. - Weight::from_parts(79_410_000, 4698) + // Minimum execution time: 76_761_000 picoseconds. + Weight::from_parts(81_115_000, 4698) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64)) } @@ -1056,8 +1068,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `382` // Estimated: `1586` - // Minimum execution time: 14_367_000 picoseconds. - Weight::from_parts(15_206_000, 1586) + // Minimum execution time: 13_934_000 picoseconds. + Weight::from_parts(14_716_000, 1586) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1065,7 +1077,18 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 232_000 picoseconds. - Weight::from_parts(257_000, 0) + // Minimum execution time: 241_000 picoseconds. + Weight::from_parts(260_000, 0) + } + /// Storage: `Broker::Workplan` (r:1 w:1) + /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) + fn remove_assignment() -> Weight { + // Proof Size summary in bytes: + // Measured: `408` + // Estimated: `4681` + // Minimum execution time: 14_586_000 picoseconds. + Weight::from_parts(15_270_000, 4681) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } -- GitLab