referrerpolicy=no-referrer-when-downgrade

Trait xcm_emulator::MessageQueueConfig

pub trait MessageQueueConfig: Config {
    type RuntimeEvent: From<Event<Self>> + IsType<Self::RuntimeEvent>;
    type WeightInfo: WeightInfo;
    type MessageProcessor: ProcessMessage;
    type Size: BaseArithmetic + Unsigned + Copy + Into<u32> + Member + Encode + Decode + MaxEncodedLen + TypeInfo + Default;
    type QueueChangeHandler: OnQueueChanged<<Self::MessageProcessor as ProcessMessage>::Origin>;
    type QueuePausedQuery: QueuePausedQuery<<Self::MessageProcessor as ProcessMessage>::Origin>;
    type HeapSize: Get<Self::Size>;
    type MaxStale: Get<u32>;
    type ServiceWeight: Get<Option<Weight>>;
    type IdleMaxServiceWeight: Get<Option<Weight>>;
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait. The module configuration trait.

Required Associated Types§

type RuntimeEvent: From<Event<Self>> + IsType<Self::RuntimeEvent>

The overarching event type.

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

type MessageProcessor: ProcessMessage

Processor for a message.

Storage changes are not rolled back on error.

§Benchmarking

Must be set to [mock_helpers::NoopMessageProcessor] for benchmarking. Other message processors that consumes exactly (1, 1) weight for any give message will work as well. Otherwise the benchmarking will also measure the weight of the message processor, which is not desired.

type Size: BaseArithmetic + Unsigned + Copy + Into<u32> + Member + Encode + Decode + MaxEncodedLen + TypeInfo + Default

Page/heap size type.

type QueueChangeHandler: OnQueueChanged<<Self::MessageProcessor as ProcessMessage>::Origin>

Code to be called when a message queue changes - either with items introduced or removed.

type QueuePausedQuery: QueuePausedQuery<<Self::MessageProcessor as ProcessMessage>::Origin>

Queried by the pallet to check whether a queue can be serviced.

This also applies to manual servicing via execute_overweight and service_queues. The value of this is only polled once before servicing the queue. This means that changes to it that happen within the servicing will not be reflected.

type HeapSize: Get<Self::Size>

The size of the page; this implies the maximum message size which can be sent.

A good value depends on the expected message sizes, their weights, the weight that is available for processing them and the maximal needed message size. The maximal message size is slightly lower than this as defined by [MaxMessageLenOf].

type MaxStale: Get<u32>

The maximum number of stale pages (i.e. of overweight messages) allowed before culling can happen. Once there are more stale pages than this, then historical pages may be dropped, even if they contain unprocessed overweight messages.

type ServiceWeight: Get<Option<Weight>>

The amount of weight (if any) which should be provided to the message queue for servicing enqueued items on_initialize.

This may be legitimately None in the case that you will call ServiceQueues::service_queues manually or set Self::IdleMaxServiceWeight to have it run in on_idle.

type IdleMaxServiceWeight: Get<Option<Weight>>

The maximum amount of weight (if any) to be used from remaining weight on_idle which should be provided to the message queue for servicing enqueued items on_idle. Useful for parachains to process messages at the same block they are received.

If None, it will not call ServiceQueues::service_queues in on_idle.

Object Safety§

This trait is not object safe.

Implementors§