referrerpolicy=no-referrer-when-downgrade

LastValidatorEra

Type Alias LastValidatorEra 

Source
pub type LastValidatorEra<T: Config> = StorageMap<_GeneratedPrefixForStorageLastValidatorEra<T>, Twox64Concat, T::AccountId, EraIndex>;
Expand description

Tracks the last era in which an account was active as a validator (included in the era’s exposure/snapshot).

This is used to enforce that accounts who were recently validators must wait the full Config::BondingDuration before their funds can be withdrawn, even if they switch to nominator role. This prevents validators from:

  1. Committing a slashable offence in era N
  2. Switching to nominator role
  3. Using the shorter nominator unbonding duration to withdraw funds before being slashed

Updated when era snapshots are created (in ErasStakersPaged/ErasStakersOverview). Cleaned up when the stash is killed (fully withdrawn/reaped).

Storage type is [StorageMap] with key type T :: AccountId and value type EraIndex.

Aliased Type§

pub struct LastValidatorEra<T: Config>(/* private fields */);