Trait pallet_subspace::pallet::Config

source ·
pub trait Config: Config {
Show 19 associated items type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>; type BlockAuthoringDelay: Get<Slot>; type PotEntropyInjectionInterval: Get<BlockNumberFor<Self>>; type PotEntropyInjectionLookbackDepth: Get<u8>; type PotEntropyInjectionDelay: Get<Slot>; type EraDuration: Get<BlockNumberFor<Self>>; type InitialSolutionRange: Get<SolutionRange>; type SlotProbability: Get<(u64, u64)>; type ConfirmationDepthK: Get<BlockNumberFor<Self>>; type RecentSegments: Get<HistorySize>; type RecentHistoryFraction: Get<(HistorySize, HistorySize)>; type MinSectorLifetime: Get<HistorySize>; type ExpectedVotesPerBlock: Get<u32>; type MaxPiecesInSector: Get<u16>; type ShouldAdjustSolutionRange: Get<bool>; type EraChangeTrigger: EraChangeTrigger; type HandleEquivocation: HandleEquivocation<Self>; type WeightInfo: WeightInfo; type BlockSlotCount: Get<u32>;
}
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§

source

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

The overarching event type.

source

type BlockAuthoringDelay: Get<Slot>

Number of slots between slot arrival and when corresponding block can be produced.

Practically this means future proof of time proof needs to be revealed this many slots ahead before block can be authored even though solution is available before that.

source

type PotEntropyInjectionInterval: Get<BlockNumberFor<Self>>

Interval, in blocks, between blockchain entropy injection into proof of time chain.

source

type PotEntropyInjectionLookbackDepth: Get<u8>

Interval, in entropy injection intervals, where to take entropy for injection from.

source

type PotEntropyInjectionDelay: Get<Slot>

Delay after block, in slots, when entropy injection takes effect.

source

type EraDuration: Get<BlockNumberFor<Self>>

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

source

type InitialSolutionRange: Get<SolutionRange>

Initial solution range used for challenges during the very first era.

source

type SlotProbability: Get<(u64, u64)>

How often in slots slots (on average, not counting collisions) will have a block.

Expressed as a rational where the first member of the tuple is the numerator and the second is the denominator. The rational should represent a value between 0 and 1.

source

type ConfirmationDepthK: Get<BlockNumberFor<Self>>

Depth K after which a block enters the recorded history (a global constant, as opposed to the client-dependent transaction confirmation depth k).

source

type RecentSegments: Get<HistorySize>

Number of latest archived segments that are considered “recent history”.

source

type RecentHistoryFraction: Get<(HistorySize, HistorySize)>

Fraction of pieces from the “recent history” (recent_segments) in each sector.

source

type MinSectorLifetime: Get<HistorySize>

Minimum lifetime of a plotted sector, measured in archived segment.

source

type ExpectedVotesPerBlock: Get<u32>

Number of votes expected per block.

This impacts solution range for votes in consensus.

source

type MaxPiecesInSector: Get<u16>

How many pieces one sector is supposed to contain (max)

source

type ShouldAdjustSolutionRange: Get<bool>

source

type EraChangeTrigger: EraChangeTrigger

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

Era is normally used to update solution range used for challenges.

source

type HandleEquivocation: HandleEquivocation<Self>

The equivocation handling subsystem, defines methods to report an offence (after the equivocation has been validated) and for submitting a transaction to report an equivocation (from an offchain context).

NOTE: when enabling equivocation handling (i.e. this type isn’t set to ()) you must use this pallet’s ValidateUnsigned in the runtime definition.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type BlockSlotCount: Get<u32>

Maximum number of block number to block slot mappings to keep (oldest pruned first).

Object Safety§

This trait is not object safe.

Implementors§