#messages #threshold #channel #queue #pallet #factor #fee

no-std cumulus-pallet-xcmp-queue

Pallet to queue outbound and inbound XCMP messages

16 breaking releases

0.17.0 Sep 26, 2024
0.16.0 Jul 18, 2024
0.15.0 Jul 13, 2024
0.10.0 Mar 18, 2024
0.0.0 Nov 21, 2022

#6 in #fee

Download history 1006/week @ 2024-08-26 581/week @ 2024-09-02 1021/week @ 2024-09-09 777/week @ 2024-09-16 1193/week @ 2024-09-23 1258/week @ 2024-09-30 1207/week @ 2024-10-07 1688/week @ 2024-10-14 1897/week @ 2024-10-21 1590/week @ 2024-10-28 1724/week @ 2024-11-04 21149/week @ 2024-11-11 26017/week @ 2024-11-18 28803/week @ 2024-11-25 23391/week @ 2024-12-02 28865/week @ 2024-12-09

108,369 downloads per month
Used in 37 crates (25 directly)

Apache-2.0 and GPL-3.0-only

125KB
2.5K SLoC

Release

Polkadot SDK stable2409


lib.rs:

A pallet which uses the XCMP transport layer to handle both incoming and outgoing XCM message sending and dispatch, queuing, signalling and backpressure. To do so, it implements:

  • XcmpMessageHandler
  • XcmpMessageSource

Also provides an implementation of SendXcm which can be placed in a router tuple for relaying XCM over XCMP if the destination is Parent/Parachain. It requires an implementation of XcmExecutor for dispatching incoming XCM messages.

To prevent out of memory errors on the OutboundXcmpMessages queue, an exponential fee factor (DeliveryFeeFactor) is set, much like the one used in DMP. The fee factor increases whenever the total size of messages in a particular channel passes a threshold. This threshold is defined as a percentage of the maximum total size the channel can have. More concretely, the threshold is max_total_size / THRESHOLD_FACTOR, where:

  • max_total_size is the maximum size, in bytes, of the channel, not number of messages. It is defined in the channel configuration.
  • THRESHOLD_FACTOR just declares which percentage of the max size is the actual threshold. If it's 2, then the threshold is half of the max size, if it's 4, it's a quarter, and so on.

Dependencies

~28–42MB
~735K SLoC