polkadot icon indicating copy to clipboard operation
polkadot copied to clipboard

XCM v3

Open gavofyork opened this issue 3 years ago • 29 comments

Introduce XCM version 3 and remove XCM versions 0 and 1.

Cumulus companion: https://github.com/paritytech/cumulus/pull/697

Closes #4069 Closes #4670

TODO

  • [x] Safe Dispatches
  • [x] ReportError & QueryHolding should use QueryResponseInfo
  • [x] Remove max_assets and ensure general asset match limitation
  • [x] Introduce & enforce maximum value for Holding.len().
  • [x] Tests
  • [x] #3940
  • [x] #4732
  • [x] #4681
  • [x] #4945
  • [x] https://github.com/paritytech/polkadot/pull/4950
  • [x] #4756
  • [x] Consider removing XCM v1: https://github.com/paritytech/polkadot/pull/5094
  • [x] Move ContainsPair to Substrate
  • [x] Asset namespacing primitive to allow the hosting of foreign assets
  • [x] Cumulus companion
  • [x] Clean up LocationInverter/UniversalLocation: It should just be a Get<InteriorMultiLocation>
  • [x] Extend PR description to include https://github.com/paritytech/polkadot/pull/4756 and https://github.com/paritytech/polkadot/pull/4950/.
  • [ ] https://github.com/paritytech/polkadot/pull/5237

Features

Two-stage SendXcm API supporting pricing and ID hash

SendXcm has been refactored to become a two-stage process, with the first stage yielding a ticket (which can be used to complete the operation) and a price for the operation. This allows the operation to be prepared and priced before optional completion at a later stage. This is utilised in order to allow for payment be determined and happen (or fail) prior to the delivery.

The second stage returns an identifying hash for the message which should be determinable at the destination side. Generally this is the hash of the bytes expressing the message sent "on the wire".

Topic

There is a new item in the XCVM state: topic: Option<[u8; 32]>. Context includes a topic: Option<[u8; 32]> field, representing this value. There should be two new instructions:

- `SetTopic([u8; 32])`: Sets the XCVM's topic to `Some`.
- `ResetTopic`: Sets the XCVM's topic to `None`.

Context

Functions in traits used by XcmExecutor now have knowledge of the Context of their instruction. This includes the Origin, message hash and Topic of the XCVM state:

pub struct XcmContext {
  origin: Option<MultiLocation>,
  message_hash: XcmHash,
  topic: [u8; 32],
}

Remote locking

Four new instructions added allowing for one chain to lock assets and notify another chain of this change as well as allowing this notified chain to request the assets be unlocked and for it to instruct the locking chain to unlock the assets.

The instructions are:

  • LockAsset
  • UnlockAsset
  • NoteUnlockable
  • RequestUnlock

A new API is introduced to allow integration of the on-chain locking mechanisms into these instructions and an example implementation of the API is done in XCM Pallet.

ExchangeAsset API

A new trait-based API is introduced to allow chains to implement the ExchangeAsset instruction.

Universal Location, Context

There is now a Universal Location under which all systems which generate their own consensus exist, and by extension, all possible locations within consensus. The concept of ancestry has been deprecated and instead there is the concept of Context, which is the location of something (e.g. generally the local chain) within the Universal Location. For chains which generate their own consensus like Polkadot and Kusama, it will generally just be a Junction::GlobalConsensus; but for other locations like parachains and smart contracts, it will be longer. Because contexts are locations relative to the Universal Location and because this is the top-level (though imaginary) consensus, all contexts can be expressed as a InteriorMultiLocations (i.e. they need not utilise any parents).

NetworkId no longer has Any

NetworkId is reworked to remove the Any which allows it to be used within the new Junction::GlobalConsensus. In the original usages of NetworkId, it is now an Option<NetworkId> where None may be placed instead to mean the equivalent of NetworkId::Any.

ExportXcm

A new API ExportXcm is introduced to allow for sending XCM to a system within a different global consensus. Like the SendXcm API this is two-stage and allows for price-discovery prior to initiation of final delivery. There are new SendXcm implementations (LocalUnpaidExporter, UnpaidRemoteExporter, SovereignPaidRemoteExporter) allowing use of ExportXcm to allow for messages to be routed via implementations of ExportXcm as well as a simple API (HaulBlobExporter) to allow easy integration of point-to-point inter-consensus systems (i.e. bridges).

New instruction UniversalOrigin

The UniversalOrigin instruction is introduced allowing messages to alter their origin to that of some alternative GlobalConsensus, effectively allowing a location to spoof another. This is a strictly permissioned instruction only available to select origins and only for particular changes. The specific use-case is for allowing bridges to forward a message and have it be executed as though it were from a location which is being bridged. It is utilised in the aforementioned SendXcm instructions.

New barrier

NOTE: For more information on this and other elements of XCM bridge integration, see the relevant PR.

Expectations

These are a set of instructions to allow errors to be thrown based on expectations of register contents. This effectively allows branching based on the contents of the Holding, Error and Origin registers.

Safe dispatches

This adds several facilities aiming to provide cross-chain pallet discovery and version-safety services. The features:

  • A new register Transact Status Register, storing the status of the most recent attempt to use Transact instruction.
  • A new instruction QueryPallet used to get a QueryRespose message informing of instances of a named pallet available on the chain.
  • A new instruction ExpectPallet used to throw an error if an identified pallet does not match expected versions and other information.
  • A new instruction ReportTransactStatus used to report the contents of the Transact Status Register to a destination.
  • A new instruction ClearTransactStatus to clear the value in the Transact Status Register.

BurnAsset

A new instruction BurnAsset for explicitly discarding from Holding.

Complexity caps

New facilities to ensure that the weight of operations involing the Holding Register can be estimated sensibly in advance. This introduces two main features:

  • The maximum size of Holding is capped with a new Config trait item for XcmExecutor.
  • There are two new wildcard variants which limit the matches by an integer count specified in the wildcard. This obsoletes max_assets.

Introduce querier field into QueryReponse

Introduce an additional field into the QueryResponse XCM instruction querier indicating the original initiator which led to this response being sent (from the point of view of the receiver). Typically this will simply be Here, since the receiver of the response will be the one who originally made the query.

The XCM pallet's query response handler system now allows expected query responses to have have an expected initiator of the response. Generally this is set to Here when new queries are initiated.

Before any query response is executed using the XCM pallet's response-dispatch system, the querier field is matched against what is expected. If it differs, then the ExpectedResponse barrier doesn't pass and the response is ignored.

Support for Non-fungibles

Provides XCM/MultiAsset support for using any implementer of the assets::nonfungible traits including, notably, Uniques pallet.

Introduces an example utilizing the pallet_uniques::Config::CreateOrigin type param allowing a Uniques pallet instance to automatically hold foreign NFTs in a reserve mechanism. Here we can allow the location which hosts them to create the NFT collection and thus determine who pays the deposits for any assets minted therein. NFTs can then be transferred in using the usual ReserveAssetTransfer mechanism, or, if the chains trust each other, then beamed in with a Teleport.

Code migration considerations v2 -> v3

XCM Pallet

The configuration trait for the XCM pallet has several new type parameters which must be configured. Assuming you have a Balances pallet configured and a type LocationToAccountId which converts a MultiLocation to an AccountId, then to retain previous behaviour, it can be set like this:

Old code:

impl pallet_xcm::Config for Runtime {
	/* snip */
}

New code:

use frame_support::traits::ConstU32;
impl pallet_xcm::Config for Runtime {
	/* snip */
	type Currency = Balances;
	type CurrencyMatcher = ();
	type TrustedLockers = ();
	type SovereignAccountOf = LocationToAccountId;
	type MaxLockers = ConstU32<8>;
}

XCM Executor Config trait

Configuration trait xcm_executor::Config has seven new items type MaxAssetsIntoHolding: Get<u32> (to be set to the most distinct assets you expect your chain to have to deal with in a single XCM at once, e.g. 8) type PalletInstancesInfo: PalletsInfoAccess (which should generally be set to AllPalletsWithSystem), AssetLocker, AssetExchanger, FeeManager and MessageExporter which can be all be defined as () to get the same behaviour as previously. Finally UniversalAliases, which can be set to Nothing to give the previous behaviour. Example code change:

Old code:

impl xcm_executor::Config for XcmConfig {
	/* snip */
}

New code:

impl xcm_executor::Config for XcmConfig {
	/* snip */
	type PalletInstancesInfo = AllPalletsWithSystem;
	type MaxAssetsIntoHolding = ConstU32<8>;
	type AssetLocker = ();
	type AssetExchanger = ();
	type FeeManager = ();
	type MessageExporter = ();
	type UniversalAliases = Nothing;
}

max_assets and Counted wildcards

max_assets has now been removed as a field from DepositAsset and DepositReserveAsset. For the purposes of calculating weight, the number of assets deposited when using a wildcard for assets field will be limited through MaxAssetsIntoHolding. If this yields too great a weight (as it likely will for operations which touch storage for each asset), then two new wildcard matches are provided: AllCounted and AllOfCounted, which have the same effect of limiting the number of assets matched as max_assets did.

Example code change:

Old code:

let beneficiary = /* snip */;
let x = DepositAsset { assets: (Here, 100).into(), max_assets: 1, beneficiary };
let y = DepositAsset { assets: Wild(All), max_assets: 5, beneficiary },

New code:

let beneficiary = /* snip */;
let x = DepositAsset { assets: (Here, 100).into(), beneficiary };
let y = DepositAsset { assets: Wild(AllCounted(5)), beneficiary },
```	

### Location Inversion Removed

The act of inverting a location is now largely contained within reanchoring functions and is no longer exposed in downstream APIs. `InvertLocation` trait and `LocationInverter` struct are removed. Those config type items now become `UniversalLocation: Get<InteriorMultiLocation>`.

The `UniversalLocation` is similar but different to the old `Ancestry`: it is the location of the chain within _Universal Consensus_, including the top-level consensus system. It should always begin with a `GlobalConsensus` junction.

Old code, for a Kusama parachain:

```rust
parameter_types! {
	pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
}
impl xcm_executor::Config for XcmConfig {
	// snip
	type LocationInverter = LocationInverter<Ancestry>;
}

New code for that same parachain:

parameter_types! {
	pub UniversalLocation: InteriorMultiLocation = (
		GlobalConsensus(Kusama),
		Parachain(ParachainInfo::parachain_id().into(),
	).into();
}
impl xcm_executor::Config for XcmConfig {
	// snip
	type UniversalLocation = UniversalLocation;
}

Note that it is now a InteriorMultiLocation, and that the location includes the relay-chain consensus, since it is the parent consensus.

XcmContext

Several APIs now accept an additional context: &XcmContext parameter (except in the case of withdraw_asset, which accepts a maybe_context: Option<&XcmContext>).

This parameter must be added, but its value may be ignored.

XcmHash

SendXcm and ExportXcm must both provide an XcmHash value back from deliver function if it returns Ok. It is up to the trait implementation exactly how this hash is determined, however in general it should identify the message which was sent and should be identifiable on both sides of the transport. Generally this will mean hashing the data which is encoded and set on the wire (or the common part of it, if it changes over the transport).

XcmExecutor

XcmExecutor::execute has now been renamed to XcmExecutor::bench_process and is only enabled for benchmarks. Prior to this it has collided with the trait function ExecuteXcm::execute.

Delivery Pricing

xcm_sender::ChildParachainRouter now takes an extra generic parameter to indicate the price for sending a message using UMP. For previous behaviour, use () for this new parameter.

Old code:

pub type XcmRouter = (
	xcm_sender::ChildParachainRouter<Runtime, XcmPallet>,
);

New code:

pub type XcmRouter = (
	xcm_sender::ChildParachainRouter<Runtime, XcmPallet, ()>,
);

The struct xcm_sender::ConstantPrice can be used in place of () in order to allow for the price to be configured simply with a constant. Or, of course, you can create your own implementation for maximum flexibility over delivery pricing.

Cumulus

cumulus_primitives_utility::ParentAsUmp now takes an extra generic parameter to indicate the price for sending a message using UMP. For previous behaviour, use () for this new parameter.

Old code:

pub type XcmRouter = (
	cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm>,
);

New code:

pub type XcmRouter = (
	cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>,
);

Similarly, cumulus_pallet_xcmp_queue::Config has an additional type PriceForSiblingDelivery. This may also be set to () for previous behaviour:

Old code:

impl cumulus_pallet_xcmp_queue::Config for Runtime {
	// snip
}

New code:

impl cumulus_pallet_xcmp_queue::Config for Runtime {
	// snip
	type PriceForSiblingDelivery = ();
}

Renames & Minor Refactors

Renames:

  • v2::Instruction::Transact::origin_type is renamed to become v3::Instruction::Transact::origin_kind.
  • v2::Instruction::QueryHolding is renamed to become v3::Instruction::ReportHolding.
  • xcm_builder::ConvertedConcreteAssetId is renamed to ConvertedConcreteId.
  • xcm_builder::ConvertedAbstractAssetId is renamed to ConvertedAbstractId.

Refactors:

  • query_id/dest/max_response_weight is now combined into a single struct QueryResponseInfo. Therefore:
    • v2::QueryHolding{query_id, dest, max_response_weight, assets} becomes v3::Instruction::ReportHolding{response_info, assets}.
    • v2::ReportError{query_id, dest, max_response_weight} becomes v3::Instruction::ReportError(response_info).
    • Junction::into is not a const fn any longer. Use Junction::into_location.
  • FilterAssetLocation is now replaced by ContainsPair<MultiAsset, MultiLocation>.

gavofyork avatar Oct 17 '21 20:10 gavofyork

Does the inclusion of a new ConversionError sound good to you? This will be an error enum that gets returned by TryFrom conversions upon failure. If so, do we retroactively introduce them to all versions, or only starting from v3?

KiChjang avatar Oct 19 '21 10:10 KiChjang

No alterations to v2's standard are possible now.

gavofyork avatar Oct 19 '21 11:10 gavofyork

Just weights to do now... cc @shawntabrizi @KiChjang

gavofyork avatar Oct 25 '21 16:10 gavofyork

@gavofyork Weights are actually being worked on in paritytech/polkadot#3940. OK to merge this as-is and let that PR handle it? Shawn has no problems with doing so.

KiChjang avatar Oct 27 '21 16:10 KiChjang

Sure.

gavofyork avatar Oct 28 '21 16:10 gavofyork

May not want to merge quite yet though... might be better sitting in its own branch until XCM v3 is ready.

gavofyork avatar Oct 28 '21 16:10 gavofyork

Weights and benchmarks for the new XCM instructions are being worked on in paritytech/polkadot#4564.

KiChjang avatar Dec 19 '21 10:12 KiChjang

Can we have this included in polkadot-v0.9.15?

0x8f701 avatar Jan 07 '22 02:01 0x8f701

Unfortunately, it's probably a little while from release. XCM upgrades are non-trivial for parachain teams, and I'd really want to get https://github.com/paritytech/polkadot/pull/4681/ included into v3.

gavofyork avatar Jan 18 '22 13:01 gavofyork

Would it make sense to add a generic RelayMessage instruction which just delivers opaque data to the receiver? I imagine that if we make it possible to route XCM messages to pallet-contracts that this instruction just calls the contract with the supplied bytes as input. This removes the need to use a Transact instruction which relies on the unstable transaction encoding.

Otherwise we might need to add a new entry point to contracts which just get the XCM as-is as an input but the former seems more elegant to me. What do you think?

Please note that in any case we need to inspect the message inside the runtime in order to setup the gas meter according to the BuyExecution instruction.

athei avatar Jan 24 '22 11:01 athei

How would it be defined differently to Transact?

gavofyork avatar Jan 31 '22 11:01 gavofyork

For allowing smart-contracts to receive XCM sent from the local chain I would basically just add a new SendXcm router into the routing tuple.

It gets a bit more difficult when it's sent from another chain as it then requires multi-hop routing with payment into the secondary system. I would probably just add a new ForAttentionOf instruction which acts like an onward-routing directive. I'm not familiar with the progress on smart contracts executing XCM. If we're already at the point that pallet-contracts/pallet-evm can implement ExecuteXcm, then I'm happy to try to get this functionality into Xcm v3.

gavofyork avatar Jan 31 '22 11:01 gavofyork

How would it be defined differently to Transact?

I was always thinking about Transact as a "top level" transaction. So essentially the encoding of a Call in the substrate case. However, thinking about it I think the meaning of it depends on the MultiLocation it is delivered to. If the destination is a substrate chain it would be a Call but when you address a contract within the contracts pallet it could be something else (like whatever a contract would expect as a input). If this is true then Transact is fine.

I'm not familiar with the progress on smart contracts executing XCM. If we're already at the point that pallet-contracts/pallet-evm can implement ExecuteXcm, then I'm happy to try to get this functionality into Xcm v3.

I put the XCM into contracts project on the back burner after I noticed that depending on the polkadot repository from substrate could be a problem. I basically thought I will start again when XCMv3 is merged and transferred to its own repository. AFAIK there is no precedence of a substrate pallet depending on XCM. Is it sensible to add a git dependeny on the polkadot repo from pallet-contracts?

athei avatar Jan 31 '22 11:01 athei

I put the XCM into contracts project on the back burner after I noticed that depending on the polkadot repository from substrate could be a problem. I basically thought I will start again when XCMv3 is merged and transferred to its own repository. AFAIK there is no precedence of a substrate pallet depending on XCM. Is it sensible to add a git dependeny on the polkadot repo from pallet-contracts?

No. I'd prefer to keep the main Substrate repo independent of XCM. It's possible in the future that the polkadot/xcm path will get its own repo, but probably won't happen any time soon. Better to create a new pallet pallet-contracts-xcm or whatever (which goes in Polkadot repo) and then introduce some trait interface into it and pallet-contracts to allow them to interact.

gavofyork avatar Feb 19 '22 16:02 gavofyork

The cumulus error is spurious. Companion has master merged and builds fine.

gavofyork avatar Mar 12 '22 09:03 gavofyork

/benchmark xcm westend pallet_xcm_benchmarks::generic

KiChjang avatar Apr 15 '22 06:04 KiChjang

Benchmark Westend XCM for branch "gav-xcm-v3" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --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_generic.rs

Toolchain: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

Results
error: Found argument '--chain' which wasn't expected, or isn't valid in this context

	If you tried to supply `--chain` as a value rather than a flag, use `-- --chain`

USAGE:
    polkadot benchmark <SUBCOMMAND>

For more information try --help

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

parity-benchapp[bot] avatar Apr 15 '22 06:04 parity-benchapp[bot]

/benchmark xcm westend pallet_xcm_benchmarks::generic

KiChjang avatar Apr 15 '22 20:04 KiChjang

Benchmark Westend XCM for branch "gav-xcm-v3" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --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_generic.rs

Toolchain: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-04-15 20:56:02 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-04-15 20:56:02 Took active validators from set with wrong size    
2022-04-15 20:56:02 Took active validators from set with wrong size.    
2022-04-15 20:56:02 Took active validators from set with wrong size    
2022-04-15 20:56:03 WARNING: benchmark error skipped - reserve_asset_deposited    
2022-04-15 20:56:03 WARNING: benchmark error skipped - reserve_asset_deposited    
2022-04-15 20:56:03 WARNING: benchmark error skipped - reserve_asset_deposited    
2022-04-15 20:56:03 WARNING: benchmark error skipped - exchange_asset    
2022-04-15 20:56:03 WARNING: benchmark error skipped - exchange_asset    
2022-04-15 20:56:03 WARNING: benchmark error skipped - exchange_asset    
2022-04-15 20:56:03 XCM ERROR >> Index: 0, Error: InvalidLocation, Weight: 0    
2022-04-15 20:56:03 XCM ERROR >> Index: 0, Error: InvalidLocation, Weight: 0    
Error: 
   0: [91mInvalid input: xcm executor error: see error logs[0m

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

parity-benchapp[bot] avatar Apr 15 '22 20:04 parity-benchapp[bot]

/benchmark xcm westend pallet_xcm_benchmarks::generic

KiChjang avatar Apr 15 '22 21:04 KiChjang

Benchmark Westend XCM for branch "gav-xcm-v3" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --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_generic.rs

Toolchain: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

Results
2022-04-15 21:48:34 [0] 💸 generated 1 npos voters, 1 from validators and 0 nominators    
2022-04-15 21:48:34 Took active validators from set with wrong size    
2022-04-15 21:48:34 Took active validators from set with wrong size.    
2022-04-15 21:48:34 Took active validators from set with wrong size    
2022-04-15 21:48:35 WARNING: benchmark error skipped - reserve_asset_deposited    
2022-04-15 21:48:35 WARNING: benchmark error skipped - reserve_asset_deposited    
2022-04-15 21:48:35 WARNING: benchmark error skipped - reserve_asset_deposited    
2022-04-15 21:48:35 WARNING: benchmark error skipped - exchange_asset    
2022-04-15 21:48:35 WARNING: benchmark error skipped - exchange_asset    
2022-04-15 21:48:35 WARNING: benchmark error skipped - exchange_asset    
2022-04-15 21:48:35 XCM ERROR >> Index: 0, Error: InvalidLocation, Weight: 0    
2022-04-15 21:48:35 XCM ERROR >> Index: 0, Error: InvalidLocation, Weight: 0    
Error: 
   0: [91mInvalid input: xcm executor error: see error logs[0m

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

ERROR: Unable to commit file ./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

parity-benchapp[bot] avatar Apr 15 '22 21:04 parity-benchapp[bot]

/benchmark xcm westend pallet_xcm_benchmarks::generic

KiChjang avatar Apr 17 '22 08:04 KiChjang

Benchmark Westend XCM for branch "gav-xcm-v3" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --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_generic.rs

Toolchain: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "report_holding", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    24.68
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    24.68
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "buy_execution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     3.62
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     3.62
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "query_response", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet Queries (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    12.94
              µs

Reads = 1
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    12.94
              µs

Reads = 1
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "transact", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     13.2
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     13.2
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "refund_surplus", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.879
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.879
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_error_handler", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.659
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.659
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_appendix", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.743
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.743
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_error", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.711
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.711
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "descend_origin", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.618
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.618
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_origin", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.588
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.588
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "report_error", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.33
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.33
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "claim_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet AssetTraps (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     7.65
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     7.65
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "trap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.617
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.617
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "subscribe_version", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet VersionNotifyTargets (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    28.61
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    28.61
              µs

Reads = 6
Writes = 4

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "unsubscribe_version", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet VersionNotifyTargets (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.443
              µs

Reads = 0
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.443
              µs

Reads = 0
Writes = 1

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "initiate_reserve_withdraw", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=     24.4
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=     24.4
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "burn_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.259
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.259
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.745
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.745
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_origin", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.847
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.847
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_error", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.633
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.633
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "query_pallet", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.64
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.64
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_pallet", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.017
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.017
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "report_transact_status", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.46
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    20.46
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_transact_status", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.723
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.723
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_topic", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.687
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.687
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_topic", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.654
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.654
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_fees_mode", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.721
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.721
              µs

Reads = 0
Writes = 0


parity-benchapp[bot] avatar Apr 17 '22 08:04 parity-benchapp[bot]

/benchmark xcm kusama pallet_xcm_benchmarks::generic

KiChjang avatar Apr 17 '22 09:04 KiChjang

Benchmark Kusama XCM for branch "gav-xcm-v3" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark pallet --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

Toolchain: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

Results
error: failed to run custom build command for `westend-runtime v0.9.19 (/home/benchbot/bench-bot/git/polkadot/runtime/westend)`

Caused by:
  process didn't exit successfully: `/home/benchbot/bench-bot/git/polkadot/target/production/build/westend-runtime-52b8c7c250b3cb7a/build-script-build` (exit status: 1)
  --- stdout
  [1;33mInformation that should be included in a bug report.[0m
  [1;33mExecuting build command:[0m "rustup" "run" "nightly" "cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/home/benchbot/bench-bot/git/polkadot/target/production/wbuild/westend-runtime/Cargo.toml" "--color=always" "--profile" "production"
  [1;33mUsing rustc version:[0m rustc 1.59.0-nightly (b60e32c82 2021-12-30)


  --- stderr
  [0m[0m[1m[36m    Blocking[0m waiting for file lock on package cache
  [0m[0m[1m[32m   Compiling[0m westend-runtime v0.9.19 (/home/benchbot/bench-bot/git/polkadot/runtime/westend)
  [0m[1m[38;5;9merror[E0599][0m[0m[1m: no function or associated item named `exchange_asset` found for struct `pallet_xcm_benchmarks_generic::WeightInfo` in the current scope[0m
  [0m   [0m[0m[1m[38;5;12m--> [0m[0m/home/benchbot/bench-bot/git/polkadot/runtime/westend/src/weights/xcm/mod.rs:143:50[0m
  [0m    [0m[0m[1m[38;5;12m|[0m
  [0m[1m[38;5;12m143[0m[0m [0m[0m[1m[38;5;12m| [0m[0m        give.weigh_multi_assets(XcmGeneric::<Runtime>::exchange_asset())[0m
  [0m    [0m[0m[1m[38;5;12m| [0m[0m                                                       [0m[0m[1m[38;5;9m^^^^^^^^^^^^^^[0m[0m [0m[0m[1m[38;5;9mfunction or associated item not found in `pallet_xcm_benchmarks_generic::WeightInfo<Runtime>`[0m
  [0m    [0m[0m[1m[38;5;12m|[0m
  [0m   [0m[0m[1m[38;5;12m::: [0m[0m/home/benchbot/bench-bot/git/polkadot/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs:47:1[0m
  [0m    [0m[0m[1m[38;5;12m|[0m
  [0m[1m[38;5;12m47[0m[0m  [0m[0m[1m[38;5;12m| [0m[0mpub struct WeightInfo<T>(PhantomData<T>);[0m
  [0m    [0m[0m[1m[38;5;12m| [0m[0m[1m[38;5;12m-----------------------------------------[0m[0m [0m[0m[1m[38;5;12mfunction or associated item `exchange_asset` not found for this[0m
  [0m    [0m[0m[1m[38;5;12m|[0m
  [0m    [0m[0m[1m[38;5;12m= [0m[0m[1mhelp[0m[0m: items from traits can only be used if the trait is implemented and in scope[0m
  [0m    [0m[0m[1m[38;5;12m= [0m[0m[1mnote[0m[0m: the following traits define an item `exchange_asset`, perhaps you need to implement one of them:[0m
  [0m            candidate paritytech/polkadot#1: `xcm::v2::XcmWeightInfo`[0m
  [0m            candidate paritytech/polkadot#2: `xcm::v3::XcmWeightInfo`[0m
  [0m            candidate paritytech/polkadot#3: `AssetExchange`[0m

  [0m[1mFor more information about this error, try `rustc --explain E0599`.[0m
  [0m[0m[1m[31merror[0m[1m:[0m could not compile `westend-runtime` due to previous error
error: build failed

ERROR: Unable to commit file ./runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

parity-benchapp[bot] avatar Apr 17 '22 09:04 parity-benchapp[bot]

/benchmark xcm kusama pallet_xcm_benchmarks::generic

KiChjang avatar Apr 18 '22 20:04 KiChjang

Benchmark Kusama XCM for branch "gav-xcm-v3" with command cargo run --quiet --profile=production --features=runtime-benchmarks -- benchmark pallet --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs

Toolchain: stable-x86_64-unknown-linux-gnu (default) rustc 1.57.0 (f1edd0429 2021-11-29)

Results
Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "report_holding", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    25.87
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    25.87
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "buy_execution", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.697
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.697
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "query_response", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet Queries (r:1 w:0)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    13.45
              µs

Reads = 1
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    13.45
              µs

Reads = 1
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "transact", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    13.59
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    13.59
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "refund_surplus", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.839
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.839
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_error_handler", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.657
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.657
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_appendix", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.757
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.757
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_error", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.651
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.651
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "descend_origin", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.589
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.589
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_origin", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.661
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.661
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "report_error", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.35
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.35
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "claim_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet AssetTraps (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    7.674
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    7.674
              µs

Reads = 1
Writes = 1

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "trap", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.606
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.606
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "subscribe_version", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet VersionNotifyTargets (r:1 w:1)
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    30.45
              µs

Reads = 6
Writes = 4

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    30.45
              µs

Reads = 6
Writes = 4

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "unsubscribe_version", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet VersionNotifyTargets (r:0 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.543
              µs

Reads = 0
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.543
              µs

Reads = 0
Writes = 1

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "initiate_reserve_withdraw", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    25.46
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    25.46
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "burn_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.194
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    5.194
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_asset", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.698
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.698
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_origin", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.786
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.786
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_error", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.645
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.645
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "query_pallet", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.99
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.99
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "expect_pallet", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.043
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    4.043
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "report_transact_status", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: XcmPallet SupportedVersion (r:1 w:0)
Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1)
Storage: XcmPallet SafeXcmVersion (r:1 w:0)
Storage: Dmp DownwardMessageQueueHeads (r:1 w:1)
Storage: Dmp DownwardMessageQueues (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.66
              µs

Reads = 5
Writes = 3

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    21.66
              µs

Reads = 5
Writes = 3

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_transact_status", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.673
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.673
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_topic", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.661
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.661
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "clear_topic", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.647
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.647
              µs

Reads = 0
Writes = 0

Pallet: "pallet_xcm_benchmarks::generic", Extrinsic: "set_fees_mode", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.599
              µs

Reads = 0
Writes = 0

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    3.599
              µs

Reads = 0
Writes = 0


parity-benchapp[bot] avatar Apr 18 '22 20:04 parity-benchapp[bot]

I have been reviewing and testing this branch and I have been thinking about the GeneralKey Junction change. Right now it is not possible to Convert from a v2 GeneralKey to a v3 GeneralKey:

impl TryFrom<OldJunction> for Junction {
	type Error = ();
	fn try_from(value: OldJunction) -> Result<Self, ()> {
		use OldJunction::*;
		Ok(match value {
			Parachain(id) => Self::Parachain(id),
			AccountId32 { network, id } => Self::AccountId32 { network: network.into(), id },
			AccountIndex64 { network, index } =>
				Self::AccountIndex64 { network: network.into(), index },
			AccountKey20 { network, key } => Self::AccountKey20 { network: network.into(), key },
			PalletInstance(index) => Self::PalletInstance(index),
			GeneralIndex(id) => Self::GeneralIndex(id),
			GeneralKey(_key) => return Err(()),
			OnlyChild => Self::OnlyChild,
			Plurality { id, part } =>
				Self::Plurality { id: id.try_into()?, part: part.try_into()? },
		})
	}
}

We know there are some chains that use the GeneralKey Junction to represent their tokens (e.g. Acala). How would the upgrade look like without service interruption? Because I think right now if Parachain A and Parachain B are in V2 and they are transferring a token represented by the GeneralKey function, and one of them upgrades to V3, the back and forth transfer of that token would break right? Or am I missing something?

By break I mean that one chain would send the message with a v2 GeneralKey, while the other chain would try to transform it to a V3 and would fail.

girazoki avatar May 11 '22 12:05 girazoki

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/xcm-latest-updates/389/2

Polkadot-Forum avatar Sep 15 '22 14:09 Polkadot-Forum

/cmd queue -c bench-bot $ runtime westend-dev pallet_xcm

KiChjang avatar Dec 06 '22 18:12 KiChjang