Crate pallet_session[][src]

Session Module

The Session module allows validators to manage their session keys, provides a function for changing the session length, and handles session rotation.

Overview

Terminology

Goals

The Session pallet is designed to make the following possible:

Interface

Dispatchable Functions

Public Functions

Usage

Example from the FRAME

The Staking pallet uses the Session pallet to get the validator set.

use pallet_session as session;

fn validators<T: pallet_session::Config>() -> Vec<<T as pallet_session::Config>::ValidatorId> {
<pallet_session::Module<T>>::validators()
}

Re-exports

pub use weights::WeightInfo;
pub use $crate::traits::GetPalletVersion as _;

Modules

weights

Weights for pallet_session THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 DATE: 2020-10-27, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some(“dev”), DB CACHE: 128

Structs

FindAccountFromAuthorIndex

Wraps the author-scraping logic for consensus engines that can recover the canonical index of an author. This then transforms it into the registering account-ID of that session key index.

GenesisConfig

Genesis config for the module, allow to build genesis storage.

Module
PeriodicSessions

Ends the session after a fixed period of blocks.

TestSessionHandler

SessionHandler for tests that use UintAuthorityId as Keys.

Enums

Call

Dispatchable calls.

Error

Error for the session module.

Event

Events for this module.

Traits

Config
SessionHandler

Handler for session life cycle events.

SessionManager

A trait for managing creation of new validator set.

ShouldEndSession

Decides whether the session should be ended.