diff --git a/runtime/kusama/src/weights/pallet_xcm.rs b/runtime/kusama/src/weights/pallet_xcm.rs index a14b50ec9212..fc7d75768aff 100644 --- a/runtime/kusama/src/weights/pallet_xcm.rs +++ b/runtime/kusama/src/weights/pallet_xcm.rs @@ -16,7 +16,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 @@ -49,63 +49,120 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 32_807 nanoseconds. - Weight::from_ref_time(33_383_000 as u64) - .saturating_add(T::DbWeight::get().reads(5 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + // Minimum execution time: 36_474 nanoseconds. + Weight::from_ref_time(37_030_000) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } fn teleport_assets() -> Weight { - // Minimum execution time: 28_036 nanoseconds. - Weight::from_ref_time(28_386_000 as u64) + // Minimum execution time: 28_147 nanoseconds. + Weight::from_ref_time(28_836_000) } fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 26_239 nanoseconds. - Weight::from_ref_time(27_146_000 as u64) + // Minimum execution time: 28_469 nanoseconds. + Weight::from_ref_time(29_002_000) } fn execute() -> Weight { - // Minimum execution time: 14_327 nanoseconds. - Weight::from_ref_time(14_693_000 as u64) + // Minimum execution time: 15_637 nanoseconds. + Weight::from_ref_time(15_880_000) } // Storage: XcmPallet SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 13_854 nanoseconds. - Weight::from_ref_time(14_658_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 15_330 nanoseconds. + Weight::from_ref_time(15_817_000) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 3_786 nanoseconds. - Weight::from_ref_time(3_986_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 4_104 nanoseconds. + Weight::from_ref_time(4_365_000) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet VersionNotifiers (r:1 w:1) // Storage: XcmPallet QueryCounter (r:1 w:1) // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 37_959 nanoseconds. - Weight::from_ref_time(38_689_000 as u64) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(6 as u64)) + // Minimum execution time: 42_177 nanoseconds. + Weight::from_ref_time(42_657_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) } // Storage: XcmPallet VersionNotifiers (r:1 w:1) // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 41_213 nanoseconds. - Weight::from_ref_time(41_668_000 as u64) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(5 as u64)) + // Minimum execution time: 45_481 nanoseconds. + Weight::from_ref_time(45_960_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: XcmPallet SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 14_899 nanoseconds. + Weight::from_ref_time(15_452_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 14_759 nanoseconds. + Weight::from_ref_time(15_176_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 17_022 nanoseconds. + Weight::from_ref_time(17_468_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: XcmPallet VersionNotifyTargets (r:2 w:1) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 37_810 nanoseconds. + Weight::from_ref_time(38_198_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: XcmPallet VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_440 nanoseconds. + Weight::from_ref_time(7_659_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 14_975 nanoseconds. + Weight::from_ref_time(15_479_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 43_328 nanoseconds. + Weight::from_ref_time(44_054_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) } } diff --git a/runtime/polkadot/src/weights/pallet_xcm.rs b/runtime/polkadot/src/weights/pallet_xcm.rs index 5f47a21a67f5..cc1cca28068d 100644 --- a/runtime/polkadot/src/weights/pallet_xcm.rs +++ b/runtime/polkadot/src/weights/pallet_xcm.rs @@ -16,7 +16,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-06, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 @@ -50,21 +50,21 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 33_342 nanoseconds. - Weight::from_ref_time(34_378_000) + // Minimum execution time: 35_717 nanoseconds. + Weight::from_ref_time(36_278_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } fn teleport_assets() -> Weight { - // Minimum execution time: 29_082 nanoseconds. - Weight::from_ref_time(29_445_000) + // Minimum execution time: 28_865 nanoseconds. + Weight::from_ref_time(29_336_000) } fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 27_698 nanoseconds. - Weight::from_ref_time(28_811_000) + // Minimum execution time: 27_531 nanoseconds. + Weight::from_ref_time(28_248_000) } // Storage: Benchmark Override (r:0 w:0) fn execute() -> Weight { @@ -73,14 +73,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: XcmPallet SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_670 nanoseconds. - Weight::from_ref_time(15_073_000) + // Minimum execution time: 15_205 nanoseconds. + Weight::from_ref_time(15_526_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_072 nanoseconds. - Weight::from_ref_time(4_258_000) + // Minimum execution time: 4_336 nanoseconds. + Weight::from_ref_time(4_518_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet VersionNotifiers (r:1 w:1) @@ -89,12 +89,12 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 38_016 nanoseconds. - Weight::from_ref_time(39_062_000) + // Minimum execution time: 41_446 nanoseconds. + Weight::from_ref_time(42_152_000) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -103,13 +103,72 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 44_887 nanoseconds. - Weight::from_ref_time(45_471_000) + // Minimum execution time: 44_944 nanoseconds. + Weight::from_ref_time(45_519_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } + // Storage: XcmPallet SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 15_254 nanoseconds. + Weight::from_ref_time(15_491_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 15_083 nanoseconds. + Weight::from_ref_time(15_298_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 17_889 nanoseconds. + Weight::from_ref_time(18_144_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: XcmPallet VersionNotifyTargets (r:2 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 37_255 nanoseconds. + Weight::from_ref_time(37_893_000) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: XcmPallet VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_884 nanoseconds. + Weight::from_ref_time(8_111_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 15_853 nanoseconds. + Weight::from_ref_time(16_220_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 43_836 nanoseconds. + Weight::from_ref_time(44_836_000) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } } diff --git a/runtime/rococo/src/weights/pallet_xcm.rs b/runtime/rococo/src/weights/pallet_xcm.rs index e6759a46becc..7534c87cb6de 100644 --- a/runtime/rococo/src/weights/pallet_xcm.rs +++ b/runtime/rococo/src/weights/pallet_xcm.rs @@ -16,7 +16,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 @@ -50,37 +50,37 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 33_793 nanoseconds. - Weight::from_ref_time(34_487_000 as u64) - .saturating_add(T::DbWeight::get().reads(6 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + // Minimum execution time: 36_707 nanoseconds. + Weight::from_ref_time(37_718_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) } fn teleport_assets() -> Weight { - // Minimum execution time: 27_892 nanoseconds. - Weight::from_ref_time(28_743_000 as u64) + // Minimum execution time: 28_720 nanoseconds. + Weight::from_ref_time(29_098_000) } fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 27_514 nanoseconds. - Weight::from_ref_time(28_068_000 as u64) + // Minimum execution time: 27_702 nanoseconds. + Weight::from_ref_time(28_517_000) } fn execute() -> Weight { - // Minimum execution time: 14_485 nanoseconds. - Weight::from_ref_time(14_860_000 as u64) + // Minimum execution time: 14_527 nanoseconds. + Weight::from_ref_time(14_823_000) } // Storage: XcmPallet SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_669 nanoseconds. - Weight::from_ref_time(15_412_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 16_306 nanoseconds. + Weight::from_ref_time(16_619_000) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_542 nanoseconds. - Weight::from_ref_time(4_710_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 4_911 nanoseconds. + Weight::from_ref_time(5_080_000) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet VersionNotifiers (r:1 w:1) // Storage: XcmPallet QueryCounter (r:1 w:1) @@ -88,27 +88,86 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 38_404 nanoseconds. - Weight::from_ref_time(39_169_000 as u64) - .saturating_add(T::DbWeight::get().reads(8 as u64)) - .saturating_add(T::DbWeight::get().writes(6 as u64)) + // Minimum execution time: 48_258 nanoseconds. + Weight::from_ref_time(49_130_000) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(6)) } // Storage: XcmPallet VersionNotifiers (r:1 w:1) // Storage: Configuration ActiveConfig (r:1 w:0) // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 41_677 nanoseconds. - Weight::from_ref_time(42_484_000 as u64) - .saturating_add(T::DbWeight::get().reads(7 as u64)) - .saturating_add(T::DbWeight::get().writes(5 as u64)) + // Minimum execution time: 52_381 nanoseconds. + Weight::from_ref_time(53_183_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: XcmPallet SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 16_915 nanoseconds. + Weight::from_ref_time(17_479_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 17_012 nanoseconds. + Weight::from_ref_time(17_319_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 19_489 nanoseconds. + Weight::from_ref_time(19_995_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: XcmPallet VersionNotifyTargets (r:2 w:1) + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 43_334 nanoseconds. + Weight::from_ref_time(43_983_000) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: XcmPallet VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 8_627 nanoseconds. + Weight::from_ref_time(8_860_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 17_679 nanoseconds. + Weight::from_ref_time(18_042_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + // Storage: Configuration ActiveConfig (r:1 w:0) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 45_445 nanoseconds. + Weight::from_ref_time(48_369_000) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) } } diff --git a/runtime/westend/src/weights/pallet_xcm.rs b/runtime/westend/src/weights/pallet_xcm.rs index 92e5302a8dba..50478ed21f1b 100644 --- a/runtime/westend/src/weights/pallet_xcm.rs +++ b/runtime/westend/src/weights/pallet_xcm.rs @@ -16,7 +16,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-06, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 @@ -49,21 +49,21 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 34_038 nanoseconds. - Weight::from_ref_time(34_919_000) + // Minimum execution time: 36_453 nanoseconds. + Weight::from_ref_time(37_511_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } fn teleport_assets() -> Weight { - // Minimum execution time: 27_962 nanoseconds. - Weight::from_ref_time(28_514_000) + // Minimum execution time: 28_144 nanoseconds. + Weight::from_ref_time(28_952_000) } fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 27_771 nanoseconds. - Weight::from_ref_time(28_642_000) + // Minimum execution time: 28_245 nanoseconds. + Weight::from_ref_time(28_710_000) } // Storage: Benchmark Override (r:0 w:0) fn execute() -> Weight { @@ -72,14 +72,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: XcmPallet SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_821 nanoseconds. - Weight::from_ref_time(15_342_000) + // Minimum execution time: 15_350 nanoseconds. + Weight::from_ref_time(15_829_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_501 nanoseconds. - Weight::from_ref_time(4_628_000) + // Minimum execution time: 4_482 nanoseconds. + Weight::from_ref_time(4_588_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmPallet VersionNotifiers (r:1 w:1) @@ -87,12 +87,12 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 39_480 nanoseconds. - Weight::from_ref_time(40_278_000) + // Minimum execution time: 41_818 nanoseconds. + Weight::from_ref_time(42_824_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -100,13 +100,70 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: XcmPallet SupportedVersion (r:1 w:0) // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) // Storage: XcmPallet SafeXcmVersion (r:1 w:0) - // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) // Storage: XcmPallet Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 42_607 nanoseconds. - Weight::from_ref_time(43_430_000) + // Minimum execution time: 45_488 nanoseconds. + Weight::from_ref_time(46_295_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } + // Storage: XcmPallet SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 14_614 nanoseconds. + Weight::from_ref_time(14_829_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 14_724 nanoseconds. + Weight::from_ref_time(14_915_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 16_814 nanoseconds. + Weight::from_ref_time(17_007_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: XcmPallet VersionNotifyTargets (r:2 w:1) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 37_273 nanoseconds. + Weight::from_ref_time(37_869_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: XcmPallet VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_517 nanoseconds. + Weight::from_ref_time(7_682_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 15_088 nanoseconds. + Weight::from_ref_time(15_464_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: XcmPallet VersionNotifyTargets (r:4 w:2) + // Storage: XcmPallet SupportedVersion (r:1 w:0) + // Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) + // Storage: XcmPallet SafeXcmVersion (r:1 w:0) + // Storage: Dmp DownwardMessageQueues (r:1 w:1) + // Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 42_829 nanoseconds. + Weight::from_ref_time(43_814_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) + } } diff --git a/xcm/pallet-xcm/src/benchmarking.rs b/xcm/pallet-xcm/src/benchmarking.rs index f61b4934ddce..fff4b8b2ead4 100644 --- a/xcm/pallet-xcm/src/benchmarking.rs +++ b/xcm/pallet-xcm/src/benchmarking.rs @@ -18,8 +18,9 @@ use super::*; use frame_benchmarking::{benchmarks, BenchmarkError, BenchmarkResult}; use frame_support::weights::Weight; use frame_system::RawOrigin; +use sp_core::{bounded::WeakBoundedVec, ConstU32}; use sp_std::prelude::*; -use xcm::latest::prelude::*; +use xcm::{latest::prelude::*, v2}; type RuntimeOrigin = ::RuntimeOrigin; @@ -110,6 +111,79 @@ benchmarks! { let _ = Pallet::::request_version_notify(loc); }: _(RawOrigin::Root, Box::new(versioned_loc)) + migrate_supported_version { + let old_version = XCM_VERSION - 1; + let loc = VersionedMultiLocation::from(MultiLocation::from(Parent)); + SupportedVersion::::insert(old_version, loc, old_version); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateSupportedVersion, Weight::zero()); + } + + migrate_version_notifiers { + let old_version = XCM_VERSION - 1; + let loc = VersionedMultiLocation::from(MultiLocation::from(Parent)); + VersionNotifiers::::insert(old_version, loc, 0); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateVersionNotifiers, Weight::zero()); + } + + already_notified_target { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(T::DbWeight::get().reads(1))), + )?; + let loc = VersionedMultiLocation::from(loc); + let current_version = T::AdvertisedXcmVersion::get(); + VersionNotifyTargets::::insert(current_version, loc, (0, Weight::zero(), current_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::NotifyCurrentTargets(None), Weight::zero()); + } + + notify_current_targets { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(T::DbWeight::get().reads_writes(1, 3))), + )?; + let loc = VersionedMultiLocation::from(loc); + let current_version = T::AdvertisedXcmVersion::get(); + let old_version = current_version - 1; + VersionNotifyTargets::::insert(current_version, loc, (0, Weight::zero(), old_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::NotifyCurrentTargets(None), Weight::zero()); + } + + notify_target_migration_fail { + let bad_loc: v2::MultiLocation = v2::Junction::Plurality { + id: v2::BodyId::Named(WeakBoundedVec::>::try_from(vec![0; 32]) + .expect("vec has a length of 32 bits; qed")), + part: v2::BodyPart::Voice, + } + .into(); + let bad_loc = VersionedMultiLocation::from(bad_loc); + let current_version = T::AdvertisedXcmVersion::get(); + VersionNotifyTargets::::insert(current_version, bad_loc, (0, Weight::zero(), current_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateAndNotifyOldTargets, Weight::zero()); + } + + migrate_version_notify_targets { + let current_version = T::AdvertisedXcmVersion::get(); + let old_version = current_version - 1; + let loc = VersionedMultiLocation::from(MultiLocation::from(Parent)); + VersionNotifyTargets::::insert(old_version, loc, (0, Weight::zero(), current_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateAndNotifyOldTargets, Weight::zero()); + } + + migrate_and_notify_old_targets { + let loc = T::ReachableDest::get().ok_or( + BenchmarkError::Override(BenchmarkResult::from_weight(T::DbWeight::get().reads_writes(1, 3))), + )?; + let loc = VersionedMultiLocation::from(loc); + let old_version = T::AdvertisedXcmVersion::get() - 1; + VersionNotifyTargets::::insert(old_version, loc, (0, Weight::zero(), old_version)); + }: { + Pallet::::check_xcm_version_change(VersionMigrationStage::MigrateAndNotifyOldTargets, Weight::zero()); + } + impl_benchmark_test_suite!( Pallet, crate::mock::new_test_ext_with_balances(Vec::new()), diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 63ec311edd20..f8e483d1b7a9 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -66,6 +66,13 @@ pub trait WeightInfo { fn force_default_xcm_version() -> Weight; fn force_subscribe_version_notify() -> Weight; fn force_unsubscribe_version_notify() -> Weight; + fn migrate_supported_version() -> Weight; + fn migrate_version_notifiers() -> Weight; + fn already_notified_target() -> Weight; + fn notify_current_targets() -> Weight; + fn notify_target_migration_fail() -> Weight; + fn migrate_version_notify_targets() -> Weight; + fn migrate_and_notify_old_targets() -> Weight; } /// fallback implementation @@ -102,6 +109,34 @@ impl WeightInfo for TestWeightInfo { fn force_unsubscribe_version_notify() -> Weight { Weight::from_ref_time(100_000_000) } + + fn migrate_supported_version() -> Weight { + Weight::from_ref_time(100_000_000) + } + + fn migrate_version_notifiers() -> Weight { + Weight::from_ref_time(100_000_000) + } + + fn already_notified_target() -> Weight { + Weight::from_ref_time(100_000_000) + } + + fn notify_current_targets() -> Weight { + Weight::from_ref_time(100_000_000) + } + + fn notify_target_migration_fail() -> Weight { + Weight::from_ref_time(100_000_000) + } + + fn migrate_version_notify_targets() -> Weight { + Weight::from_ref_time(100_000_000) + } + + fn migrate_and_notify_old_targets() -> Weight { + Weight::from_ref_time(100_000_000) + } } #[frame_support::pallet] @@ -1175,14 +1210,13 @@ impl Pallet { ) -> (Weight, Option) { let mut weight_used = Weight::zero(); - // TODO: Correct weights for the components of this: - let todo_sv_migrate_weight: Weight = T::DbWeight::get().reads_writes(1, 1); - let todo_vn_migrate_weight: Weight = T::DbWeight::get().reads_writes(1, 1); - let todo_vnt_already_notified_weight: Weight = T::DbWeight::get().reads(1); - let todo_vnt_notify_weight: Weight = T::DbWeight::get().reads_writes(1, 3); - let todo_vnt_migrate_weight: Weight = T::DbWeight::get().reads_writes(1, 1); - let todo_vnt_migrate_fail_weight: Weight = T::DbWeight::get().reads_writes(1, 1); - let todo_vnt_notify_migrate_weight: Weight = T::DbWeight::get().reads_writes(1, 3); + let sv_migrate_weight = T::WeightInfo::migrate_supported_version(); + let vn_migrate_weight = T::WeightInfo::migrate_version_notifiers(); + let vnt_already_notified_weight = T::WeightInfo::already_notified_target(); + let vnt_notify_weight = T::WeightInfo::notify_current_targets(); + let vnt_migrate_weight = T::WeightInfo::migrate_version_notify_targets(); + let vnt_migrate_fail_weight = T::WeightInfo::notify_target_migration_fail(); + let vnt_notify_migrate_weight = T::WeightInfo::migrate_and_notify_old_targets(); use VersionMigrationStage::*; @@ -1194,7 +1228,7 @@ impl Pallet { if let Ok(new_key) = old_key.into_latest() { SupportedVersion::::insert(XCM_VERSION, new_key, value); } - weight_used.saturating_accrue(todo_sv_migrate_weight); + weight_used.saturating_accrue(sv_migrate_weight); if weight_used.any_gte(weight_cutoff) { return (weight_used, Some(stage)) } @@ -1208,7 +1242,7 @@ impl Pallet { if let Ok(new_key) = old_key.into_latest() { VersionNotifiers::::insert(XCM_VERSION, new_key, value); } - weight_used.saturating_accrue(todo_vn_migrate_weight); + weight_used.saturating_accrue(vn_migrate_weight); if weight_used.any_gte(weight_cutoff) { return (weight_used, Some(stage)) } @@ -1231,7 +1265,7 @@ impl Pallet { _ => { // We don't early return here since we need to be certain that we // make some progress. - weight_used.saturating_accrue(todo_vnt_already_notified_weight); + weight_used.saturating_accrue(vnt_already_notified_weight); continue }, }; @@ -1250,7 +1284,7 @@ impl Pallet { }, }; Self::deposit_event(event); - weight_used.saturating_accrue(todo_vnt_notify_weight); + weight_used.saturating_accrue(vnt_notify_weight); if weight_used.any_gte(weight_cutoff) { let last = Some(iter.last_raw_key().into()); return (weight_used, Some(NotifyCurrentTargets(last))) @@ -1266,7 +1300,7 @@ impl Pallet { Ok(k) => k, Err(()) => { Self::deposit_event(Event::NotifyTargetMigrationFail(old_key, value.0)); - weight_used.saturating_accrue(todo_vnt_migrate_fail_weight); + weight_used.saturating_accrue(vnt_migrate_fail_weight); if weight_used.any_gte(weight_cutoff) { return (weight_used, Some(stage)) } @@ -1277,7 +1311,7 @@ impl Pallet { let versioned_key = LatestVersionedMultiLocation(&new_key); if target_xcm_version == xcm_version { VersionNotifyTargets::::insert(XCM_VERSION, versioned_key, value); - weight_used.saturating_accrue(todo_vnt_migrate_weight); + weight_used.saturating_accrue(vnt_migrate_weight); } else { // Need to notify target. let response = Response::Version(xcm_version); @@ -1299,7 +1333,7 @@ impl Pallet { Err(e) => Event::NotifyTargetSendFail(new_key, query_id, e.into()), }; Self::deposit_event(event); - weight_used.saturating_accrue(todo_vnt_notify_migrate_weight); + weight_used.saturating_accrue(vnt_notify_migrate_weight); } if weight_used.any_gte(weight_cutoff) { return (weight_used, Some(stage))