-
Notifications
You must be signed in to change notification settings - Fork 338
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
Integrate orml-xtokens into Shibuya #929
Conversation
// Default impl. Refer to `orml-xtokens` docs for more details. | ||
type MinXcmFee = DisabledParachainFee; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, this will disable double XCM support (not sure how it's properly called 🙂 ), e.g. Astar -> Polkadot -> Acala?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean sending assets from one chain to another with a hop through the reserve chain, like sending DOT from Astar to Acala, or sending ASTR from Moonbeam to Acala, this default impl actually works.😸
The non-default MinXcmFee
is for an edge case that sends assets to its reserve chain which only accepts relay chain assets as fees. In this case two XCM message needs to be sent, one to relay chain and the other to the dest reserve chain. And the MinXcmFee
serves as an indicator of how to break fees for these two messages. The only real-life case I know was a while ago when Statemine only accepts KSM as XCM fees, and Acala try to support sending RMRK to it. You may find more details here, open-web3-stack/open-runtime-module-library#698 . (P.S. now statemine/t support other assets as fees with paritytech/cumulus#1278)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the explanation! 🙏
for AbsoluteAndRelativeReserveProvider<AbsoluteLocation> | ||
{ | ||
fn reserve(asset: &MultiAsset) -> Option<MultiLocation> { | ||
RelativeReserveProvider::reserve(asset).map(|reserve_location| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to check what this does, but it seems it's functionally (almost?) same as: https://github.com/AstarNetwork/astar-frame/blob/polkadot-v0.9.39/primitives/xcm/src/lib.rs#L205
Not for this PR, but let's get rid of our custom implementation, if we can use the ORML one which does the exact same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree! They are pretty similar. The ReserveAssetFilter
in XCM primitives can be refactored to be leveraged on AbsoluteReserveProvider
impl in ORML.
Btw I'm aware that some of the config (like this AbsoluteAndRelativeReserveProvider
) could be moved to xcm-primitives
and shared in different runtimes. I'm thinking of doing it after Shibuya integration finished and tested, so there would be less back and forth with astar-frame
PRs, in case anything didn't work as expected. Hope it makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! 🙂
I also saw your comment about merging Astar
and astar-frame
, so that's something we can discuss soon too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
I just noticed all commits are required to be signed. Let me try to rebuild the commit history and sign them. Probably will need force push. |
Pull Request Summary
Integrate
orml-xtokens
into Shibuya.Note that for XCM unit tests, I kept the original tests that using
pallet-xcm
fork extra calls, to make sure that they still got covered before the fork is removed. These tests are renamed tox_via_pallet_xcm
. The newly added tests are basically the same except for replacing fork extra calls withorml-xtokens
calls.Check list