Session Info
For disputes and approvals, we need access to information about validator sets from prior sessions. We also often want easy access to the same information about the current session's validator set. This module aggregates and stores this information in a rolling window while providing easy APIs for access.
Storage
Helper structs:
Storage Layout:
Session Change
- Update
EarliestStoredSession
based onconfig.dispute_period
and remove all entries fromSessions
from the previous value up to the new value. - Create a new entry in
Sessions
with information about the current session. Useshared::ActiveValidators
to determine the indices into the broader validator sets (validation, assignment, discovery) which are actually used for parachain validation. Only these validators should appear in theSessionInfo
.
Routines
EarliestStoredSession::<T>::get() -> SessionIndex
: Yields the earliest session for which we have information stored.Sessions::<T>::get(session: SessionIndex) -> Option<SessionInfo>
: Yields the session info for the given session, if stored.