Skip to content
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

Update teleport_assets Extrinsics for Foreign Assets #96

Closed
joepetrowski opened this issue Aug 18, 2023 · 3 comments
Closed

Update teleport_assets Extrinsics for Foreign Assets #96

joepetrowski opened this issue Aug 18, 2023 · 3 comments
Assignees
Labels
I5-enhancement An additional feature request. T6-XCM This PR/Issue is related to XCM.

Comments

@joepetrowski
Copy link
Contributor

Right now the teleport_assets_* extrinsics use the teleported asset to BuyExecution on the destination chain. This can cause a problem if the teleported asset cannot be used for fee payment.

As an example, a parachain may be a trusted teleporter of its own native asset, but not for DOT, which is valid for fee payment on Asset Hub.

The extrinsic should be able to construct alternate XCM programs that would pay fees according to the parameters. Options include:

  1. WithdrawAsset from the parachain's sovereign account on the destination chain and use that for BuyExecution.
  2. Allow the deposit of reserve assets (e.g. DOT) prior to the ReceiveTeleportedAsset instruction.

Probably requires changes to the impl of XcmExecutor (e.g. in InitiateTeleportedAsset.

Originally posted by @joepetrowski in paritytech/cumulus#2935 (comment)

@joepetrowski joepetrowski transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. and removed J0-enhancement labels Aug 25, 2023
@bkontur
Copy link
Contributor

bkontur commented Sep 14, 2023

We've tried to implement PoC for buying execution on destination from sovereign account for reserve_transfer_assets here, which seems almost the same as this issue. As PoC, we used AliasOrigin with one change in XcmExecutor,
which I also discussed here and here is another discussion from element,
but maybe it requires another approach.

@acatangiu acatangiu self-assigned this Mar 18, 2024
@acatangiu acatangiu added the T6-XCM This PR/Issue is related to XCM. label Mar 18, 2024
@joepetrowski
Copy link
Contributor Author

@acatangiu is this addressed by some of the other transfer changes you've made recently? Or should we leave it open?

@acatangiu
Copy link
Contributor

This is possible now, but only if the Parachain trusts AH as reserve for DOT, so it can send AssetA and DOT directly to it (in same XCM message):

ParaA --Assets--> AH

where

Assets = [AssetA (teleport), DOT (reserve-withdraw)]

fees paid with DOT


If the Parachain does NOT trust AH as reserve, there is NO way to send both assets at once (in a single transfer), because they would have different routes, so two independent asynchronous messages with no ordering guarantee:

ParaA --------AssetA--------> AH
   |                           ^
   |                           |
   +--DOT--> Relaychain --DOT--+

if the transfer is fired for both assets at the same time, AssetA can arrive before the DOT and there is no way to control the order, so DOT cannot be used to pay for fees.


When Parachain trusts AH as reserve for DOT

Simply use pallet_xcm::transfer_assets() and it will do the rest.

Example: bidirectional transfers of [ForeignAsset, DOT] between Penpal and AH, using pallet_xcm::transfer_assets().

Or one can also explicitly define the "route" and "types" of transfer used with pallet_xcm::transfer_assets_using_type_and_then().

Example: bidirectional transfers of [ForeignAsset, DOT] between Penpal and AH, using pallet_xcm::transfer_assets_using_type_and_then().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

No branches or pull requests

4 participants