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

Make XCM Instructions with Wild filter weighable. #4069

Closed
shawntabrizi opened this issue Oct 13, 2021 · 1 comment · Fixed by #4097
Closed

Make XCM Instructions with Wild filter weighable. #4069

shawntabrizi opened this issue Oct 13, 2021 · 1 comment · Fixed by #4097

Comments

@shawntabrizi
Copy link
Member

shawntabrizi commented Oct 13, 2021

XCM Currently supports a MultiAssetFilter::Wild filter where:

pub enum WildMultiAsset {
	/// All assets in the holding register, up to `usize` individual assets (different instances of non-fungibles could
	/// be separate assets).
	All,
	/// All assets in the holding register of a given fungibility and ID. If operating on non-fungibles, then a limit
	/// is provided for the maximum amount of matching instances.
	AllOf { id: AssetId, fun: WildFungibility },
}

In the case that this filter is used, we cannot currently know the worst case scenario for weighing these instructions.

To solve this we need to implement two new features:

  1. Add an overall MAX_HOLDING_ASSETS constant to the whole XCM Executor configuration which can be used in any situation to provide a pessimistic upper bound on how many assets could be matched from Holding.
  2. For instructions where a pessimistic upper bound is not good enough (e.g. when there is a storage write for every asset matched such as in InitiateTeleport), provide a facility for specifying a more accurate asset-match-count via a max_assets field. Introduce AllCounted and AllOfCounted in Wild and remove all max_assets stuff.

These changes are breaking and should be included in XCM v3

@gavofyork gavofyork mentioned this issue Oct 21, 2021
27 tasks
@gavofyork
Copy link
Member

Closed with #4097

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants