Unverified Commit f0b2bf3c authored by Shawn Tabrizi's avatar Shawn Tabrizi Committed by GitHub
Browse files

XCM Benchmarks for Asset Transactor w/ Fungible Asset (#3818)



* benchmarks for fungibles

* add benchmark to westend

* fix hex

* clean up a bit

* update code doc

* fix warnings

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=westend-dev --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --steps=10 --repeat=10 --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./ --execution=wasm --wasm-execution=compiled

* use skip

* fix spelling

* Update Cargo.lock

* add scale-info

* Update Cargo.lock

* update bench

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

* weights compile

* update westend to use weights

* fmt

* spelling fixes

* Delete pallet_xcm_benchmarks::fungible.rs

* Apply suggestions from code review
Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>

* fix code review

* update weight

* fix report_error

* fix spell check
Co-authored-by: default avatarParity Bot <admin@parity.io>
Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>
parent 57c01c32
Pipeline #159289 failed with stages
in 45 minutes and 5 seconds
......@@ -4605,6 +4605,20 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b"
[[package]]
name = "pallet-assets"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#c000780dba99a611fadbf83873073e024be1be0b"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-authority-discovery"
version = "4.0.0-dev"
......@@ -5429,6 +5443,31 @@ dependencies = [
"xcm-executor",
]
[[package]]
name = "pallet-xcm-benchmarks"
version = "0.9.8"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"log",
"pallet-assets",
"pallet-balances",
"pallet-xcm",
"parity-scale-codec",
"polkadot-primitives",
"polkadot-runtime-common",
"scale-info",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
"sp-tracing",
"xcm",
"xcm-builder",
"xcm-executor",
]
[[package]]
name = "parity-db"
version = "0.3.1"
......@@ -11607,6 +11646,7 @@ dependencies = [
"pallet-utility",
"pallet-vesting",
"pallet-xcm",
"pallet-xcm-benchmarks",
"parity-scale-codec",
"polkadot-parachain",
"polkadot-primitives",
......@@ -11776,6 +11816,7 @@ dependencies = [
name = "xcm-executor"
version = "0.9.9"
dependencies = [
"frame-benchmarking",
"frame-support",
"impl-trait-for-tuples",
"log",
......
......@@ -43,6 +43,7 @@ members = [
"xcm/xcm-simulator",
"xcm/xcm-simulator/example",
"xcm/pallet-xcm",
"xcm/pallet-xcm-benchmarks",
"xcm/procedural",
"node/client",
"node/collation-generation",
......
......@@ -41,7 +41,7 @@
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for runtime_common::crowdloan.
/// Weight functions for `runtime_common::crowdloan`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> runtime_common::crowdloan::WeightInfo for WeightInfo<T> {
// Storage: Crowdloan Funds (r:1 w:1)
......
......@@ -41,7 +41,7 @@
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for runtime_common::paras_registrar.
/// Weight functions for `runtime_common::paras_registrar`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> runtime_common::paras_registrar::WeightInfo for WeightInfo<T> {
// Storage: Registrar NextFreeParaId (r:1 w:1)
......
......@@ -40,6 +40,7 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate"
pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-bags-list = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
......@@ -69,7 +70,7 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
pallet-bags-list = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
......@@ -202,6 +203,7 @@ runtime-benchmarks = [
"frame-system-benchmarking",
"hex-literal",
"xcm-builder/runtime-benchmarks",
"pallet-xcm-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
"pallet-bags-list/runtime-benchmarks",
]
......
......@@ -49,9 +49,9 @@ use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete,
LocationInverter, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
TakeWeightCredit, UsingComponents,
CurrencyAdapter as XcmCurrencyAdapter, IsChildSystemParachain, IsConcrete, LocationInverter,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
UsingComponents, WeightInfoBounds,
};
use xcm_executor::XcmExecutor;
......@@ -951,10 +951,6 @@ type LocalOriginConverter = (
ChildSystemParachainAsSuperuser<ParaId, Origin>,
);
parameter_types! {
pub const BaseXcmWeight: Weight = 1_000_000_000;
}
/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our
/// individual routers.
pub type XcmRouter = (
......@@ -963,8 +959,9 @@ pub type XcmRouter = (
);
parameter_types! {
pub const Westmint: MultiLocation = Parachain(1000).into();
pub const WestendForWestmint: (MultiAssetFilter, MultiLocation) =
(Wild(AllOf { fun: WildFungible, id: Concrete(WndLocation::get()) }), Parachain(1000).into());
(Wild(AllOf { fun: WildFungible, id: Concrete(WndLocation::get()) }), Westmint::get());
pub const MaxInstructions: u32 = 100;
}
pub type TrustedTeleporters = (xcm_builder::Case<WestendForWestmint>,);
......@@ -989,7 +986,7 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = TrustedTeleporters;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = WeightInfoBounds<weights::xcm::WestendXcmWeight<Call>, Call, MaxInstructions>;
type Trader = UsingComponents<WeightToFee, WndLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
......@@ -1015,7 +1012,7 @@ impl pallet_xcm::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Everything;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Weigher = WeightInfoBounds<weights::xcm::WestendXcmWeight<Call>, Call, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
......@@ -1468,6 +1465,8 @@ sp_api::impl_runtime_apis! {
use pallet_offences_benchmarking::Pallet as OffencesBench;
use frame_system_benchmarking::Pallet as SystemBench;
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
let mut list = Vec::<BenchmarkList>::new();
// Polkadot
......@@ -1479,6 +1478,7 @@ sp_api::impl_runtime_apis! {
list_benchmark!(list, extra, runtime_common::slots, Slots);
list_benchmark!(list, extra, runtime_parachains::configuration, Configuration);
list_benchmark!(list, extra, runtime_parachains::paras, Paras);
// Substrate
list_benchmark!(list, extra, pallet_bags_list, BagsList);
list_benchmark!(list, extra, pallet_balances, Balances);
......@@ -1497,6 +1497,10 @@ sp_api::impl_runtime_apis! {
list_benchmark!(list, extra, pallet_utility, Utility);
list_benchmark!(list, extra, pallet_vesting, Vesting);
// XCM Benchmarks
// NOTE: Make sure you point to the individual modules below.
list_benchmark!(list, extra, pallet_xcm_benchmarks::fungible, XcmBalances);
let storage_info = AllPalletsWithSystem::storage_info();
return (list, storage_info)
......@@ -1519,6 +1523,39 @@ sp_api::impl_runtime_apis! {
impl pallet_offences_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {}
use xcm::latest::MultiAsset;
impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = XcmConfig;
type AccountIdConverter = LocationConverter;
fn valid_destination() -> Result<MultiLocation, sp_runtime::DispatchError> {
Ok(Westmint::get())
}
}
parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
Westmint::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WndLocation::get()) },
));
}
impl pallet_xcm_benchmarks::fungible::Config for Runtime {
type TransactAsset = Balances;
type CheckedAccount = CheckAccount;
type TrustedTeleporter = TrustedTeleporter;
fn get_multi_asset() -> MultiAsset {
MultiAsset {
id: Concrete(WndLocation::get()),
fun: Fungible(1 * UNITS),
}
}
}
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
let whitelist: Vec<TrackedStorageKey> = vec![
// Block Number
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
......@@ -1532,6 +1569,12 @@ sp_api::impl_runtime_apis! {
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
// Treasury Account
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95ecffd7b6c0f78751baa9d281e0bfa3a6d6f646c70792f74727372790000000000000000000000000000000000000000").to_vec().into(),
// Dmp DownwardMessageQueueHeads
hex_literal::hex!("63f78c98723ddc9073523ef3beefda0c4d7fefc408aac59dbfe80a72ac8e3ce5").to_vec().into(),
// Dmp DownwardMessageQueues
hex_literal::hex!("63f78c98723ddc9073523ef3beefda0ca95dac46c07a40d91506e7637ec4ba57").to_vec().into(),
// Configuration ActiveConfig
hex_literal::hex!("06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385").to_vec().into(),
];
let mut batches = Vec::<BenchmarkBatch>::new();
......@@ -1546,6 +1589,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, runtime_common::slots, Slots);
add_benchmark!(params, batches, runtime_parachains::configuration, Configuration);
add_benchmark!(params, batches, runtime_parachains::paras, Paras);
// Substrate
add_benchmark!(params, batches, pallet_bags_list, BagsList);
add_benchmark!(params, batches, pallet_balances, Balances);
......@@ -1564,6 +1608,10 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, pallet_utility, Utility);
add_benchmark!(params, batches, pallet_vesting, Vesting);
// XCM Benchmarks
// NOTE: Make sure you point to the individual modules below.
add_benchmark!(params, batches, pallet_xcm_benchmarks::fungible, XcmBalances);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Ok(batches)
}
......
......@@ -36,3 +36,4 @@ pub mod runtime_common_paras_registrar;
pub mod runtime_common_slots;
pub mod runtime_parachains_configuration;
pub mod runtime_parachains_paras;
pub mod xcm;
mod pallet_xcm_benchmarks_fungible;
mod pallet_xcm_benchmarks_generic;
use crate::Runtime;
use frame_support::weights::Weight;
use sp_std::prelude::*;
use xcm::{latest::prelude::*, DoubleEncoded};
use pallet_xcm_benchmarks_fungible::WeightInfo as XcmBalancesWeight;
use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric;
/// Types of asset supported by the westend runtime.
pub enum AssetTypes {
/// An asset backed by `pallet-balances`.
Balances,
/// Unknown asset.
Unknown,
}
impl From<&MultiAsset> for AssetTypes {
fn from(asset: &MultiAsset) -> Self {
match asset {
MultiAsset { id: Concrete(MultiLocation { parents: 0, interior: Here }), .. } =>
AssetTypes::Balances,
_ => AssetTypes::Unknown,
}
}
}
trait WeighMultiAssets {
fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight;
}
// TODO wild case
impl WeighMultiAssets for MultiAssetFilter {
fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight {
match self {
Self::Definite(assets) => assets
.inner()
.into_iter()
.map(From::from)
.map(|t| match t {
AssetTypes::Balances => balances_weight,
AssetTypes::Unknown => Weight::MAX,
})
.fold(0, |acc, x| acc.saturating_add(x)),
_ => Weight::MAX,
}
}
}
impl WeighMultiAssets for MultiAssets {
fn weigh_multi_assets(&self, balances_weight: Weight) -> Weight {
self.inner()
.into_iter()
.map(|m| <AssetTypes as From<&MultiAsset>>::from(m))
.map(|t| match t {
AssetTypes::Balances => balances_weight,
AssetTypes::Unknown => Weight::MAX,
})
.fold(0, |acc, x| acc.saturating_add(x))
}
}
pub struct WestendXcmWeight<Call>(core::marker::PhantomData<Call>);
impl<Call> XcmWeightInfo<Call> for WestendXcmWeight<Call> {
fn withdraw_asset(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::withdraw_asset())
}
fn reserve_asset_deposited(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmGeneric::<Runtime>::reserve_asset_deposited())
}
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::receive_teleported_asset())
}
fn query_response(_query_id: &u64, _response: &Response, max_weight: &u64) -> Weight {
*max_weight
}
fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::transfer_asset())
}
fn transfer_reserve_asset(
assets: &MultiAssets,
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(
_origin_type: &OriginKind,
_require_weight_at_most: &u64,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
_sender: &u32,
_max_message_size: &u32,
_max_capacity: &u32,
) -> Weight {
XcmGeneric::<Runtime>::hrmp_new_channel_open_request()
}
fn hrmp_channel_accepted(_recipient: &u32) -> Weight {
XcmGeneric::<Runtime>::hrmp_channel_accepted()
}
fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight {
XcmGeneric::<Runtime>::hrmp_channel_closing()
}
fn clear_origin() -> Weight {
XcmGeneric::<Runtime>::clear_origin()
}
fn descend_origin(who: &InteriorMultiLocation) -> Weight {
XcmGeneric::<Runtime>::descend_origin(who)
}
fn report_error(
_query_id: &QueryId,
_dest: &MultiLocation,
_max_response_weight: &u64,
) -> Weight {
XcmGeneric::<Runtime>::report_error()
}
fn relayed_from(_who: &Junctions, _message: &Box<Xcm<Call>>) -> Weight {
XcmGeneric::<Runtime>::relayed_from()
}
fn deposit_asset(
assets: &MultiAssetFilter,
_max_assets: &u32, // TODO use max assets?
_dest: &MultiLocation,
) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::deposit_asset())
}
fn deposit_reserve_asset(
assets: &MultiAssetFilter,
_max_assets: &u32, // TODO use max assets?
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::deposit_reserve_asset())
}
fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets) -> Weight {
Weight::MAX // todo fix
}
fn initiate_reserve_withdraw(
assets: &MultiAssetFilter,
_reserve: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmGeneric::<Runtime>::initiate_reserve_withdraw())
}
fn initiate_teleport(
assets: &MultiAssetFilter,
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmBalancesWeight::<Runtime>::initiate_teleport())
}
fn query_holding(
_query_id: &u64,
_dest: &MultiLocation,
_assets: &MultiAssetFilter,
_max_response_weight: &u64,
) -> Weight {
XcmGeneric::<Runtime>::query_holding()
}
fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> Weight {
XcmGeneric::<Runtime>::buy_execution()
}
fn refund_surplus() -> Weight {
XcmGeneric::<Runtime>::refund_surplus()
}
fn set_error_handler(_xcm: &Xcm<Call>) -> Weight {
XcmGeneric::<Runtime>::set_error_handler()
}
fn set_appendix(_xcm: &Xcm<Call>) -> Weight {
XcmGeneric::<Runtime>::set_appendix()
}
fn clear_error() -> Weight {
XcmGeneric::<Runtime>::clear_error()
}
fn claim_asset(assets: &MultiAssets, _ticket: &MultiLocation) -> Weight {
XcmGeneric::<Runtime>::claim_asset(assets)
}
fn trap(code: &u64) -> Weight {
XcmGeneric::<Runtime>::trap(code)
}
fn subscribe_version(_query_id: &QueryId, _max_response_weight: &u64) -> Weight {
XcmGeneric::<Runtime>::subscribe_version()
}
fn unsubscribe_version() -> Weight {
XcmGeneric::<Runtime>::unsubscribe_version()
}
}
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_xcm_benchmarks::fungible`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128
// Executed Command:
// target/release/polkadot
// benchmark
// --chain=westend-dev
// --steps=50
// --repeat=20
// --pallet=pallet_xcm_benchmarks::fungible
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --template=./xcm/pallet-xcm-benchmarks/template.hbs
// --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weights for `pallet_xcm_benchmarks::fungible`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo<T> {
// Storage: System Account (r:1 w:1)
pub(crate) fn withdraw_asset() -> Weight {
(39_691_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:2 w:2)
pub(crate) fn transfer_asset() -> Weight {
(62_616_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:2 w:2)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
pub(crate) fn transfer_reserve_asset() -> Weight {
(86_642_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: Benchmark Override (r:0 w:0)
pub(crate) fn receive_teleported_asset() -> Weight {
(2_000_000_000_000 as Weight)
}
// Storage: System Account (r:1 w:1)
pub(crate) fn deposit_asset() -> Weight {
(49_745_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
pub(crate) fn deposit_reserve_asset() -> Weight {
(75_318_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: System Account (r:1 w:1)
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
// Storage: Dmp DownwardMessageQueues (r:1 w:1)
pub(crate) fn initiate_teleport() -> Weight {
(75_467_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}
// this whole file is temp, and will be replaced in the future TODO
use frame_support::dispatch::Weight;
pub struct WeightInfo<T>(sp_std::marker::PhantomData<T>);
impl<T: frame_system::Config> WeightInfo<T> {
pub fn query_holding() -> Weight {
1_000_000_000
}
pub fn buy_execution() -> Weight {
1_000_000_000
}
pub fn transact() -> Weight {
1_000_000_000
}
pub fn reserve_asset_deposited() -> Weight {
1_000_000_000
}
pub fn hrmp_new_channel_open_request() -> Weight {
1_000_000_000
}
pub fn hrmp_channel_accepted() -> Weight {
1_000_000_000
}
pub fn hrmp_channel_closing() -> Weight {
1_000_000_000