referrerpolicy=no-referrer-when-downgrade

Module xcm_simulator::dmp

Expand description

To prevent Out of Memory errors on the DownwardMessageQueue, an exponential fee factor (DeliveryFeeFactor) is set. The fee factor increments exponentially after the number of messages in the DownwardMessageQueue passes a threshold. This threshold is set as:

// Maximum max sized messages that can be send to
// the DownwardMessageQueue before it runs out of memory
max_messages = MAX_POSSIBLE_ALLOCATION / max_downward_message_size
threshold = max_messages / THRESHOLD_FACTOR

Based on the THRESHOLD_FACTOR, the threshold is set as a fraction of the total messages. The DeliveryFeeFactor increases for a message over the threshold by:

DeliveryFeeFactor = DeliveryFeeFactor * (EXPONENTIAL_FEE_BASE + MESSAGE_SIZE_FEE_BASE * encoded_message_size_in_KB)

And decreases when the number of messages in the DownwardMessageQueue fall below the threshold by:

DeliveryFeeFactor = DeliveryFeeFactor / EXPONENTIAL_FEE_BASE

As an extra defensive measure, a max_messages hard limit is set to the number of messages in the DownwardMessageQueue. Messages that would increase the number of messages in the queue above this hard limit are dropped.

Modules§

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.

Structs§

  • Initialization value for the DeliveryFee factor.
  • The Pallet struct, the main type that implements traits and standalone functions within the pallet.

Enums§

Traits§

  • Configuration trait of this pallet.

Functions§

Type Aliases§

  • The downward messages addressed for a certain para.
  • ModuleDeprecated
    Type alias to Pallet, to be used by construct_runtime.