-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Introduce XcmFeesToAccount fee manager #7005
base: master
Are you sure you want to change the base?
Conversation
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.
Top notch. There's a lot to like.
I think your right not to include the bridge hub in free xcm fees as bridge hub really should only be talking to statemine/t.
The CI pipeline was cancelled due to failure one of the required jobs. |
@KiChjang what is the status of this PR? can we merge it? |
@KiChjang @joepetrowski |
It is ready whenever the cumulus companion is fixed. |
bot rebase |
Rebased |
Seems like this PR breaks |
I made a cumulus companion to compile,
so that fix #7585 is really needed |
with fix those tests fails on Balance asserts which needs to be corrected, because of these new xcm fees are charged from user account:
|
bot rebase |
Rebased |
bot rebase |
Rebased |
bot rebase |
Rebased |
This PR introduces a new
XcmFeesToAccount
struct which implements theFeeManager
trait, and assigns this struct as theFeeManager
in the XCM config for all runtimes.The struct simply deposits all fees handled by the XCM executor to a specified account. In all runtimes, the specified account is configured as the treasury account.
XCM delivery fees are now being introduced (unless the root origin is sending a message to a system parachain on behalf of the originating chain).
Important note
After this change, instructions that create and send a new XCM (
Query*
,Report*
,ExportMessage
,InitiateReserveWithdraw
,InitiateTeleport
,DepositReserveAsset
,TransferReserveAsset
,LockAsset
andRequestUnlock
) will require the corresponding origin account in the origin register to pay for transport delivery fees, and the onward message will fail to be sent if the origin account does not have the required amount. This delivery fee is on top of what we already collect as tx fees and XCM BuyExecution fees!Wallet UIs that want to expose the new delivery fee can do so using the formula
delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)
, where the delivery fee factor can be obtained from the corresponding pallet based on which transport you are using (UMP, HRMP or bridges), the base fee is a constant, the encoded message length from the message itself and the per byte fee is the same as the configured per byte fee for txs.cumulus companion: paritytech/cumulus#2433