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

DOT can't transfer directly from parachain to AssetHub #4917

Closed
hqwangningbo opened this issue Jul 1, 2024 · 4 comments
Closed

DOT can't transfer directly from parachain to AssetHub #4917

hqwangningbo opened this issue Jul 1, 2024 · 4 comments
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@hqwangningbo
Copy link

hqwangningbo commented Jul 1, 2024

xtokens.transfer: https://bifrost.subscan.io/xcm_message/polkadot-4e0a1ecd85156b054492a41ea087d48bb82b5466
polkadotXcm.transferAssets: https://bifrost.subscan.io/extrinsic/5039021-2

Both transactions although executed successfully, but fail on AssetHub

@github-actions github-actions bot added the I10-unconfirmed Issue might be valid, but it's not yet known. label Jul 1, 2024
@acatangiu
Copy link
Contributor

acatangiu commented Jul 1, 2024

This is an xtokens issue: https://bifrost.subscan.io/extrinsic/5038923-2, please open an issue there.

I see the transfer worked fine with pallet_xcm: https://bifrost.subscan.io/extrinsic/5039021-2

@acatangiu
Copy link
Contributor

ah, yes, the issue is that Bifrost does not recognize AssetHub as a trusted reserve location for DOT - so it decides to go through the Relay chain as the reserve location, but between Relay and AH DOT has to be teleported, not reserve-transferred.

Proper solution

Bifrost should trust AH as a reserve for DOT and make their life and their users' lives easy.
(This transfer would have then been simple point-to-point).

Workaround

As long as Bifrost does not support AH as DOT reserve, DOT transfers to AH will have to go through the Relay chain (as attempted above).

The XCM program is being fully constructed on the origin chain (Bifrost), and parachains (Bifrost included) don't hold an on-chain map/registry of which assets can be teleported where.

So neither xtokens nor pallet-xcm can know to build the XCM program with a teleport for the second leg of the journey, so they build the wrong program in this particular case.

There is no pallet/on-chain solution for this (other than trusting AH as reserve for DOT as described above).

The transfer would still be possible by using pallet_xcm::transfer_assets_using_type_and_then() which allows the caller to define which transfer types to use and what should happen on subsequent hops.
Unlike the on-chain logic, the (off-chain) caller can get the asset-reserves/teleports between various chains information from off-chain registries.

For this particular transfer, this could work (but also needs #4834):
https://github.com/paritytech/polkadot-sdk/blob/0bc841ce4c20ae96d8b1299878103f7d31c7b4df/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/hybrid_transfers.rs#L904C3-L914C4 (with Relay and AH reversed in your case).

But as you can see, things become complicated when you can't simply transfer DOT straight to AH (trust AH as reserve of DOT).

@hqwangningbo
Copy link
Author

I get it,thank you for explaining it to me in detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants