[WIP] Non-teleportable Foreign Assets on Asset Hub - Option 1 - new pallet-assets-reserves #9934
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Asset Hub currently supports registering following types of assets:
u32
asset ID, asset creatable by Signed accounts and managed byPalletInstance(50)
.Location
as asset ID, creatable only by external locations over XCM.For "foreign assets", the current code assumes and enforces that the asset is teleportable with its original location/creator.
Some ecosystem parachains would want to register foreign assets on Asset Hub, but not also have them teleportable, not have Asset Hub act as a reserve for the asset. Multiple reserve locations adds reserve management overhead for teams, and some don't want to do it.
E.g. for HOLLAR to be registered to Asset Hub, Asset Hub would have to allow reserve-based foreign assets.
Solution
This PR adds a new
pallet-assets-reserves
that can be used to configure the trusted reserves (as seen by the local chain) on a per-asset basis.It also adds runtime machinery to use the assets reserves information when reasoning about XCM teleports and XCM reserve-based transfers.
For each asset, the base chain described in its asset id location is considered a default reserve chain without it having to be explicitly configured.
Any other chain that should be assumed as a trusted reserve needs to be marked as such in
pallet-assets-reserves
by the asset's Owner or Admin.When the local chain is also marked as a reserve (
Here
is added to the list of reserves) for a particular asset, then that asset can be teleported between the local chain and any other reserve location.By default, on asset creation, no explicit reserve chain is configured, this results in foreign assets to be reserve-based assets by default and not teleportable. To make them teleportable with their origin chain,
Here
needs to be added as a reserve (local chain to also be a reserve).AH considerations
Since there are already a number of Foreign Assets already registered, and have been teleportable since registration, this PR also adds a migration that adds
Here
as a reserve for existing foreign assets, so as not to change any existing behaviors.Newly registered foreign assets will not be teleportable by default - which is the desired result of this PR.
They can be configured to be teleportable by the asset's Owner or Admin, post-creation.