Skip to content

Update UI to reflect DMP/HRMP message delivery fees #9298

Description

@KiChjang

After paritytech/polkadot#6843 and paritytech/polkadot#7005 have been merged, we will need to look for a place to inform the user of the delivery fees to collect for the XCM executor to send an outgoing XCM.

This new delivery fee is not included in the weight of the extrinsic and is collected separately. The formula for calculating the delivery fee is:

delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)

The base_fee is a set constant in every chain, and is defined as CENTS * 3. The encoded_msg_len can be determined simply by encoding the XCM and checking the resulting encoded blob size in bytes, and the per_byte_fee is just the TransactionByteFee which is defined as 10 * MILLICENTS on every chain.

The only weird one is delivery_fee_factor, but that is also easily fetched by checking the chain state on the DMP pallet (the XCMP queue pallet if on HRMP) via the DeliveryFeeFactor storage map. This map is keyed on the destination's ParaId, and if no entries exist yet for the given parachain, then the delivery fee factor would just be 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions