Staking Extend
Methods
current_staking_era
fn current_staking_era() -> u32
Get the Era of the current Staking pallet.
near_era_change
fn near_era_change(period_multiple: BlockNumber) -> bool
Used to determine whether era changes are about to occur.
period_multiple: session-multi indicates the trigger pre-check session period before the era.
calculate_near_era_change
fn calculate_near_era_change(
period_multiple: BlockNumber,
current_bn: BlockNumber,
session_length: BlockNumber,
per_era: BlockNumber
) -> bool
old_npos
fn old_npos() -> Vec<Self::StashId>
Get the list of validators before the election.
pending_npos
fn pending_npos() -> Vec<(Self::StashId, Option<AuthorityId>)>
Get the list of new validators after the current election, excluding validators from the previous session.
Workflow
Adapter execution
ElectionProvider
ofStaking Config
is set tostaking_extend::elect::OnChainSequentialPhragmen
,GenesisElectionProvider
is set tostaking_extend::elect::OnChainSequentialPhragmenGenesis
DataProvider
offrame_election_provider_support::onchain::Config
is set tostaking_extend::data::DataProvider
DataProvider
ofpallet_election_provider_multi_phase::Config
is set tostaking_extend::data::DataProvider<Self>
- After that, the staking election request will be sent to
staking_extend
, and then the Election module will also obtain the candidate list fromstaking_extend
, and the adapter connection is successful. - Call the
pending_npos
method to obtain a list of the new elected list, and then cooperate with the implementation of theIAresOraclePreCheck::get_pre_check_status
trait to block the newly selected validator.