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§
- Contains a variant per dispatchable extrinsic that this pallet has.
- An error sending a downward message.
Traits§
- Configuration trait of this pallet.
Functions§
- Initialization value for the DeliveryFee factor.
Type Aliases§
- The downward messages addressed for a certain para.
- ModuleDeprecatedType alias to
Pallet
, to be used byconstruct_runtime
.