mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
[pallet-xcm] fix transport fees for remote reserve transfers (#3792)
Currently `transfer_assets` from pallet-xcm covers 4 main different transfer types: - `localReserve` - `DestinationReserve` - `Teleport` - `RemoteReserve` For the first three, the local execution and the remote message sending are separated, and fees are deducted in pallet-xcm itself: https://github.com/paritytech/polkadot-sdk/blob/3410dfb3929462da88be2da813f121d8b1cf46b3/polkadot/xcm/pallet-xcm/src/lib.rs#L1758. For the 4th case `RemoteReserve`, pallet-xcm is still relying on the xcm-executor itself to send the message (through the `initiateReserveWithdraw` instruction). In this case, if delivery fees need to be charged, it is not possible to do so because the `jit_withdraw` mode has not being set. This PR proposes to still use the `initiateReserveWithdraw` but prepending a `setFeesMode { jit_withdraw: true }` to make sure delivery fees can be paid. A test-case is also added to present the aforementioned case --------- Co-authored-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
|
||||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
|
||||
|
||||
title: "[pallet-xcm] fix transport fees for remote reserve transfers"
|
||||
|
||||
doc:
|
||||
- audience: Runtime Dev
|
||||
description: |
|
||||
This PR fixes `pallet_xcm::transfer_assets` and
|
||||
`pallet_xcm::limited_reserve_transfer_assets` extrinsics for transfers
|
||||
that need to go through remote reserves. The fix is adding a
|
||||
`SetFeesMode { jit_withdraw: true }` instruction before local execution of
|
||||
`InitiateReserveWithdraw` so that delivery fees are correctly charged by
|
||||
the xcm-executor. Without this change, a runtime that has implemented
|
||||
delivery fees would not be able to execute remote reserve transfers using
|
||||
these extrinsics.
|
||||
|
||||
crates:
|
||||
- name: pallet-xcm
|
||||
Reference in New Issue
Block a user