-
Notifications
You must be signed in to change notification settings - Fork 298
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
Xtokens Polkadot 1.5 XCM with Different Reserves #973
Comments
Yeah we can add this |
Actually, can you elaborate a bit more about this issue? In what case that pallet-xcm is supported but xtokens is not? https://github.com/paritytech/polkadot-sdk/blob/5c79ed37dc6485d2b3f4fc69b8cf8456b86b4e17/polkadot/xcm/pallet-xcm/src/lib.rs#L1479-L1481 it looks to me also doesn't support sending assets with different reserve in a single call. |
Hey @xlc - The PR I referenced in the initial comment adds the new @Agusrodri tried this already on an internal network, and it worked. This is the function: https://github.com/paritytech/polkadot-sdk/blob/5c79ed37dc6485d2b3f4fc69b8cf8456b86b4e17/polkadot/xcm/pallet-xcm/src/lib.rs#L1287 |
I can't find the code in asset_transfer that does the magic. Could you provide an example of the usage in your internal network? What kinds of assets are been transferred? |
Hey @xlc! Here is a test that checks the following scenario:
The new extrinsic In this case, the asset used to pay fees is Of course, for this use case to work, both chains have to support each corresponding foreign asset. |
Thanks for the example. I have identified a few improvements that we need to do to support such use case:
|
A quick update. I started the refactor work to improve xtokens based on the asset_transfer implementation. However, recently there are also few more issues and improvements have been raised about the asset_transfer. So I will wait a bit and see how it goes. Also the complexity of this is kinda getting out of control and that means something is wrong. Not sure if there is anything we can do though. |
With all the additional complicated requirements, I am considering maybe we should just deprecate xtokens and use pallet-xcm instead. xtokens is built because there was no pallet offers such functionality. Now that pallet-xcm should support all the transfer needs, I don't feel the needs to support an alternative implementation. |
I agree. I think Moonbeam is moving away from Xtokens in favor of Pallet XCM. |
@albertov19 @xlc is there any update around this? Note that the incoming 1.2.4 release will implement a new interface from pallet XCM which will allow all the scenarios mentioned above plus many more complex cases. |
@IkerAlus We are slowly transitioning to PalletXCM, but there is no hard deadline and this will be a slow process as there are many teams still using our Xtokens precompile |
I think it is best to keep xtokens as it is for compatibility reason and for new use cases, use new features from the pallet-xcm |
As part of paritytech/polkadot-sdk@e7651cf - pallet XCM now allows to send reserve and non-reserve assets in a single XCM message.
Nevertheless, Xtokens requires that both the asset and feeAsset should come from the same reserve - https://github.com/open-web3-stack/open-runtime-module-library/blob/master/xtokens/src/lib.rs#L549-L554
It would be great if Xtokens supports the scenario that is supported now by pallet-xcm
The text was updated successfully, but these errors were encountered: