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::Trait>() -> Vec<<T as pallet_session::Trait>::ValidatorId> {
<pallet_session::Module<T>>::validators()
}

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

OneSessionHandler

A session handler for specific key type.

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.

Trait
WeightInfo