This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
[PoC] pallet_xcm::reserve_transfer_assets
with DestinationFees
handling
#7456
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.
Relates to: paritytech/cumulus#2762
Motivation:
Right now, user chooses
fee_asset_item
to cover fees on destination usingBuyExecution(fees)
.But the problem is that selected
fees
may not be valid on the destination.e.g. transfer KSM over bridge from AssetHubKusama to AssetHubPolkadot -> problems like KSM is not sufficient (ForeignAsset) on AssetHubPolkadot or there are no wrappedKSM yet on AssetHubPolkadot (very first transfer).
non-bridge e.g.: any foreign asset transfer between two paras on Polkadot without requiring user to also transfer
DOT
to pay for execution on destination.Proposal:
This PR introduces a PoC mechanism for
reserve_transfer_assets
to handle fees / BuyExecution on destination chain.Runtime which provides
pallet_xcm
can configure for particulardestination
and user's selectedfee_asset_item/fees
how the fees will be handled:fee_asset_item
andfees(KSM)
are put toBuyExecution(KSM)
and it is paid fromReserveAssetDeposited(KSM)
on destinationfee_asset_item
andfees(KSM)
, but runtime can have configuration that for particulardestination
andfees_asset_id
and can decide that:fees_asset_id
on source chain (means to withdraw KSM from user account and deposit to some UniversalLocation's account - treasury, staking_pot, ...)WithdrawAsset(DOT) / BuyExecution(DOT)
which is executed on destination chain, means that DOTs are withdrawn from UniversalLocation's sovereign account on destinationMore description:
https://hackmd.io/-Ec-WUk0QuGPnrIGuXdH7g?view
TL;DR: PR introduces mechanism that allows
Runtime as UniversalLocation
to help origin to pay on destination from UniversalLocation's sovereign account (in DOTs), but for that it charges origin with some proportional amount in source chain (in KSMs)TODOs:
AliasOrigin
(if it is ok, to use effective_origin)reserve_transfer_assets / limited_reserve_transfer_assets
do_teleport_assets
Alternatives:
Pay fees on destination from SA of source UniversalLocation
ok?AliasOrigin
ok?T::FeeTransactor::append()
injectWithdrawAsset, BuyExecution
in-between (or before)ReserveAssetDeposited/ReserveAssetTeleported
andClearOrigin
.is_sufficient
for wrapped assets would fix issue and we dont needpallet_xcm
customization