referrerpolicy=no-referrer-when-downgrade

Trait pallet_scheduler::pallet::Config

source ·
pub trait Config: Config {
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin> + From<Self::PalletsOrigin> + IsType<<Self as Config>::RuntimeOrigin>;
    type PalletsOrigin: From<RawOrigin<Self::AccountId>> + CallerTrait<Self::AccountId> + MaxEncodedLen;
    type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = <Self as Config>::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo + From<Call<Self>>;
    type MaximumWeight: Get<Weight>;
    type ScheduleOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>;
    type OriginPrivilegeCmp: PrivilegeCmp<Self::PalletsOrigin>;
    type MaxScheduledPerBlock: Get<u32>;
    type WeightInfo: WeightInfo;
    type Preimages: QueryPreimage<H = Self::Hashing> + StorePreimage;
    type BlockNumberProvider: BlockNumberProvider;
}
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. system::Config should always be included in our implied traits.

Required Associated Types§

source

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

The overarching event type.

source

type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin> + From<Self::PalletsOrigin> + IsType<<Self as Config>::RuntimeOrigin>

The aggregated origin which the dispatch will take.

source

type PalletsOrigin: From<RawOrigin<Self::AccountId>> + CallerTrait<Self::AccountId> + MaxEncodedLen

The caller origin, overarching type of all pallets origins.

source

type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = <Self as Config>::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo + From<Call<Self>>

The aggregated call type.

source

type MaximumWeight: Get<Weight>

The maximum weight that may be scheduled per block for any dispatchables.

source

type ScheduleOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>

Required origin to schedule or cancel calls.

source

type OriginPrivilegeCmp: PrivilegeCmp<Self::PalletsOrigin>

Compare the privileges of origins.

This will be used when canceling a task, to ensure that the origin that tries to cancel has greater or equal privileges as the origin that created the scheduled task.

For simplicity the EqualPrivilegeOnly can be used. This will only check if two given origins are equal.

source

type MaxScheduledPerBlock: Get<u32>

The maximum number of scheduled calls in the queue for a single block.

NOTE:

  • Dependent pallets’ benchmarks might require a higher limit for the setting. Set a higher limit under runtime-benchmarks feature.
source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type Preimages: QueryPreimage<H = Self::Hashing> + StorePreimage

The preimage provider with which we look up call hashes to get the call.

source

type BlockNumberProvider: BlockNumberProvider

Query the current block number.

Must return monotonically increasing values when called from consecutive blocks. It is generally expected that the values also do not differ “too much” between consecutive blocks. A future addition to this pallet will allow bigger difference between consecutive blocks to make it possible to be utilized by parachains with Agile Coretime. Agile Coretime parachains are currently not supported and must continue to use their local block number provider.

Can be configured to return either:

  • the local block number of the runtime via frame_system::Pallet
  • a remote block number, eg from the relay chain through RelaychainDataProvider
  • an arbitrary value through a custom implementation of the trait

Suggested values:

  • Solo- and Relay-chains should use frame_system::Pallet. There are no concerns with this configuration.
  • Parachains should also use frame_system::Pallet for the time being. The scheduler pallet is not yet ready for the case that big numbers of blocks are skipped. In an Agile Coretime chain with relay chain number provider configured, it could otherwise happen that the scheduler will not be able to catch up to its agendas, since too many relay blocks are missing if the parachain only produces blocks rarely.

There is currently no migration provided to “hot-swap” block number providers and it is therefore highly advised to stay with the default (local) values. If you still want to swap block number providers on the fly, then please at least ensure that you do not run any pallet migration in the same runtime upgrade.

Object Safety§

This trait is not object safe.

Implementors§