Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

xcm-v3 benchmarks, weights, fixes for bridge-hubs #2035

Merged
merged 14 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 72 additions & 15 deletions parachains/runtimes/assets/statemine/src/weights/pallet_xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -53,21 +53,21 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// 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)
Expand All @@ -77,14 +77,14 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
}
// 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)
Expand All @@ -96,8 +96,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// 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))
}
Expand All @@ -109,9 +109,66 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// 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))
}
}
5 changes: 3 additions & 2 deletions parachains/runtimes/assets/statemine/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NetworkId> = 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(<Assets as PalletInfoAccess>::index() as u8).into();
Expand Down
87 changes: 72 additions & 15 deletions parachains/runtimes/assets/statemint/src/weights/pallet_xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -53,21 +53,21 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// 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)
Expand All @@ -77,14 +77,14 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
}
// 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)
Expand All @@ -96,8 +96,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// 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))
}
Expand All @@ -109,9 +109,66 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// 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))
}
}
5 changes: 3 additions & 2 deletions parachains/runtimes/assets/statemint/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NetworkId> = 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(<Assets as PalletInfoAccess>::index() as u8).into();
Expand Down
Loading