//! - WhitelistedValidators: Fixed validators set by root/governance. Have priority over the external validators.
//! - ExternalValidators: Validators set using storage proofs from another blockchain. Can be disabled by setting
//! Validators only change once per era. By default the era changes after a fixed number of sessions, but new eras
//! The structure of this pallet and the concept of eras is inspired by `pallet_staking` from Polkadot.
/// Same as `WhitelistedValidatorsActiveEra` but only exists for a brief period of time when the
/// Validators set using storage proofs from another blockchain. Ignored if `SkipExternalValidators` is true.
/// The current era information, it is either ActiveEra or ActiveEra + 1 if the new era validators have been queued.
/// Returns validators for the next session. Whitelisted validators first, then external validators.
let era_length = session_index.saturating_sub(current_era_start_session_index); // Must never happen.
/// Keeps only the first instance of each element in the input vec. Respects ordering of elements.
/// Force a new era on the next session start, then reset to `NotForcing` as soon as it is done.