-
Notifications
You must be signed in to change notification settings - Fork 1k
pallet-assets: add reserves info to support non-teleportable Foreign Assets on Asset Hub #9948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
acatangiu
wants to merge
14
commits into
paritytech:master
Choose a base branch
from
acatangiu:enhance-pallet-assets-with-reserves
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
pallet-assets: add reserves info to support non-teleportable Foreign Assets on Asset Hub #9948
acatangiu
wants to merge
14
commits into
paritytech:master
from
acatangiu:enhance-pallet-assets-with-reserves
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alternative to #9934 |
_Context_ Asset Hub currently supports registering following types of assets: 1. Local Assets (also called trust-based assets), with `u32` asset ID, asset creatable by Signed accounts and managed by `PalletInstance(50)`. 2. Foreign Assets, `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, Hydration wants Asset Hub to allow reserve-based foreign assets. _Solution_ This PR adds a new storage item and new call to `pallet-assets` 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. Signed-off-by: Adrian Catangiu <[email protected]> move reserves config to pallet-assets
c6dc933
to
aea83bb
Compare
…nce-pallet-assets-with-reserves
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A4-backport-stable2509
Pull request must be backported to the stable2509 release branch
A4-backport-unstable2507
Pull request must be backported to the unstable2507 release branch
T6-XCM
This PR/Issue is related to XCM.
T14-system_parachains
This PR/Issue is related to system parachains.
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 storage item and new call to
pallet-assets
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.