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

Commit 7d51356

Browse files
authored
[xcm ] Compatibility fix for xcm benchmarks (#2934)
* Compatibility fix for xcm benchmarks (cause of missing companion) * ".git/.scripts/commands/bench/bench.sh" --subcommand=xcm --runtime=asset-hub-polkadot --runtime_dir=assets --target_dir=cumulus --pallet=pallet_xcm_benchmarks::fungible * Fix for reserve_asset_deposited (https://github.com/paritytech/cumulus/issues/1974) * Revert back hard-coded 1_000_000_000_u64 for `reserve_asset_deposited` with TODOs * ".git/.scripts/commands/bench/bench.sh" --subcommand=xcm --runtime=asset-hub-kusama --runtime_dir=assets --target_dir=cumulus --pallet=pallet_xcm_benchmarks::fungible --------- Co-authored-by: command-bot <>
1 parent fa27253 commit 7d51356

18 files changed

Lines changed: 382 additions & 292 deletions

File tree

parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,16 @@ impl<Call> XcmWeightInfo<Call> for AssetHubKusamaXcmWeight<Call> {
6161
fn withdraw_asset(assets: &MultiAssets) -> Weight {
6262
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::withdraw_asset())
6363
}
64-
// Currently there is no trusted reserve
64+
// Currently there is no trusted reserve (`IsReserve = ()`),
65+
// but we need this hack for `pallet_xcm::reserve_transfer_assets`
66+
// (TODO) fix https://github.com/paritytech/polkadot/pull/7424
67+
// (TODO) fix https://github.com/paritytech/polkadot/pull/7546
6568
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
69+
// TODO: if we change `IsReserve = ...` then use this line...
70+
// TODO: or if remote weight estimation is fixed, then remove
6671
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
67-
Weight::from_parts(1_000_000_000_u64, 0)
72+
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
73+
hardcoded_weight.min(XcmFungibleWeight::<Runtime>::reserve_asset_deposited())
6874
}
6975
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
7076
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
@@ -141,7 +147,7 @@ impl<Call> XcmWeightInfo<Call> for AssetHubKusamaXcmWeight<Call> {
141147
_reserve: &MultiLocation,
142148
_xcm: &Xcm<()>,
143149
) -> Weight {
144-
assets.weigh_multi_assets(XcmGeneric::<Runtime>::initiate_reserve_withdraw())
150+
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_reserve_withdraw())
145151
}
146152
fn initiate_teleport(
147153
assets: &MultiAssetFilter,

parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

Lines changed: 106 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717
//! Autogenerated weights for `pallet_xcm_benchmarks::fungible`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2023-07-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
23-
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024
22+
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
23+
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024
2424
2525
// Executed Command:
26-
// ./artifacts/polkadot-parachain
26+
// target/production/polkadot-parachain
2727
// benchmark
2828
// pallet
29-
// --template=./templates/xcm-bench-template.hbs
30-
// --chain=asset-hub-kusama-dev
31-
// --execution=wasm
32-
// --wasm-execution=compiled
33-
// --pallet=pallet_xcm_benchmarks::fungible
34-
// --extrinsic=*
3529
// --steps=50
3630
// --repeat=20
37-
// --json
31+
// --extrinsic=*
32+
// --wasm-execution=compiled
33+
// --heap-pages=4096
34+
// --json-file=/builds/parity/mirrors/cumulus/.git/.artifacts/bench.json
35+
// --pallet=pallet_xcm_benchmarks::fungible
36+
// --chain=asset-hub-kusama-dev
3837
// --header=./file_header.txt
39-
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs
38+
// --template=./templates/xcm-bench-template.hbs
39+
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/
4040

4141
#![cfg_attr(rustfmt, rustfmt_skip)]
4242
#![allow(unused_parens)]
@@ -48,110 +48,140 @@ use sp_std::marker::PhantomData;
4848
/// Weights for `pallet_xcm_benchmarks::fungible`.
4949
pub struct WeightInfo<T>(PhantomData<T>);
5050
impl<T: frame_system::Config> WeightInfo<T> {
51-
// Storage: System Account (r:1 w:1)
52-
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
51+
// Storage: `System::Account` (r:1 w:1)
52+
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
5353
pub fn withdraw_asset() -> Weight {
5454
// Proof Size summary in bytes:
5555
// Measured: `101`
5656
// Estimated: `3593`
57-
// Minimum execution time: 26_264_000 picoseconds.
58-
Weight::from_parts(26_613_000, 3593)
57+
// Minimum execution time: 26_371_000 picoseconds.
58+
Weight::from_parts(27_398_000, 3593)
5959
.saturating_add(T::DbWeight::get().reads(1))
6060
.saturating_add(T::DbWeight::get().writes(1))
6161
}
62-
// Storage: System Account (r:2 w:2)
63-
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
62+
// Storage: `System::Account` (r:2 w:2)
63+
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
6464
pub fn transfer_asset() -> Weight {
6565
// Proof Size summary in bytes:
6666
// Measured: `101`
6767
// Estimated: `6196`
68-
// Minimum execution time: 50_109_000 picoseconds.
69-
Weight::from_parts(50_611_000, 6196)
68+
// Minimum execution time: 52_248_000 picoseconds.
69+
Weight::from_parts(54_424_000, 6196)
7070
.saturating_add(T::DbWeight::get().reads(2))
7171
.saturating_add(T::DbWeight::get().writes(2))
7272
}
73-
// Storage: System Account (r:2 w:2)
74-
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
75-
// Storage: ParachainInfo ParachainId (r:1 w:0)
76-
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
77-
// Storage: PolkadotXcm SupportedVersion (r:1 w:0)
78-
// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
79-
// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
80-
// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
81-
// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
82-
// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
83-
// Storage: ParachainSystem HostConfiguration (r:1 w:0)
84-
// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured)
85-
// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
86-
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
73+
// Storage: `System::Account` (r:2 w:2)
74+
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
75+
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
76+
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
77+
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
78+
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
79+
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
80+
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
81+
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
82+
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
83+
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
84+
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
85+
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
86+
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
8787
pub fn transfer_reserve_asset() -> Weight {
8888
// Proof Size summary in bytes:
89-
// Measured: `176`
89+
// Measured: `210`
9090
// Estimated: `6196`
91-
// Minimum execution time: 72_554_000 picoseconds.
92-
Weight::from_parts(73_381_000, 6196)
91+
// Minimum execution time: 76_817_000 picoseconds.
92+
Weight::from_parts(78_750_000, 6196)
9393
.saturating_add(T::DbWeight::get().reads(8))
9494
.saturating_add(T::DbWeight::get().writes(4))
9595
}
96+
// Storage: `Benchmark::Override` (r:0 w:0)
97+
// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
98+
pub fn reserve_asset_deposited() -> Weight {
99+
// Proof Size summary in bytes:
100+
// Measured: `0`
101+
// Estimated: `0`
102+
// Minimum execution time: 500_000_000_000 picoseconds.
103+
Weight::from_parts(500_000_000_000, 0)
104+
}
105+
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
106+
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
107+
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
108+
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
109+
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
110+
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
111+
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
112+
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
113+
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
114+
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
115+
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
116+
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
117+
pub fn initiate_reserve_withdraw() -> Weight {
118+
// Proof Size summary in bytes:
119+
// Measured: `109`
120+
// Estimated: `3574`
121+
// Minimum execution time: 474_937_000 picoseconds.
122+
Weight::from_parts(483_577_000, 3574)
123+
.saturating_add(T::DbWeight::get().reads(6))
124+
.saturating_add(T::DbWeight::get().writes(2))
125+
}
96126
pub fn receive_teleported_asset() -> Weight {
97127
// Proof Size summary in bytes:
98128
// Measured: `0`
99129
// Estimated: `0`
100-
// Minimum execution time: 3_858_000 picoseconds.
101-
Weight::from_parts(3_970_000, 0)
130+
// Minimum execution time: 3_986_000 picoseconds.
131+
Weight::from_parts(4_088_000, 0)
102132
}
103-
// Storage: System Account (r:1 w:1)
104-
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
133+
// Storage: `System::Account` (r:1 w:1)
134+
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
105135
pub fn deposit_asset() -> Weight {
106136
// Proof Size summary in bytes:
107137
// Measured: `0`
108138
// Estimated: `3593`
109-
// Minimum execution time: 26_650_000 picoseconds.
110-
Weight::from_parts(27_186_000, 3593)
139+
// Minimum execution time: 27_152_000 picoseconds.
140+
Weight::from_parts(27_954_000, 3593)
111141
.saturating_add(T::DbWeight::get().reads(1))
112142
.saturating_add(T::DbWeight::get().writes(1))
113143
}
114-
// Storage: System Account (r:1 w:1)
115-
// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
116-
// Storage: ParachainInfo ParachainId (r:1 w:0)
117-
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
118-
// Storage: PolkadotXcm SupportedVersion (r:1 w:0)
119-
// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
120-
// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
121-
// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
122-
// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
123-
// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
124-
// Storage: ParachainSystem HostConfiguration (r:1 w:0)
125-
// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured)
126-
// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
127-
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
144+
// Storage: `System::Account` (r:1 w:1)
145+
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
146+
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
147+
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
148+
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
149+
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
150+
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
151+
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
152+
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
153+
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
154+
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
155+
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
156+
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
157+
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
128158
pub fn deposit_reserve_asset() -> Weight {
129159
// Proof Size summary in bytes:
130-
// Measured: `75`
160+
// Measured: `109`
131161
// Estimated: `3593`
132-
// Minimum execution time: 50_230_000 picoseconds.
133-
Weight::from_parts(50_949_000, 3593)
162+
// Minimum execution time: 54_098_000 picoseconds.
163+
Weight::from_parts(55_731_000, 3593)
134164
.saturating_add(T::DbWeight::get().reads(7))
135165
.saturating_add(T::DbWeight::get().writes(3))
136166
}
137-
// Storage: ParachainInfo ParachainId (r:1 w:0)
138-
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
139-
// Storage: PolkadotXcm SupportedVersion (r:1 w:0)
140-
// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
141-
// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
142-
// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
143-
// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
144-
// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
145-
// Storage: ParachainSystem HostConfiguration (r:1 w:0)
146-
// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured)
147-
// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
148-
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
167+
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
168+
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
169+
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
170+
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
171+
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
172+
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
173+
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
174+
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
175+
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
176+
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
177+
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
178+
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
149179
pub fn initiate_teleport() -> Weight {
150180
// Proof Size summary in bytes:
151-
// Measured: `75`
152-
// Estimated: `3540`
153-
// Minimum execution time: 29_977_000 picoseconds.
154-
Weight::from_parts(30_521_000, 3540)
181+
// Measured: `109`
182+
// Estimated: `3574`
183+
// Minimum execution time: 33_434_000 picoseconds.
184+
Weight::from_parts(34_367_000, 3574)
155185
.saturating_add(T::DbWeight::get().reads(6))
156186
.saturating_add(T::DbWeight::get().writes(2))
157187
}

parachains/runtimes/assets/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -205,27 +205,6 @@ impl<T: frame_system::Config> WeightInfo<T> {
205205
Weight::from_parts(4_996_000, 0)
206206
.saturating_add(T::DbWeight::get().writes(1))
207207
}
208-
// Storage: ParachainInfo ParachainId (r:1 w:0)
209-
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
210-
// Storage: PolkadotXcm SupportedVersion (r:1 w:0)
211-
// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
212-
// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
213-
// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
214-
// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
215-
// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
216-
// Storage: ParachainSystem HostConfiguration (r:1 w:0)
217-
// Proof Skipped: ParachainSystem HostConfiguration (max_values: Some(1), max_size: None, mode: Measured)
218-
// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
219-
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
220-
pub fn initiate_reserve_withdraw() -> Weight {
221-
// Proof Size summary in bytes:
222-
// Measured: `75`
223-
// Estimated: `3540`
224-
// Minimum execution time: 383_046_000 picoseconds.
225-
Weight::from_parts(397_796_000, 3540)
226-
.saturating_add(T::DbWeight::get().reads(6))
227-
.saturating_add(T::DbWeight::get().writes(2))
228-
}
229208
pub fn burn_asset() -> Weight {
230209
// Proof Size summary in bytes:
231210
// Measured: `0`

parachains/runtimes/assets/asset-hub-polkadot/src/weights/xcm/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,16 @@ impl<Call> XcmWeightInfo<Call> for AssetHubPolkadotXcmWeight<Call> {
6161
fn withdraw_asset(assets: &MultiAssets) -> Weight {
6262
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::withdraw_asset())
6363
}
64-
// Currently there is no trusted reserve
64+
// Currently there is no trusted reserve (`IsReserve = ()`),
65+
// but we need this hack for `pallet_xcm::reserve_transfer_assets`
66+
// (TODO) fix https://github.com/paritytech/polkadot/pull/7424
67+
// (TODO) fix https://github.com/paritytech/polkadot/pull/7546
6568
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
69+
// TODO: if we change `IsReserve = ...` then use this line...
70+
// TODO: or if remote weight estimation is fixed, then remove
6671
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
67-
Weight::from_parts(1_000_000_000_u64, 0)
72+
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
73+
hardcoded_weight.min(XcmFungibleWeight::<Runtime>::reserve_asset_deposited())
6874
}
6975
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
7076
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
@@ -141,7 +147,7 @@ impl<Call> XcmWeightInfo<Call> for AssetHubPolkadotXcmWeight<Call> {
141147
_reserve: &MultiLocation,
142148
_xcm: &Xcm<()>,
143149
) -> Weight {
144-
assets.weigh_multi_assets(XcmGeneric::<Runtime>::initiate_reserve_withdraw())
150+
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_reserve_withdraw())
145151
}
146152
fn initiate_teleport(
147153
assets: &MultiAssetFilter,

0 commit comments

Comments
 (0)