diff --git a/parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs b/parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs index 84b38c418b1..1b862af5342 100644 --- a/parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("statemine-dev"), DB CACHE: 1024 @@ -53,21 +53,21 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 27_480 nanoseconds. - Weight::from_ref_time(27_952_000) + // Minimum execution time: 26_577 nanoseconds. + Weight::from_ref_time(27_239_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn teleport_assets() -> Weight { - // Minimum execution time: 32_034 nanoseconds. - Weight::from_ref_time(32_516_000) + // Minimum execution time: 32_703 nanoseconds. + Weight::from_ref_time(33_200_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 25_008 nanoseconds. - Weight::from_ref_time(25_304_000) + // Minimum execution time: 25_142 nanoseconds. + Weight::from_ref_time(25_808_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Benchmark Override (r:0 w:0) @@ -77,14 +77,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_853 nanoseconds. - Weight::from_ref_time(15_204_000) + // Minimum execution time: 15_036 nanoseconds. + Weight::from_ref_time(15_456_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_423 nanoseconds. - Weight::from_ref_time(4_533_000) + // Minimum execution time: 4_404 nanoseconds. + Weight::from_ref_time(4_598_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -96,8 +96,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 30_668 nanoseconds. - Weight::from_ref_time(31_262_000) + // Minimum execution time: 30_942 nanoseconds. + Weight::from_ref_time(31_608_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -109,9 +109,66 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 31_955 nanoseconds. - Weight::from_ref_time(32_364_000) + // Minimum execution time: 32_327 nanoseconds. + Weight::from_ref_time(32_698_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: PolkadotXcm SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 13_522 nanoseconds. + Weight::from_ref_time(13_862_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 13_621 nanoseconds. + Weight::from_ref_time(14_028_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 15_511 nanoseconds. + Weight::from_ref_time(15_825_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 27_062 nanoseconds. + Weight::from_ref_time(27_514_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_062 nanoseconds. + Weight::from_ref_time(7_325_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 14_362 nanoseconds. + Weight::from_ref_time(14_724_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 32_435 nanoseconds. + Weight::from_ref_time(33_042_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index aad9d19333c..37317f9d1e0 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -47,9 +47,10 @@ use xcm_executor::{ parameter_types! { pub const KsmLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Kusama; + pub const RelayNetwork: Option = Some(NetworkId::Kusama); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = Here.into_location(); pub AssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); diff --git a/parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs b/parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs index cb9e07533a6..69729e7f385 100644 --- a/parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("statemint-dev"), DB CACHE: 1024 @@ -53,21 +53,21 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 27_134 nanoseconds. - Weight::from_ref_time(27_929_000) + // Minimum execution time: 27_694 nanoseconds. + Weight::from_ref_time(28_545_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn teleport_assets() -> Weight { - // Minimum execution time: 32_099 nanoseconds. - Weight::from_ref_time(32_640_000) + // Minimum execution time: 33_053 nanoseconds. + Weight::from_ref_time(33_789_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 24_795 nanoseconds. - Weight::from_ref_time(25_143_000) + // Minimum execution time: 24_781 nanoseconds. + Weight::from_ref_time(25_259_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Benchmark Override (r:0 w:0) @@ -77,14 +77,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 15_099 nanoseconds. - Weight::from_ref_time(15_360_000) + // Minimum execution time: 15_439 nanoseconds. + Weight::from_ref_time(15_750_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_460 nanoseconds. - Weight::from_ref_time(4_646_000) + // Minimum execution time: 4_576 nanoseconds. + Weight::from_ref_time(4_758_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -96,8 +96,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 31_019 nanoseconds. - Weight::from_ref_time(31_816_000) + // Minimum execution time: 31_540 nanoseconds. + Weight::from_ref_time(32_380_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -109,9 +109,66 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 32_139 nanoseconds. - Weight::from_ref_time(32_607_000) + // Minimum execution time: 32_627 nanoseconds. + Weight::from_ref_time(32_934_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: PolkadotXcm SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 13_968 nanoseconds. + Weight::from_ref_time(14_356_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 14_263 nanoseconds. + Weight::from_ref_time(14_540_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 15_825 nanoseconds. + Weight::from_ref_time(16_101_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 27_436 nanoseconds. + Weight::from_ref_time(28_083_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_187 nanoseconds. + Weight::from_ref_time(7_399_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 14_904 nanoseconds. + Weight::from_ref_time(15_191_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 33_269 nanoseconds. + Weight::from_ref_time(34_064_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index f5a143d777c..78919d0ae17 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -47,9 +47,10 @@ use xcm_executor::{ parameter_types! { pub const DotLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub const RelayNetwork: Option = Some(NetworkId::Polkadot); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = MultiLocation::here(); pub AssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); diff --git a/parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs b/parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs index 5d9e6c7a95d..457e551e52d 100644 --- a/parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/assets/westmint/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("westmint-dev"), DB CACHE: 1024 @@ -53,37 +53,37 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 26_837 nanoseconds. - Weight::from_ref_time(28_006_000) + // Minimum execution time: 27_623 nanoseconds. + Weight::from_ref_time(28_375_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn teleport_assets() -> Weight { - // Minimum execution time: 31_634 nanoseconds. - Weight::from_ref_time(32_373_000) + // Minimum execution time: 33_363 nanoseconds. + Weight::from_ref_time(33_942_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn reserve_transfer_assets() -> Weight { - // Minimum execution time: 24_484 nanoseconds. - Weight::from_ref_time(24_978_000) + // Minimum execution time: 25_113 nanoseconds. + Weight::from_ref_time(25_549_000) .saturating_add(T::DbWeight::get().reads(1)) } fn execute() -> Weight { - // Minimum execution time: 14_813 nanoseconds. - Weight::from_ref_time(15_181_000) + // Minimum execution time: 15_464 nanoseconds. + Weight::from_ref_time(15_772_000) } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_791 nanoseconds. - Weight::from_ref_time(15_228_000) + // Minimum execution time: 15_375 nanoseconds. + Weight::from_ref_time(15_631_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_323 nanoseconds. - Weight::from_ref_time(4_495_000) + // Minimum execution time: 4_575 nanoseconds. + Weight::from_ref_time(4_708_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -95,8 +95,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 30_640 nanoseconds. - Weight::from_ref_time(31_310_000) + // Minimum execution time: 31_521 nanoseconds. + Weight::from_ref_time(32_350_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -108,9 +108,66 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 31_891 nanoseconds. - Weight::from_ref_time(32_469_000) + // Minimum execution time: 32_589 nanoseconds. + Weight::from_ref_time(33_282_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: PolkadotXcm SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 13_642 nanoseconds. + Weight::from_ref_time(13_969_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 13_569 nanoseconds. + Weight::from_ref_time(14_168_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 15_406 nanoseconds. + Weight::from_ref_time(15_731_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 27_357 nanoseconds. + Weight::from_ref_time(27_804_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 6_940 nanoseconds. + Weight::from_ref_time(7_147_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 14_204 nanoseconds. + Weight::from_ref_time(14_529_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 32_809 nanoseconds. + Weight::from_ref_time(33_346_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index 7c8b3a15fe9..6e839044d0a 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -47,9 +47,10 @@ use xcm_executor::{ parameter_types! { pub const WestendLocation: MultiLocation = MultiLocation::parent(); - pub RelayNetwork: NetworkId = NetworkId::Westend; + pub RelayNetwork: Option = Some(NetworkId::Westend); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = Here.into_location(); pub AssetsPalletLocation: MultiLocation = PalletInstance(::index() as u8).into(); diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index c0f063cec8e..e0946f99a0c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -618,7 +618,7 @@ impl_runtime_apis! { fn valid_destination() -> Result { Ok(KsmRelayLocation::get()) } - fn worst_case_holding() -> MultiAssets { + fn worst_case_holding(_depositable_count: u32) -> MultiAssets { // just concrete assets according to relay chain. let assets: Vec = vec![ MultiAsset { @@ -635,8 +635,7 @@ impl_runtime_apis! { KsmRelayLocation::get(), MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(KsmRelayLocation::get()) }, )); - pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; - pub const CheckedAccount: Option = None; + pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -644,7 +643,6 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; - type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { @@ -661,8 +659,16 @@ impl_runtime_apis! { (0u64, Response::Version(Default::default())) } - fn transact_origin() -> Result { - Ok(KsmRelayLocation::get()) + fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn universal_alias() -> Result { + Err(BenchmarkError::Skip) + } + + fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { + Ok((KsmRelayLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { @@ -675,6 +681,10 @@ impl_runtime_apis! { let ticket = MultiLocation { parents: 0, interior: Here }; Ok((origin, ticket, assets)) } + + fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs index 045afa295bd..672b3f75421 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -53,15 +53,15 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 26_322 nanoseconds. - Weight::from_ref_time(27_595_000) + // Minimum execution time: 26_824 nanoseconds. + Weight::from_ref_time(27_272_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn teleport_assets() -> Weight { - // Minimum execution time: 32_648 nanoseconds. - Weight::from_ref_time(33_335_000) + // Minimum execution time: 32_322 nanoseconds. + Weight::from_ref_time(32_760_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Benchmark Override (r:0 w:0) @@ -76,14 +76,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 15_024 nanoseconds. - Weight::from_ref_time(15_383_000) + // Minimum execution time: 14_919 nanoseconds. + Weight::from_ref_time(15_388_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_611 nanoseconds. - Weight::from_ref_time(4_751_000) + // Minimum execution time: 4_754 nanoseconds. + Weight::from_ref_time(4_857_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -95,8 +95,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 30_923 nanoseconds. - Weight::from_ref_time(31_736_000) + // Minimum execution time: 31_107 nanoseconds. + Weight::from_ref_time(31_928_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -108,9 +108,66 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 32_167 nanoseconds. - Weight::from_ref_time(32_822_000) + // Minimum execution time: 31_745 nanoseconds. + Weight::from_ref_time(32_243_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: PolkadotXcm SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 13_855 nanoseconds. + Weight::from_ref_time(14_060_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 13_693 nanoseconds. + Weight::from_ref_time(13_984_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 15_148 nanoseconds. + Weight::from_ref_time(15_399_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 26_582 nanoseconds. + Weight::from_ref_time(27_284_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 6_961 nanoseconds. + Weight::from_ref_time(7_139_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 14_094 nanoseconds. + Weight::from_ref_time(14_474_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 31_931 nanoseconds. + Weight::from_ref_time(32_628_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs index 5051255d827..82b29187960 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs @@ -21,168 +21,220 @@ use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; -use sp_std::{cmp, prelude::*}; -use xcm::{ - latest::{prelude::*, Weight as XCMWeight}, - DoubleEncoded, -}; +use sp_std::prelude::*; +use xcm::{latest::prelude::*, DoubleEncoded}; trait WeighMultiAssets { - fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight; + fn weigh_multi_assets(&self, weight: Weight) -> Weight; } const MAX_ASSETS: u32 = 100; impl WeighMultiAssets for MultiAssetFilter { - fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { - let weight = match self { + fn weigh_multi_assets(&self, weight: Weight) -> Weight { + match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), - }; - weight.ref_time() + } } } impl WeighMultiAssets for MultiAssets { - fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { - weight.saturating_mul(self.inner().into_iter().count() as u64).ref_time() + fn weigh_multi_assets(&self, weight: Weight) -> Weight { + weight.saturating_mul(self.inner().into_iter().count() as u64) } } pub struct BridgeHubKusamaXcmWeight(core::marker::PhantomData); impl XcmWeightInfo for BridgeHubKusamaXcmWeight { - fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { + fn withdraw_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) } // Currently there is no trusted reserve - fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { - u64::MAX + fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight { + // TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974 + Weight::from_ref_time(1_000_000_000 as u64) } - fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { + fn receive_teleported_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) } - fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight { - XcmGeneric::::query_response().ref_time() + fn query_response( + _query_id: &u64, + _response: &Response, + _max_weight: &Weight, + _querier: &Option, + ) -> Weight { + XcmGeneric::::query_response() } - fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { + fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::transfer_asset()) } fn transfer_reserve_asset( assets: &MultiAssets, _dest: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::transfer_reserve_asset()) } fn transact( _origin_type: &OriginKind, - _require_weight_at_most: &u64, + _require_weight_at_most: &Weight, _call: &DoubleEncoded, - ) -> XCMWeight { - XcmGeneric::::transact().ref_time() + ) -> Weight { + XcmGeneric::::transact() } fn hrmp_new_channel_open_request( _sender: &u32, _max_message_size: &u32, _max_capacity: &u32, - ) -> XCMWeight { + ) -> Weight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } - fn hrmp_channel_accepted(_recipient: &u32) -> XCMWeight { + fn hrmp_channel_accepted(_recipient: &u32) -> Weight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } - fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> XCMWeight { + fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } - fn clear_origin() -> XCMWeight { - XcmGeneric::::clear_origin().ref_time() + fn clear_origin() -> Weight { + XcmGeneric::::clear_origin() } - fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { - XcmGeneric::::descend_origin().ref_time() + fn descend_origin(_who: &InteriorMultiLocation) -> Weight { + XcmGeneric::::descend_origin() } - fn report_error( - _query_id: &QueryId, - _dest: &MultiLocation, - _max_response_weight: &u64, - ) -> XCMWeight { - XcmGeneric::::report_error().ref_time() + fn report_error(_query_response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::report_error() } - fn deposit_asset( - assets: &MultiAssetFilter, - _max_assets: &u32, - _dest: &MultiLocation, - ) -> XCMWeight { + fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); - cmp::min(hardcoded_weight, weight) + hardcoded_weight.min(weight) } fn deposit_reserve_asset( assets: &MultiAssetFilter, - _max_assets: &u32, _dest: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::deposit_reserve_asset()) } - fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight { - Weight::MAX.ref_time() + fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets, _maximal: &bool) -> Weight { + Weight::MAX } fn initiate_reserve_withdraw( assets: &MultiAssetFilter, _reserve: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) } fn initiate_teleport( assets: &MultiAssetFilter, _dest: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time(); + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); - cmp::min(hardcoded_weight, weight) + hardcoded_weight.min(weight) } - fn query_holding( - _query_id: &u64, - _dest: &MultiLocation, - _assets: &MultiAssetFilter, - _max_response_weight: &u64, - ) -> XCMWeight { - XcmGeneric::::query_holding().ref_time() + fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { + XcmGeneric::::report_holding() + } + fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> Weight { + XcmGeneric::::buy_execution() + } + fn refund_surplus() -> Weight { + XcmGeneric::::refund_surplus() + } + fn set_error_handler(_xcm: &Xcm) -> Weight { + XcmGeneric::::set_error_handler() + } + fn set_appendix(_xcm: &Xcm) -> Weight { + XcmGeneric::::set_appendix() + } + fn clear_error() -> Weight { + XcmGeneric::::clear_error() + } + fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> Weight { + XcmGeneric::::claim_asset() + } + fn trap(_code: &u64) -> Weight { + XcmGeneric::::trap() + } + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &Weight) -> Weight { + XcmGeneric::::subscribe_version() + } + fn unsubscribe_version() -> Weight { + XcmGeneric::::unsubscribe_version() + } + fn burn_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::burn_asset()) + } + fn expect_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::expect_asset()) + } + fn expect_origin(_origin: &Option) -> Weight { + XcmGeneric::::expect_origin() + } + fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight { + XcmGeneric::::expect_error() + } + fn query_pallet(_module_name: &Vec, _response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::query_pallet() + } + fn expect_pallet( + _index: &u32, + _name: &Vec, + _module_name: &Vec, + _crate_major: &u32, + _min_crate_minor: &u32, + ) -> Weight { + XcmGeneric::::expect_pallet() + } + fn report_transact_status(_response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::report_transact_status() + } + fn clear_transact_status() -> Weight { + XcmGeneric::::clear_transact_status() + } + fn universal_origin(_: &Junction) -> Weight { + Weight::MAX + } + fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { + Weight::MAX } - fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { - XcmGeneric::::buy_execution().ref_time() + fn lock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn refund_surplus() -> XCMWeight { - XcmGeneric::::refund_surplus().ref_time() + fn unlock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn set_error_handler(_xcm: &Xcm) -> XCMWeight { - XcmGeneric::::set_error_handler().ref_time() + fn note_unlockable(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn set_appendix(_xcm: &Xcm) -> XCMWeight { - XcmGeneric::::set_appendix().ref_time() + fn request_unlock(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn clear_error() -> XCMWeight { - XcmGeneric::::clear_error().ref_time() + fn set_fees_mode(_: &bool) -> Weight { + XcmGeneric::::set_fees_mode() } - fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { - XcmGeneric::::claim_asset().ref_time() + fn set_topic(_topic: &[u8; 32]) -> Weight { + XcmGeneric::::set_topic() } - fn trap(_code: &u64) -> XCMWeight { - XcmGeneric::::trap().ref_time() + fn clear_topic() -> Weight { + XcmGeneric::::clear_topic() } - fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> XCMWeight { - XcmGeneric::::subscribe_version().ref_time() + fn alias_origin(_: &MultiLocation) -> Weight { + // XCM Executor does not currently support alias origin operations + Weight::MAX } - fn unsubscribe_version() -> XCMWeight { - XcmGeneric::::unsubscribe_version().ref_time() + fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { + XcmGeneric::::unpaid_execution() } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index c3e83e116cf..c5cf471c74d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -51,13 +51,13 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) pub(crate) fn withdraw_asset() -> Weight { - Weight::from_ref_time(25_434_000 as u64) + Weight::from_ref_time(27_070_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) pub(crate) fn transfer_asset() -> Weight { - Weight::from_ref_time(36_180_000 as u64) + Weight::from_ref_time(38_614_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -69,16 +69,16 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_ref_time(83_476_000 as u64) + Weight::from_ref_time(55_875_000 as u64) .saturating_add(T::DbWeight::get().reads(8 as u64)) .saturating_add(T::DbWeight::get().writes(4 as u64)) } pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_ref_time(6_009_000 as u64) + Weight::from_ref_time(7_121_000 as u64) } // Storage: System Account (r:1 w:1) pub(crate) fn deposit_asset() -> Weight { - Weight::from_ref_time(27_729_000 as u64) + Weight::from_ref_time(30_450_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -90,7 +90,7 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_ref_time(44_605_000 as u64) + Weight::from_ref_time(49_122_000 as u64) .saturating_add(T::DbWeight::get().reads(7 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } @@ -101,7 +101,7 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn initiate_teleport() -> Weight { - Weight::from_ref_time(21_605_000 as u64) + Weight::from_ref_time(25_016_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 003a0788721..0a4498c56e7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("bridge-hub-kusama-dev"), DB CACHE: 1024 @@ -55,58 +55,59 @@ impl WeightInfo { // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - pub(crate) fn query_holding() -> Weight { - Weight::from_ref_time(21_039_000 as u64) + pub(crate) fn report_holding() -> Weight { + Weight::from_ref_time(28_638_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } pub(crate) fn buy_execution() -> Weight { - Weight::from_ref_time(5_375_000 as u64) + Weight::from_ref_time(5_869_000 as u64) } // Storage: PolkadotXcm Queries (r:1 w:0) pub(crate) fn query_response() -> Weight { - Weight::from_ref_time(16_091_000 as u64) + Weight::from_ref_time(18_018_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) } pub(crate) fn transact() -> Weight { - Weight::from_ref_time(19_057_000 as u64) + Weight::from_ref_time(21_240_000 as u64) } pub(crate) fn refund_surplus() -> Weight { - Weight::from_ref_time(5_397_000 as u64) + Weight::from_ref_time(6_118_000 as u64) } pub(crate) fn set_error_handler() -> Weight { - Weight::from_ref_time(5_347_000 as u64) + Weight::from_ref_time(5_855_000 as u64) } pub(crate) fn set_appendix() -> Weight { - Weight::from_ref_time(5_346_000 as u64) + Weight::from_ref_time(5_901_000 as u64) } pub(crate) fn clear_error() -> Weight { - Weight::from_ref_time(5_310_000 as u64) + Weight::from_ref_time(5_762_000 as u64) } pub(crate) fn descend_origin() -> Weight { - Weight::from_ref_time(6_273_000 as u64) + Weight::from_ref_time(6_717_000 as u64) } pub(crate) fn clear_origin() -> Weight { - Weight::from_ref_time(5_279_000 as u64) + Weight::from_ref_time(5_924_000 as u64) } + // Storage: ParachainInfo ParachainId (r:1 w:0) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn report_error() -> Weight { - Weight::from_ref_time(14_974_000 as u64) - .saturating_add(T::DbWeight::get().reads(5 as u64)) + Weight::from_ref_time(22_264_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) pub(crate) fn claim_asset() -> Weight { - Weight::from_ref_time(20_711_000 as u64) + Weight::from_ref_time(21_620_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } pub(crate) fn trap() -> Weight { - Weight::from_ref_time(5_154_000 as u64) + Weight::from_ref_time(5_795_000 as u64) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) @@ -115,13 +116,13 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn subscribe_version() -> Weight { - Weight::from_ref_time(17_872_000 as u64) + Weight::from_ref_time(29_039_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_ref_time(7_356_000 as u64) + Weight::from_ref_time(8_794_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -131,8 +132,60 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_ref_time(22_312_000 as u64) + Weight::from_ref_time(26_793_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn burn_asset() -> Weight { + Weight::from_ref_time(7_912_000 as u64) + } + pub(crate) fn expect_asset() -> Weight { + Weight::from_ref_time(6_981_000 as u64) + } + pub(crate) fn expect_origin() -> Weight { + Weight::from_ref_time(6_880_000 as u64) + } + pub(crate) fn expect_error() -> Weight { + Weight::from_ref_time(6_802_000 as u64) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn query_pallet() -> Weight { + Weight::from_ref_time(31_039_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + pub(crate) fn expect_pallet() -> Weight { + Weight::from_ref_time(9_291_000 as u64) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn report_transact_status() -> Weight { + Weight::from_ref_time(28_012_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn clear_transact_status() -> Weight { + Weight::from_ref_time(7_491_000 as u64) + } + pub(crate) fn set_topic() -> Weight { + Weight::from_ref_time(7_373_000 as u64) + } + pub(crate) fn clear_topic() -> Weight { + Weight::from_ref_time(7_490_000 as u64) + } + pub(crate) fn set_fees_mode() -> Weight { + Weight::from_ref_time(11_585_000 as u64) + } + pub(crate) fn unpaid_execution() -> Weight { + Weight::from_ref_time(7_582_000 as u64) + } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index f31d84a091a..6fca60ef532 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -21,7 +21,6 @@ use super::{ use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::{ @@ -44,7 +43,7 @@ parameter_types! { pub const RelayNetwork: Option = Some(NetworkId::Kusama); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = - Parachain(ParachainInfo::parachain_id().into()).into(); + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 71f0a42a5d4..40f3c4bbe87 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -646,7 +646,7 @@ impl_runtime_apis! { fn valid_destination() -> Result { Ok(RelayLocation::get()) } - fn worst_case_holding() -> MultiAssets { + fn worst_case_holding(_depositable_count: u32) -> MultiAssets { // just concrete assets according to relay chain. let assets: Vec = vec![ MultiAsset { @@ -663,8 +663,7 @@ impl_runtime_apis! { RelayLocation::get(), MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(RelayLocation::get()) }, )); - pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; - pub const CheckedAccount: Option = None; + pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -672,7 +671,6 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; - type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { @@ -689,8 +687,16 @@ impl_runtime_apis! { (0u64, Response::Version(Default::default())) } - fn transact_origin() -> Result { - Ok(RelayLocation::get()) + fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> { + Err(BenchmarkError::Skip) + } + + fn universal_alias() -> Result { + Err(BenchmarkError::Skip) + } + + fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> { + Ok((RelayLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) } fn subscribe_origin() -> Result { @@ -703,6 +709,10 @@ impl_runtime_apis! { let ticket = MultiLocation { parents: 0, interior: Here }; Ok((origin, ticket, assets)) } + + fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> { + Err(BenchmarkError::Skip) + } } type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs index d3308ed68cb..7d0e4a3546c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -53,15 +53,15 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 26_918 nanoseconds. - Weight::from_ref_time(28_481_000) + // Minimum execution time: 27_797 nanoseconds. + Weight::from_ref_time(28_356_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn teleport_assets() -> Weight { - // Minimum execution time: 33_157 nanoseconds. - Weight::from_ref_time(33_584_000) + // Minimum execution time: 32_656 nanoseconds. + Weight::from_ref_time(33_011_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Benchmark Override (r:0 w:0) @@ -76,14 +76,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_206 nanoseconds. - Weight::from_ref_time(14_525_000) + // Minimum execution time: 15_101 nanoseconds. + Weight::from_ref_time(15_535_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_493 nanoseconds. - Weight::from_ref_time(4_573_000) + // Minimum execution time: 4_700 nanoseconds. + Weight::from_ref_time(4_896_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -95,8 +95,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 31_132 nanoseconds. - Weight::from_ref_time(31_788_000) + // Minimum execution time: 31_532 nanoseconds. + Weight::from_ref_time(32_180_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -108,9 +108,66 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 32_099 nanoseconds. - Weight::from_ref_time(32_731_000) + // Minimum execution time: 32_515 nanoseconds. + Weight::from_ref_time(33_097_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: PolkadotXcm SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 13_811 nanoseconds. + Weight::from_ref_time(14_149_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 13_708 nanoseconds. + Weight::from_ref_time(14_067_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 15_277 nanoseconds. + Weight::from_ref_time(15_626_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 29_263 nanoseconds. + Weight::from_ref_time(29_831_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_787 nanoseconds. + Weight::from_ref_time(7_858_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 15_252 nanoseconds. + Weight::from_ref_time(15_558_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 35_105 nanoseconds. + Weight::from_ref_time(35_719_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs index 4d0d2c6ca9e..0b911aec2d5 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs @@ -21,168 +21,220 @@ use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; -use sp_std::{cmp, prelude::*}; -use xcm::{ - latest::{prelude::*, Weight as XCMWeight}, - DoubleEncoded, -}; +use sp_std::prelude::*; +use xcm::{latest::prelude::*, DoubleEncoded}; trait WeighMultiAssets { - fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight; + fn weigh_multi_assets(&self, weight: Weight) -> Weight; } const MAX_ASSETS: u32 = 100; impl WeighMultiAssets for MultiAssetFilter { - fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { - let weight = match self { + fn weigh_multi_assets(&self, weight: Weight) -> Weight { + match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), - }; - weight.ref_time() + } } } impl WeighMultiAssets for MultiAssets { - fn weigh_multi_assets(&self, weight: Weight) -> XCMWeight { - weight.saturating_mul(self.inner().into_iter().count() as u64).ref_time() + fn weigh_multi_assets(&self, weight: Weight) -> Weight { + weight.saturating_mul(self.inner().into_iter().count() as u64) } } pub struct BridgeHubRococoXcmWeight(core::marker::PhantomData); impl XcmWeightInfo for BridgeHubRococoXcmWeight { - fn withdraw_asset(assets: &MultiAssets) -> XCMWeight { + fn withdraw_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::withdraw_asset()) } // Currently there is no trusted reserve - fn reserve_asset_deposited(_assets: &MultiAssets) -> XCMWeight { - u64::MAX + fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight { + // TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974 + Weight::from_ref_time(1_000_000_000 as u64) } - fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight { + fn receive_teleported_asset(assets: &MultiAssets) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::receive_teleported_asset()) } - fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight { - XcmGeneric::::query_response().ref_time() + fn query_response( + _query_id: &u64, + _response: &Response, + _max_weight: &Weight, + _querier: &Option, + ) -> Weight { + XcmGeneric::::query_response() } - fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight { + fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::transfer_asset()) } fn transfer_reserve_asset( assets: &MultiAssets, _dest: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::transfer_reserve_asset()) } fn transact( _origin_type: &OriginKind, - _require_weight_at_most: &u64, + _require_weight_at_most: &Weight, _call: &DoubleEncoded, - ) -> XCMWeight { - XcmGeneric::::transact().ref_time() + ) -> Weight { + XcmGeneric::::transact() } fn hrmp_new_channel_open_request( _sender: &u32, _max_message_size: &u32, _max_capacity: &u32, - ) -> XCMWeight { + ) -> Weight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } - fn hrmp_channel_accepted(_recipient: &u32) -> XCMWeight { + fn hrmp_channel_accepted(_recipient: &u32) -> Weight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } - fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> XCMWeight { + fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { // XCM Executor does not currently support HRMP channel operations - Weight::MAX.ref_time() + Weight::MAX } - fn clear_origin() -> XCMWeight { - XcmGeneric::::clear_origin().ref_time() + fn clear_origin() -> Weight { + XcmGeneric::::clear_origin() } - fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight { - XcmGeneric::::descend_origin().ref_time() + fn descend_origin(_who: &InteriorMultiLocation) -> Weight { + XcmGeneric::::descend_origin() } - fn report_error( - _query_id: &QueryId, - _dest: &MultiLocation, - _max_response_weight: &u64, - ) -> XCMWeight { - XcmGeneric::::report_error().ref_time() + fn report_error(_query_response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::report_error() } - fn deposit_asset( - assets: &MultiAssetFilter, - _max_assets: &u32, - _dest: &MultiLocation, - ) -> XCMWeight { + fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); - cmp::min(hardcoded_weight, weight) + hardcoded_weight.min(weight) } fn deposit_reserve_asset( assets: &MultiAssetFilter, - _max_assets: &u32, _dest: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { assets.weigh_multi_assets(XcmFungibleWeight::::deposit_reserve_asset()) } - fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight { - Weight::MAX.ref_time() + fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets, _maximal: &bool) -> Weight { + Weight::MAX } fn initiate_reserve_withdraw( assets: &MultiAssetFilter, _reserve: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { assets.weigh_multi_assets(XcmGeneric::::initiate_reserve_withdraw()) } fn initiate_teleport( assets: &MultiAssetFilter, _dest: &MultiLocation, _xcm: &Xcm<()>, - ) -> XCMWeight { + ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time(); + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); - cmp::min(hardcoded_weight, weight) + hardcoded_weight.min(weight) } - fn query_holding( - _query_id: &u64, - _dest: &MultiLocation, - _assets: &MultiAssetFilter, - _max_response_weight: &u64, - ) -> XCMWeight { - XcmGeneric::::query_holding().ref_time() + fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { + XcmGeneric::::report_holding() + } + fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> Weight { + XcmGeneric::::buy_execution() + } + fn refund_surplus() -> Weight { + XcmGeneric::::refund_surplus() + } + fn set_error_handler(_xcm: &Xcm) -> Weight { + XcmGeneric::::set_error_handler() + } + fn set_appendix(_xcm: &Xcm) -> Weight { + XcmGeneric::::set_appendix() + } + fn clear_error() -> Weight { + XcmGeneric::::clear_error() + } + fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> Weight { + XcmGeneric::::claim_asset() + } + fn trap(_code: &u64) -> Weight { + XcmGeneric::::trap() + } + fn subscribe_version(_query_id: &QueryId, _max_response_weight: &Weight) -> Weight { + XcmGeneric::::subscribe_version() + } + fn unsubscribe_version() -> Weight { + XcmGeneric::::unsubscribe_version() + } + fn burn_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::burn_asset()) + } + fn expect_asset(assets: &MultiAssets) -> Weight { + assets.weigh_multi_assets(XcmGeneric::::expect_asset()) + } + fn expect_origin(_origin: &Option) -> Weight { + XcmGeneric::::expect_origin() + } + fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight { + XcmGeneric::::expect_error() + } + fn query_pallet(_module_name: &Vec, _response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::query_pallet() + } + fn expect_pallet( + _index: &u32, + _name: &Vec, + _module_name: &Vec, + _crate_major: &u32, + _min_crate_minor: &u32, + ) -> Weight { + XcmGeneric::::expect_pallet() + } + fn report_transact_status(_response_info: &QueryResponseInfo) -> Weight { + XcmGeneric::::report_transact_status() + } + fn clear_transact_status() -> Weight { + XcmGeneric::::clear_transact_status() + } + fn universal_origin(_: &Junction) -> Weight { + Weight::MAX + } + fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { + Weight::MAX } - fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight { - XcmGeneric::::buy_execution().ref_time() + fn lock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn refund_surplus() -> XCMWeight { - XcmGeneric::::refund_surplus().ref_time() + fn unlock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn set_error_handler(_xcm: &Xcm) -> XCMWeight { - XcmGeneric::::set_error_handler().ref_time() + fn note_unlockable(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn set_appendix(_xcm: &Xcm) -> XCMWeight { - XcmGeneric::::set_appendix().ref_time() + fn request_unlock(_: &MultiAsset, _: &MultiLocation) -> Weight { + Weight::MAX } - fn clear_error() -> XCMWeight { - XcmGeneric::::clear_error().ref_time() + fn set_fees_mode(_: &bool) -> Weight { + XcmGeneric::::set_fees_mode() } - fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> XCMWeight { - XcmGeneric::::claim_asset().ref_time() + fn set_topic(_topic: &[u8; 32]) -> Weight { + XcmGeneric::::set_topic() } - fn trap(_code: &u64) -> XCMWeight { - XcmGeneric::::trap().ref_time() + fn clear_topic() -> Weight { + XcmGeneric::::clear_topic() } - fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> XCMWeight { - XcmGeneric::::subscribe_version().ref_time() + fn alias_origin(_: &MultiLocation) -> Weight { + // XCM Executor does not currently support alias origin operations + Weight::MAX } - fn unsubscribe_version() -> XCMWeight { - XcmGeneric::::unsubscribe_version().ref_time() + fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { + XcmGeneric::::unpaid_execution() } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 213ddc25d38..fcd1d27780b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -51,13 +51,13 @@ pub struct WeightInfo(PhantomData); impl WeightInfo { // Storage: System Account (r:1 w:1) pub(crate) fn withdraw_asset() -> Weight { - Weight::from_ref_time(26_254_000 as u64) + Weight::from_ref_time(27_244_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) pub(crate) fn transfer_asset() -> Weight { - Weight::from_ref_time(36_415_000 as u64) + Weight::from_ref_time(38_254_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -69,16 +69,16 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn transfer_reserve_asset() -> Weight { - Weight::from_ref_time(52_145_000 as u64) + Weight::from_ref_time(55_608_000 as u64) .saturating_add(T::DbWeight::get().reads(8 as u64)) .saturating_add(T::DbWeight::get().writes(4 as u64)) } pub(crate) fn receive_teleported_asset() -> Weight { - Weight::from_ref_time(5_889_000 as u64) + Weight::from_ref_time(7_053_000 as u64) } // Storage: System Account (r:1 w:1) pub(crate) fn deposit_asset() -> Weight { - Weight::from_ref_time(27_689_000 as u64) + Weight::from_ref_time(29_030_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -90,7 +90,7 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn deposit_reserve_asset() -> Weight { - Weight::from_ref_time(44_857_000 as u64) + Weight::from_ref_time(48_233_000 as u64) .saturating_add(T::DbWeight::get().reads(7 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } @@ -101,7 +101,7 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn initiate_teleport() -> Weight { - Weight::from_ref_time(21_586_000 as u64) + Weight::from_ref_time(24_691_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 898e440420a..85c0fb34ac4 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("bridge-hub-rococo-dev"), DB CACHE: 1024 @@ -55,58 +55,59 @@ impl WeightInfo { // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) - pub(crate) fn query_holding() -> Weight { - Weight::from_ref_time(21_192_000 as u64) + pub(crate) fn report_holding() -> Weight { + Weight::from_ref_time(27_691_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } pub(crate) fn buy_execution() -> Weight { - Weight::from_ref_time(5_394_000 as u64) + Weight::from_ref_time(5_927_000 as u64) } // Storage: PolkadotXcm Queries (r:1 w:0) pub(crate) fn query_response() -> Weight { - Weight::from_ref_time(16_081_000 as u64) + Weight::from_ref_time(17_594_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) } pub(crate) fn transact() -> Weight { - Weight::from_ref_time(19_230_000 as u64) + Weight::from_ref_time(20_743_000 as u64) } pub(crate) fn refund_surplus() -> Weight { - Weight::from_ref_time(5_286_000 as u64) + Weight::from_ref_time(5_960_000 as u64) } pub(crate) fn set_error_handler() -> Weight { - Weight::from_ref_time(5_275_000 as u64) + Weight::from_ref_time(5_857_000 as u64) } pub(crate) fn set_appendix() -> Weight { - Weight::from_ref_time(5_190_000 as u64) + Weight::from_ref_time(5_819_000 as u64) } pub(crate) fn clear_error() -> Weight { - Weight::from_ref_time(5_113_000 as u64) + Weight::from_ref_time(5_826_000 as u64) } pub(crate) fn descend_origin() -> Weight { - Weight::from_ref_time(6_169_000 as u64) + Weight::from_ref_time(6_641_000 as u64) } pub(crate) fn clear_origin() -> Weight { - Weight::from_ref_time(5_158_000 as u64) + Weight::from_ref_time(5_754_000 as u64) } + // Storage: ParachainInfo ParachainId (r:1 w:0) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn report_error() -> Weight { - Weight::from_ref_time(14_826_000 as u64) - .saturating_add(T::DbWeight::get().reads(5 as u64)) + Weight::from_ref_time(21_742_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: PolkadotXcm AssetTraps (r:1 w:1) pub(crate) fn claim_asset() -> Weight { - Weight::from_ref_time(20_278_000 as u64) + Weight::from_ref_time(20_833_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } pub(crate) fn trap() -> Weight { - Weight::from_ref_time(5_100_000 as u64) + Weight::from_ref_time(5_773_000 as u64) } // Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) // Storage: PolkadotXcm SupportedVersion (r:1 w:0) @@ -115,13 +116,13 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn subscribe_version() -> Weight { - Weight::from_ref_time(17_701_000 as u64) + Weight::from_ref_time(28_365_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: PolkadotXcm VersionNotifyTargets (r:0 w:1) pub(crate) fn unsubscribe_version() -> Weight { - Weight::from_ref_time(7_143_000 as u64) + Weight::from_ref_time(7_961_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: ParachainInfo ParachainId (r:1 w:0) @@ -131,8 +132,60 @@ impl WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) pub(crate) fn initiate_reserve_withdraw() -> Weight { - Weight::from_ref_time(21_895_000 as u64) + Weight::from_ref_time(24_970_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn burn_asset() -> Weight { + Weight::from_ref_time(7_400_000 as u64) + } + pub(crate) fn expect_asset() -> Weight { + Weight::from_ref_time(6_018_000 as u64) + } + pub(crate) fn expect_origin() -> Weight { + Weight::from_ref_time(5_862_000 as u64) + } + pub(crate) fn expect_error() -> Weight { + Weight::from_ref_time(5_857_000 as u64) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn query_pallet() -> Weight { + Weight::from_ref_time(24_420_000 as u64) .saturating_add(T::DbWeight::get().reads(6 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + pub(crate) fn expect_pallet() -> Weight { + Weight::from_ref_time(7_212_000 as u64) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + pub(crate) fn report_transact_status() -> Weight { + Weight::from_ref_time(22_227_000 as u64) + .saturating_add(T::DbWeight::get().reads(6 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + pub(crate) fn clear_transact_status() -> Weight { + Weight::from_ref_time(5_890_000 as u64) + } + pub(crate) fn set_topic() -> Weight { + Weight::from_ref_time(5_684_000 as u64) + } + pub(crate) fn clear_topic() -> Weight { + Weight::from_ref_time(5_763_000 as u64) + } + pub(crate) fn set_fees_mode() -> Weight { + Weight::from_ref_time(5_812_000 as u64) + } + pub(crate) fn unpaid_execution() -> Weight { + Weight::from_ref_time(6_043_000 as u64) + } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index ac75427425e..4613f9f19fc 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -21,7 +21,6 @@ use super::{ use frame_support::{ match_types, parameter_types, traits::{ConstU32, Contains, Everything, Nothing}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use parachains_common::xcm_config::{ @@ -41,10 +40,10 @@ use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: Option = None; + pub const RelayNetwork: Option = Some(NetworkId::Rococo); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = - Parachain(ParachainInfo::parachain_id().into()).into(); + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const MaxInstructions: u32 = 100; pub const MaxAssetsIntoHolding: u32 = 64; } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs index 16964cac506..ec9974dd295 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_xcm.rs @@ -17,7 +17,7 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-22, 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("collectives-polkadot-dev"), DB CACHE: 1024 @@ -53,15 +53,15 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem HostConfiguration (r:1 w:0) // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) fn send() -> Weight { - // Minimum execution time: 26_568 nanoseconds. - Weight::from_ref_time(27_534_000) + // Minimum execution time: 27_016 nanoseconds. + Weight::from_ref_time(27_587_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainInfo ParachainId (r:1 w:0) fn teleport_assets() -> Weight { - // Minimum execution time: 33_083 nanoseconds. - Weight::from_ref_time(34_126_000) + // Minimum execution time: 33_807 nanoseconds. + Weight::from_ref_time(34_960_000) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Benchmark Override (r:0 w:0) @@ -76,14 +76,14 @@ impl pallet_xcm::WeightInfo for WeightInfo { } // Storage: PolkadotXcm SupportedVersion (r:0 w:1) fn force_xcm_version() -> Weight { - // Minimum execution time: 14_497 nanoseconds. - Weight::from_ref_time(14_849_000) + // Minimum execution time: 15_322 nanoseconds. + Weight::from_ref_time(15_782_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) fn force_default_xcm_version() -> Weight { - // Minimum execution time: 4_309 nanoseconds. - Weight::from_ref_time(4_647_000) + // Minimum execution time: 4_390 nanoseconds. + Weight::from_ref_time(4_564_000) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -95,8 +95,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_subscribe_version_notify() -> Weight { - // Minimum execution time: 30_585 nanoseconds. - Weight::from_ref_time(31_735_000) + // Minimum execution time: 31_238 nanoseconds. + Weight::from_ref_time(32_021_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -108,9 +108,66 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) // Storage: PolkadotXcm Queries (r:0 w:1) fn force_unsubscribe_version_notify() -> Weight { - // Minimum execution time: 31_687 nanoseconds. - Weight::from_ref_time(32_241_000) + // Minimum execution time: 32_459 nanoseconds. + Weight::from_ref_time(32_802_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } + // Storage: PolkadotXcm SupportedVersion (r:4 w:2) + fn migrate_supported_version() -> Weight { + // Minimum execution time: 13_433 nanoseconds. + Weight::from_ref_time(13_890_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifiers (r:4 w:2) + fn migrate_version_notifiers() -> Weight { + // Minimum execution time: 13_798 nanoseconds. + Weight::from_ref_time(14_104_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:5 w:0) + fn already_notified_target() -> Weight { + // Minimum execution time: 15_012 nanoseconds. + Weight::from_ref_time(15_360_000) + .saturating_add(T::DbWeight::get().reads(5)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn notify_current_targets() -> Weight { + // Minimum execution time: 26_911 nanoseconds. + Weight::from_ref_time(27_686_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:3 w:0) + fn notify_target_migration_fail() -> Weight { + // Minimum execution time: 7_067 nanoseconds. + Weight::from_ref_time(7_207_000) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + fn migrate_version_notify_targets() -> Weight { + // Minimum execution time: 13_882 nanoseconds. + Weight::from_ref_time(14_067_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) + // Storage: PolkadotXcm SupportedVersion (r:1 w:0) + // Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1) + // Storage: PolkadotXcm SafeXcmVersion (r:1 w:0) + // Storage: ParachainSystem HostConfiguration (r:1 w:0) + // Storage: ParachainSystem PendingUpwardMessages (r:1 w:1) + fn migrate_and_notify_old_targets() -> Weight { + // Minimum execution time: 32_227 nanoseconds. + Weight::from_ref_time(33_068_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs index d59062e58ab..f6485a88efd 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs @@ -40,9 +40,10 @@ use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; parameter_types! { pub const DotLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Polkadot; + pub const RelayNetwork: Option = Some(NetworkId::Polkadot); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); + pub UniversalLocation: InteriorMultiLocation = + X2(GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())); pub const Local: MultiLocation = Here.into_location(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); } diff --git a/parachains/runtimes/starters/shell/src/xcm_config.rs b/parachains/runtimes/starters/shell/src/xcm_config.rs index ca15fd65e45..8a7b3f21339 100644 --- a/parachains/runtimes/starters/shell/src/xcm_config.rs +++ b/parachains/runtimes/starters/shell/src/xcm_config.rs @@ -30,7 +30,7 @@ use xcm_builder::{ parameter_types! { pub const RococoLocation: MultiLocation = MultiLocation::parent(); - pub const RococoNetwork: NetworkId = NetworkId::Polkadot; + pub const RococoNetwork: Option = Some(NetworkId::Rococo); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); } diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index c5cc41f100f..f8e28aee4c7 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -276,7 +276,7 @@ impl cumulus_pallet_aura_ext::Config for Runtime {} parameter_types! { pub const RocLocation: MultiLocation = MultiLocation::parent(); - pub const RococoNetwork: NetworkId = NetworkId::Polkadot; + pub const RococoNetwork: Option = Some(NetworkId::Rococo); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); pub CheckingAccount: AccountId = PolkadotXcm::check_account();