pub trait Config: Config {
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::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>>;
}
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§

source

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

The overarching event type.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type MessageProcessor: ProcessMessage

Processor for a message.

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.

source

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

Page/heap size type.

source

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

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

source

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.

source

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.

source

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.

source

type ServiceWeight: Get<Option<Weight>>

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

This may be legitimately None in the case that you will call ServiceQueues::service_queues manually.

Implementors§