pub trait Config: Config {
    type EpochDuration: Get<u64>;
    type ExpectedBlockTime: Get<Self::Moment>;
    type EpochChangeTrigger: EpochChangeTrigger;
    type DisabledValidators: DisabledValidators;
    type WeightInfo: WeightInfo;
    type MaxAuthorities: Get<u32>;
    type MaxNominators: Get<u32>;
    type KeyOwnerProof: Parameter + GetSessionNumber + GetValidatorCount;
    type EquivocationReportSystem: OffenceReportSystem<Option<Self::AccountId>, (EquivocationProof<HeaderFor<Self>>, Self::KeyOwnerProof)>;
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.

Required Associated Types§


type EpochDuration: Get<u64>

The amount of time, in slots, that each epoch should last. NOTE: Currently it is not possible to change the epoch duration after the chain has started. Attempting to do so will brick block production.


type ExpectedBlockTime: Get<Self::Moment>

The expected average block time at which BABE should be creating blocks. Since BABE is probabilistic it is not trivial to figure out what the expected average block time should be based on the slot duration and the security parameter c (where 1 - c represents the probability of a slot being empty).


type EpochChangeTrigger: EpochChangeTrigger

BABE requires some logic to be triggered on every block to query for whether an epoch has ended and to perform the transition to the next epoch.

Typically, the ExternalTrigger type should be used. An internal trigger should only be used when no other module is responsible for changing authority set.


type DisabledValidators: DisabledValidators

A way to check whether a given validator is disabled and should not be authoring blocks. Blocks authored by a disabled validator will lead to a panic as part of this module’s initialization.


type WeightInfo: WeightInfo

Helper for weights computations


type MaxAuthorities: Get<u32>

Max number of authorities allowed


type MaxNominators: Get<u32>

The maximum number of nominators for each validator.


type KeyOwnerProof: Parameter + GetSessionNumber + GetValidatorCount

The proof of key ownership, used for validating equivocation reports. The proof must include the session index and validator count of the session at which the equivocation occurred.


type EquivocationReportSystem: OffenceReportSystem<Option<Self::AccountId>, (EquivocationProof<HeaderFor<Self>>, Self::KeyOwnerProof)>

The equivocation handling subsystem, defines methods to check/report an offence and for submitting a transaction to report an equivocation (from an offchain context).