-
Notifications
You must be signed in to change notification settings - Fork 660
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
[xcm-v5] implement RFC#100: add new InitiateTransfer instruction #5876
Draft
acatangiu
wants to merge
8
commits into
paritytech:xcm-pay-fees
Choose a base branch
from
acatangiu:impl-rfc-100
base: xcm-pay-fees
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.
Conversation
This file contains 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
The CI pipeline was cancelled due to failure one of the required jobs. |
acatangiu
force-pushed
the
impl-rfc-100
branch
from
October 2, 2024 09:16
b837000
to
9c52940
Compare
acatangiu
force-pushed
the
impl-rfc-100
branch
from
October 2, 2024 09:33
9c52940
to
adb4ac2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A new instruction
InitiateTransfer
is introduced that initiates an assets transfer from the chain it is executed on, to another chain. The executed transfer is point-to-point (chain-to-chain) with all of the transfer properties specified in the instruction parameters. The instruction also allows specifying another XCM program to be executed on the remote chain.If a transfer requires going through multiple hops, an XCM program can compose this instruction to be used at every chain along the path, on each hop describing that specific leg of the transfer.
Note: Transferring assets that require different paths (chains along the way) is not supported within same XCM because of the async nature of cross chain messages. This new instruction, however, enables initiating transfers for multiple assets that take the same path even if they require different transfer types along that path.
The usage and composition model of
InitiateTransfer
is the same as with existingDepositReserveAsset
,InitiateReserveWithdraw
andInitiateTeleport
instructions. The main difference comes from the ability to handle assets that have different point-to-point transfer type between A and B. The other benefit is that it also allows specifying remote fee payment and transparently appends the required remote fees logic to the remote XCM.We can specify the desired transfer type for some asset(s) using:
This PR adds 1 new XCM instruction:
An
InitiateTransfer { .. }
instruction shall transfer todest
, all assets in theholding
register that match the providedassets
andremote_fees
filters.These filters identify the assets to be transferred as well as the transfer type to be used for transferring them.
It shall handle the local side of the transfer, then forward an onward XCM to
dest
for handling the remote side of the transfer.It should do so using same mechanisms as existing
DepositReserveAsset
,InitiateReserveWithdraw
,InitiateTeleport
instructions but practically combining all required XCM instructions to be remotely executed into a single remote XCM program to be sent over todest
.Furthermore, through
remote_fees: Option<AssetTransferFilter>
, it shall allow specifying a single asset to be used for fees ondest
chain. This single asset shall be remotely handled/received by the first instruction in the onward XCM and shall be followed by aBuyExecution
instruction using it.If
remote_fees
is set toNone
, the first instruction in the onward XCM shall be aUnpaidExecution
instruction. The rest of the assets shall be handled by subsequent instructions, thus also finally allowing single asset buy execution barrier security recommendation.The
BuyExecution
appended to the onward XCM specifiesWeightLimit::Unlimited
, thus being limited only by theremote_fees
asset "amount". This is a deliberate decision for enhancing UX - in practice, people/dApps care about limiting the amount of fee asset used and not the actually used weight.The onward XCM, following the assets transfers instructions,
ClearOrigin
orDescendOrigin
instructions shall be appended to stop acting on behalf of the source chain, then the caller-providedremote_xcm
shall also be appended, allowing the caller to control what to do with the transferred assets.Closes #5209