mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-16 22:25:43 +00:00
XCMv3 fixes (#1710)
* Fixes XCMv3 related Fixes XCMv3 (removed query_holding) Fixes XCMv3 - should use _depositable_count? Fixes XCMv3 - removed TrustedReserve Fixes - missing weights for statemine/statemint/westmint [DO-NOT-CHERRY-PICK] tmp return query_holding to aviod conficts to master Fixes - missing functions for pallet_xcm_benchmarks::generic::Config Fixes for XCMv3 benchmarking Fix xcm - removed query_holding * ".git/.scripts/bench-bot.sh" xcm statemine assets pallet_xcm_benchmarks::generic * ".git/.scripts/bench-bot.sh" xcm statemint assets pallet_xcm_benchmarks::generic * ".git/.scripts/bench-bot.sh" xcm westmint assets pallet_xcm_benchmarks::generic * Fix imports
This commit is contained in:
@@ -838,7 +838,7 @@ impl_runtime_apis! {
|
||||
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
|
||||
Ok(WestendLocation::get())
|
||||
}
|
||||
fn worst_case_holding() -> MultiAssets {
|
||||
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
|
||||
// A mix of fungible, non-fungible, and concrete assets.
|
||||
const HOLDING_FUNGIBLES: u32 = 100;
|
||||
const HOLDING_NON_FUNGIBLES: u32 = 100;
|
||||
@@ -871,7 +871,6 @@ impl_runtime_apis! {
|
||||
WestendLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WestendLocation::get()) },
|
||||
));
|
||||
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
|
||||
pub const CheckedAccount: Option<AccountId> = None;
|
||||
|
||||
}
|
||||
@@ -881,7 +880,6 @@ impl_runtime_apis! {
|
||||
|
||||
type CheckedAccount = CheckedAccount;
|
||||
type TrustedTeleporter = TrustedTeleporter;
|
||||
type TrustedReserve = TrustedReserve;
|
||||
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
@@ -898,6 +896,14 @@ impl_runtime_apis! {
|
||||
(0u64, Response::Version(Default::default()))
|
||||
}
|
||||
|
||||
fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError> {
|
||||
Err(BenchmarkError::Skip)
|
||||
}
|
||||
|
||||
fn universal_alias() -> Result<Junction, BenchmarkError> {
|
||||
Err(BenchmarkError::Skip)
|
||||
}
|
||||
|
||||
fn transact_origin() -> Result<MultiLocation, BenchmarkError> {
|
||||
Ok(WestendLocation::get())
|
||||
}
|
||||
@@ -912,6 +918,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::<Runtime>;
|
||||
|
||||
@@ -62,7 +62,12 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> XCMWeight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
}
|
||||
fn query_response(_query_id: &u64, _response: &Response, _max_weight: &u64) -> XCMWeight {
|
||||
fn query_response(
|
||||
_query_id: &u64,
|
||||
_response: &Response,
|
||||
_max_weight: &u64,
|
||||
_querier: &Option<MultiLocation>,
|
||||
) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::query_response().ref_time()
|
||||
}
|
||||
fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> XCMWeight {
|
||||
@@ -104,19 +109,11 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
fn descend_origin(_who: &InteriorMultiLocation) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::descend_origin().ref_time()
|
||||
}
|
||||
fn report_error(
|
||||
_query_id: &QueryId,
|
||||
_dest: &MultiLocation,
|
||||
_max_response_weight: &u64,
|
||||
) -> XCMWeight {
|
||||
fn report_error(_query_response_info: &QueryResponseInfo) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::report_error().ref_time()
|
||||
}
|
||||
|
||||
fn deposit_asset(
|
||||
assets: &MultiAssetFilter,
|
||||
_max_assets: &u32,
|
||||
_dest: &MultiLocation,
|
||||
) -> XCMWeight {
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> XCMWeight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time();
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
@@ -124,13 +121,16 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
}
|
||||
fn deposit_reserve_asset(
|
||||
assets: &MultiAssetFilter,
|
||||
_max_assets: &u32,
|
||||
_dest: &MultiLocation,
|
||||
_xcm: &Xcm<()>,
|
||||
) -> XCMWeight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_reserve_asset())
|
||||
}
|
||||
fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> XCMWeight {
|
||||
fn exchange_asset(
|
||||
_give: &MultiAssetFilter,
|
||||
_receive: &MultiAssets,
|
||||
_maximal: &bool,
|
||||
) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn initiate_reserve_withdraw(
|
||||
@@ -150,13 +150,8 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport());
|
||||
cmp::min(hardcoded_weight, weight)
|
||||
}
|
||||
fn query_holding(
|
||||
_query_id: &u64,
|
||||
_dest: &MultiLocation,
|
||||
_assets: &MultiAssetFilter,
|
||||
_max_response_weight: &u64,
|
||||
) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::query_holding().ref_time()
|
||||
fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::report_holding().ref_time()
|
||||
}
|
||||
fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::buy_execution().ref_time()
|
||||
@@ -185,4 +180,65 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
fn unsubscribe_version() -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::unsubscribe_version().ref_time()
|
||||
}
|
||||
fn burn_asset(assets: &MultiAssets) -> XCMWeight {
|
||||
assets.weigh_multi_assets(XcmGeneric::<Runtime>::burn_asset())
|
||||
}
|
||||
fn expect_asset(assets: &MultiAssets) -> XCMWeight {
|
||||
assets.weigh_multi_assets(XcmGeneric::<Runtime>::expect_asset())
|
||||
}
|
||||
fn expect_origin(_origin: &Option<MultiLocation>) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::expect_origin().ref_time()
|
||||
}
|
||||
fn expect_error(_error: &Option<(u32, XcmError)>) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::expect_error().ref_time()
|
||||
}
|
||||
fn query_pallet(_module_name: &Vec<u8>, _response_info: &QueryResponseInfo) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::query_pallet().ref_time()
|
||||
}
|
||||
fn expect_pallet(
|
||||
_index: &u32,
|
||||
_name: &Vec<u8>,
|
||||
_module_name: &Vec<u8>,
|
||||
_crate_major: &u32,
|
||||
_min_crate_minor: &u32,
|
||||
) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::expect_pallet().ref_time()
|
||||
}
|
||||
fn report_transact_status(_response_info: &QueryResponseInfo) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::report_transact_status().ref_time()
|
||||
}
|
||||
fn clear_transact_status() -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::clear_transact_status().ref_time()
|
||||
}
|
||||
fn universal_origin(_: &Junction) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn lock_asset(_: &MultiAsset, _: &MultiLocation) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn unlock_asset(_: &MultiAsset, _: &MultiLocation) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn note_unlockable(_: &MultiAsset, _: &MultiLocation) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn request_unlock(_: &MultiAsset, _: &MultiLocation) -> XCMWeight {
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
fn set_fees_mode(_: &bool) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::set_fees_mode().ref_time()
|
||||
}
|
||||
fn set_topic(_topic: &[u8; 32]) -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::set_topic().ref_time()
|
||||
}
|
||||
fn clear_topic() -> XCMWeight {
|
||||
XcmGeneric::<Runtime>::clear_topic().ref_time()
|
||||
}
|
||||
fn alias_origin(_: &MultiLocation) -> XCMWeight {
|
||||
// XCM Executor does not currently support alias origin operations
|
||||
Weight::MAX.ref_time()
|
||||
}
|
||||
}
|
||||
|
||||
+71
-20
@@ -18,7 +18,8 @@
|
||||
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2022-08-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! DATE: 2022-09-30, 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
|
||||
|
||||
// Executed Command:
|
||||
@@ -36,7 +37,7 @@
|
||||
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json
|
||||
// --header=./file_header.txt
|
||||
// --template=./templates/xcm-bench-template.hbs
|
||||
// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
|
||||
// --output=./parachains/runtimes/assets/westmint/src/weights/xcm/
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
@@ -54,58 +55,59 @@ impl<T: frame_system::Config> WeightInfo<T> {
|
||||
// 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(676_316_000 as u64)
|
||||
pub(crate) fn report_holding() -> Weight {
|
||||
Weight::from_ref_time(1_324_853_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(7_030_000 as u64)
|
||||
Weight::from_ref_time(8_533_000 as u64)
|
||||
}
|
||||
// Storage: PolkadotXcm Queries (r:1 w:0)
|
||||
pub(crate) fn query_response() -> Weight {
|
||||
Weight::from_ref_time(12_574_000 as u64)
|
||||
Weight::from_ref_time(19_435_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as u64))
|
||||
}
|
||||
pub(crate) fn transact() -> Weight {
|
||||
Weight::from_ref_time(15_764_000 as u64)
|
||||
Weight::from_ref_time(22_656_000 as u64)
|
||||
}
|
||||
pub(crate) fn refund_surplus() -> Weight {
|
||||
Weight::from_ref_time(7_200_000 as u64)
|
||||
Weight::from_ref_time(8_900_000 as u64)
|
||||
}
|
||||
pub(crate) fn set_error_handler() -> Weight {
|
||||
Weight::from_ref_time(3_310_000 as u64)
|
||||
Weight::from_ref_time(6_255_000 as u64)
|
||||
}
|
||||
pub(crate) fn set_appendix() -> Weight {
|
||||
Weight::from_ref_time(3_260_000 as u64)
|
||||
Weight::from_ref_time(6_268_000 as u64)
|
||||
}
|
||||
pub(crate) fn clear_error() -> Weight {
|
||||
Weight::from_ref_time(3_277_000 as u64)
|
||||
Weight::from_ref_time(6_304_000 as u64)
|
||||
}
|
||||
pub(crate) fn descend_origin() -> Weight {
|
||||
Weight::from_ref_time(3_913_000 as u64)
|
||||
Weight::from_ref_time(7_279_000 as u64)
|
||||
}
|
||||
pub(crate) fn clear_origin() -> Weight {
|
||||
Weight::from_ref_time(3_354_000 as u64)
|
||||
Weight::from_ref_time(6_297_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(13_028_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().reads(5 as u64))
|
||||
Weight::from_ref_time(23_025_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(7_739_000 as u64)
|
||||
Weight::from_ref_time(13_001_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(3_351_000 as u64)
|
||||
Weight::from_ref_time(6_266_000 as u64)
|
||||
}
|
||||
// Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1)
|
||||
// Storage: PolkadotXcm SupportedVersion (r:1 w:0)
|
||||
@@ -114,13 +116,13 @@ impl<T: frame_system::Config> WeightInfo<T> {
|
||||
// Storage: ParachainSystem HostConfiguration (r:1 w:0)
|
||||
// Storage: ParachainSystem PendingUpwardMessages (r:1 w:1)
|
||||
pub(crate) fn subscribe_version() -> Weight {
|
||||
Weight::from_ref_time(16_051_000 as u64)
|
||||
Weight::from_ref_time(31_348_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(5_477_000 as u64)
|
||||
Weight::from_ref_time(9_534_000 as u64)
|
||||
.saturating_add(T::DbWeight::get().writes(1 as u64))
|
||||
}
|
||||
// Storage: ParachainInfo ParachainId (r:1 w:0)
|
||||
@@ -130,8 +132,57 @@ impl<T: frame_system::Config> WeightInfo<T> {
|
||||
// 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(874_435_000 as u64)
|
||||
Weight::from_ref_time(1_558_814_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(496_802_000 as u64)
|
||||
}
|
||||
pub(crate) fn expect_asset() -> Weight {
|
||||
Weight::from_ref_time(38_299_000 as u64)
|
||||
}
|
||||
pub(crate) fn expect_origin() -> Weight {
|
||||
Weight::from_ref_time(6_354_000 as u64)
|
||||
}
|
||||
pub(crate) fn expect_error() -> Weight {
|
||||
Weight::from_ref_time(6_234_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(25_150_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_969_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(23_099_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(6_366_000 as u64)
|
||||
}
|
||||
pub(crate) fn set_topic() -> Weight {
|
||||
Weight::from_ref_time(6_422_000 as u64)
|
||||
}
|
||||
pub(crate) fn clear_topic() -> Weight {
|
||||
Weight::from_ref_time(6_405_000 as u64)
|
||||
}
|
||||
pub(crate) fn set_fees_mode() -> Weight {
|
||||
Weight::from_ref_time(6_392_000 as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
// limitations under the License.
|
||||
|
||||
use super::{
|
||||
AccountId, AssetId, Assets, Authorship, Balance, Balances, ParachainInfo, ParachainSystem,
|
||||
PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue,
|
||||
AccountId, AllPalletsWithSystem, AssetId, Assets, Authorship, Balance, Balances, ParachainInfo,
|
||||
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee,
|
||||
XcmpQueue,
|
||||
};
|
||||
use frame_support::{
|
||||
match_types, parameter_types,
|
||||
@@ -198,7 +199,7 @@ impl xcm_executor::Config for XcmConfig {
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetClaims = PolkadotXcm;
|
||||
type SubscriptionService = PolkadotXcm;
|
||||
type PalletInstancesInfo = ();
|
||||
type PalletInstancesInfo = AllPalletsWithSystem;
|
||||
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
|
||||
type AssetLocker = ();
|
||||
type AssetExchanger = ();
|
||||
|
||||
Reference in New Issue
Block a user