-
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-executor: take transport fee from transferred assets if necessary #4834
xcm-executor: take transport fee from transferred assets if necessary #4834
Conversation
we shouldn't touch xcm-executor without open discussions (i.e. RFC process) |
I agree we can go through RFC process for this (I assumed it is ok even without RFC since it enables new scenarios without breaking any existing ones).
I don't agree, the proposed change is only used in scenarios not possible before (nobody is doing this yet) - when they'll try to do it, there are only two options (in current XCM) or three with XCMv5:
From a practical point of view, option 2 will enable needed scenarios in the Community while still being able to control fee UX from the higher levels (UI). |
The issue of adding new features without RFC is that we can't easily change/remove it in future without a breaking change. So we need to get it right. We have observed such case in past and I want to make sure we don't repeat the same mistake. I get we want to get features out and don't want to wait forever (everything it is taking too long and we need to address it somehow). However, I need to point it out with the option 2, there is a non zero chance people will lose funds in corner cases. e.g. if the fee payment mechanism is powered by a swap action and there could be someone doing market manipulation to take nearly all the transferred amount as fee and steal funds. This is a security risk and much worse than just have people funds stuck in limbo, which can be rescued via governance action. Such risk maybe tolerable (e.g. the hop/dest chain are not using swap for fee payment) but I need to make sure all the concerns are discussed and addressed. |
Description
Sending XCM messages to other chains requires paying a "transport fee". This can be paid either:
origin
local account ifjit_withdraw = true
,This currently works for following hops/scenarios:
DepositReserveAsset
instruction) - this was fixed in xcm-executor: DepositReserveAsset charges delivery fees from inner assets #3142But now we're seeing more complex asset transfers that are mixing reserve transfers with teleports depending on the involved chains.
Example
E.g. transferring DOT between Relay and parachain, but through AH (using AH instead of the Relay chain as parachain's DOT reserve).
In the
Parachain --1--> AssetHub --2--> Relay
scenario, DOT has to be reserve-withdrawn in leg1
, then teleported in leg2
.On the intermediary hop (AssetHub),
InitiateTeleport
fails to send onward message because of missing transport fees. We also can't rely onjit_withdraw
because the original origin is lost on the way, and even if it weren't we can't rely on the user having funded accounts on each hop along the way.Solution/Changes
Testing
Added regression tests in emulated transfers.
Fixes #4832