Type Alias parachain_staking::pallet::Module
source · pub type Module<T> = Pallet<T>;
Pallet
insteadExpand description
Type alias to Pallet
, to be used by construct_runtime
.
Generated by pallet
attribute macro.
Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn get_unclaimed_staking_rewards(
acc: &T::AccountId
) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
pub fn get_unclaimed_staking_rewards( acc: &T::AccountId ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
Calculates the staking rewards for a given account address.
Subtracts the number of rewarded blocks from the number of authored blocks by the collator and multiplies that with the current stake as well as reward rate.
At least used in Runtime API.
sourcepub fn get_staking_rates() -> StakingRates
pub fn get_staking_rates() -> StakingRates
Calculates the current staking and reward rates for collators and delegators.
At least used in Runtime API.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn force_new_round(origin: OriginFor<T>) -> DispatchResult
pub fn force_new_round(origin: OriginFor<T>) -> DispatchResult
Forces the start of the new round in the next block.
The new round will be enforced via <T as ShouldEndSession<_>>::should_end_session.
The dispatch origin must be Root.
sourcepub fn set_inflation(
origin: OriginFor<T>,
collator_max_rate_percentage: Perquintill,
collator_annual_reward_rate_percentage: Perquintill,
delegator_max_rate_percentage: Perquintill,
delegator_annual_reward_rate_percentage: Perquintill
) -> DispatchResultWithPostInfo
pub fn set_inflation( origin: OriginFor<T>, collator_max_rate_percentage: Perquintill, collator_annual_reward_rate_percentage: Perquintill, delegator_max_rate_percentage: Perquintill, delegator_annual_reward_rate_percentage: Perquintill ) -> DispatchResultWithPostInfo
Set the annual inflation rate to derive per-round inflation.
The inflation details are considered valid if the annual reward rate is approximately the per-block reward rate multiplied by the estimated* total number of blocks per year.
The estimated average block time is twelve seconds.
NOTE: Iterates over CandidatePool and for each candidate over their
delegators to update their rewards before the reward rates change.
Needs to be improved when scaling up MaxTopCandidates
.
The dispatch origin must be Root.
Emits RoundInflationSet
.
sourcepub fn set_max_selected_candidates(
origin: OriginFor<T>,
new: u32
) -> DispatchResultWithPostInfo
pub fn set_max_selected_candidates( origin: OriginFor<T>, new: u32 ) -> DispatchResultWithPostInfo
Set the maximum number of collator candidates that can be selected at the beginning of each validation round.
Changes are not applied until the start of the next round.
The new value must be higher than the minimum allowed as set in the pallet’s configuration.
The dispatch origin must be Root.
Emits MaxSelectedCandidatesSet
.
sourcepub fn set_blocks_per_round(
origin: OriginFor<T>,
new: BlockNumberFor<T>
) -> DispatchResult
pub fn set_blocks_per_round( origin: OriginFor<T>, new: BlockNumberFor<T> ) -> DispatchResult
Set the number of blocks each validation round lasts.
If the new value is less than the length of the current round, the system will immediately move to the next round in the next block.
The new value must be higher than the minimum allowed as set in the pallet’s configuration.
The dispatch origin must be Root.
Emits BlocksPerRoundSet
.
sourcepub fn set_max_candidate_stake(
origin: OriginFor<T>,
new: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResult
pub fn set_max_candidate_stake( origin: OriginFor<T>, new: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResult
Set the maximal amount a collator can stake. Existing stakes are not changed.
The dispatch origin must be Root.
Emits MaxCandidateStakeChanged
.
sourcepub fn force_remove_candidate(
origin: OriginFor<T>,
collator: <T::Lookup as StaticLookup>::Source
) -> DispatchResultWithPostInfo
pub fn force_remove_candidate( origin: OriginFor<T>, collator: <T::Lookup as StaticLookup>::Source ) -> DispatchResultWithPostInfo
Forcedly removes a collator candidate from the TopCandidates and clears all associated storage for the candidate and their delegators.
Prepares unstaking of the candidates and their delegators stake
which can be unfreezed via unlock_unstaked
after waiting at
least StakeDuration
many blocks. Also increments rewards for the
collator and their delegators.
Increments rewards of candidate and their delegators.
Emits CandidateRemoved
.
sourcepub fn join_candidates(
origin: OriginFor<T>,
stake: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
pub fn join_candidates( origin: OriginFor<T>, stake: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo
Join the set of collator candidates.
In the next blocks, if the collator candidate has enough funds
staked to be included in any of the top MaxSelectedCandidates
positions, it will be included in the set of potential authors that
will be selected by the stake-weighted random selection function.
The staked funds of the new collator candidate are added to the total stake of the system.
The total amount of funds staked must be within the allowed range as set in the pallet’s configuration.
The dispatch origin must not be already part of the collator candidates nor of the delegators set.
Emits JoinedCollatorCandidates
.
sourcepub fn init_leave_candidates(origin: OriginFor<T>) -> DispatchResultWithPostInfo
pub fn init_leave_candidates(origin: OriginFor<T>) -> DispatchResultWithPostInfo
Request to leave the set of collator candidates.
On success, the account is immediately removed from the candidate
pool to prevent selection as a collator in future validation rounds,
but unstaking of the funds is executed with a delay of
StakeDuration
blocks.
The exit request can be reversed by calling
cancel_leave_candidates
.
This operation affects the pallet’s total stake amount. It is
updated even though the funds of the candidate who signaled to leave
are still locked for ExitDelay
+ StakeDuration
more blocks.
NOTE 1: Upon starting a new session_i in new_session
, the current
top candidates are selected to be block authors for session_i+1. Any
changes to the top candidates afterwards do not effect the set of
authors for session_i+1.
Thus, we have to make sure none of these collators can
leave before session_i+1 ends by delaying their
exit for ExitDelay
many blocks.
NOTE 2: We do not increment rewards in this extrinsic as the candidate could still author blocks, and thus be eligible to receive rewards, until the end of the next session.
Emits CollatorScheduledExit
.
sourcepub fn execute_leave_candidates(
origin: OriginFor<T>,
collator: <T::Lookup as StaticLookup>::Source
) -> DispatchResultWithPostInfo
pub fn execute_leave_candidates( origin: OriginFor<T>, collator: <T::Lookup as StaticLookup>::Source ) -> DispatchResultWithPostInfo
Execute the network exit of a candidate who requested to leave at
least ExitQueueDelay
rounds ago. Prepares unstaking of the
candidates and their delegators stake which can be unfreezed via
unlock_unstaked
after waiting at least StakeDuration
many
blocks.
Requires the candidate to previously have called
init_leave_candidates
.
The exit request can be reversed by calling
cancel_leave_candidates
.
NOTE: Iterates over CandidatePool for each candidate over their
delegators to set rewards. Needs to be improved when scaling up
MaxTopCandidates
.
Emits CollatorLeft
.
sourcepub fn cancel_leave_candidates(
origin: OriginFor<T>
) -> DispatchResultWithPostInfo
pub fn cancel_leave_candidates( origin: OriginFor<T> ) -> DispatchResultWithPostInfo
Revert the previously requested exit of the network of a collator candidate. On success, adds back the candidate to the TopCandidates and updates the collators.
Requires the candidate to previously have called
init_leave_candidates
.
Emits CollatorCanceledExit
.
sourcepub fn candidate_stake_more(
origin: OriginFor<T>,
more: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
pub fn candidate_stake_more( origin: OriginFor<T>, more: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo
Stake more funds for a collator candidate.
If not in the set of candidates, staking enough funds allows the account to be added to it. The larger amount of funds, the higher chances to be selected as the author of the next block.
This operation affects the pallet’s total stake amount.
The resulting total amount of funds staked must be within the allowed range as set in the pallet’s configuration.
Emits CollatorStakedMore
.
sourcepub fn candidate_stake_less(
origin: OriginFor<T>,
less: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
pub fn candidate_stake_less( origin: OriginFor<T>, less: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo
Stake less funds for a collator candidate.
If the new amount of staked fund is not large enough, the account could be removed from the set of collator candidates and not be considered for authoring the next blocks.
This operation affects the pallet’s total stake amount.
The unstaked funds are not released immediately to the account, but
they will be available after StakeDuration
blocks.
The resulting total amount of funds staked must be within the allowed range as set in the pallet’s configuration.
Emits CollatorStakedLess
.
sourcepub fn join_delegators(
origin: OriginFor<T>,
collator: <T::Lookup as StaticLookup>::Source,
amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
pub fn join_delegators( origin: OriginFor<T>, collator: <T::Lookup as StaticLookup>::Source, amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo
Join the set of delegators by delegating to a collator candidate.
The account that wants to delegate cannot be part of the collator candidates set as well.
The caller must not have a delegation. If that is the case, they are required to first remove the delegation.
The amount staked must be larger than the minimum required to become a delegator as set in the pallet’s configuration.
As only MaxDelegatorsPerCollator
are allowed to delegate a given
collator, the amount staked must be larger than the lowest one in
the current set of delegator for the operation to be meaningful.
The collator’s total stake as well as the pallet’s total stake are increased accordingly.
Emits Delegation
.
Emits DelegationReplaced
if the candidate has
MaxDelegatorsPerCollator
many delegations but this delegator
staked more than one of the other delegators of this candidate.
sourcepub fn leave_delegators(origin: OriginFor<T>) -> DispatchResultWithPostInfo
pub fn leave_delegators(origin: OriginFor<T>) -> DispatchResultWithPostInfo
Leave the set of delegators and, by implication, revoke the ongoing delegation.
All staked funds are not unlocked immediately, but they are added to
the queue of pending unstaking, and will effectively be released
after StakeDuration
blocks from the moment the delegator leaves.
This operation reduces the total stake of the pallet as well as the stakes of all collators that were delegated, potentially affecting their chances to be included in the set of candidates in the next rounds.
Automatically increments the accumulated rewards of the origin of the current delegation.
Emits DelegatorLeft
.
sourcepub fn delegator_stake_more(
origin: OriginFor<T>,
more: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
pub fn delegator_stake_more( origin: OriginFor<T>, more: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo
Increase the stake for delegating a collator candidate.
If not in the set of candidates, staking enough funds allows the collator candidate to be added to it.
Emits DelegatorStakedMore
.
sourcepub fn delegator_stake_less(
origin: OriginFor<T>,
less: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
pub fn delegator_stake_less( origin: OriginFor<T>, less: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance ) -> DispatchResultWithPostInfo
Reduce the stake for delegating a collator candidate.
If the new amount of staked fund is not large enough, the collator could be removed from the set of collator candidates and not be considered for authoring the next blocks.
The unstaked funds are not release immediately to the account, but
they will be available after StakeDuration
blocks.
The remaining staked funds must still be larger than the minimum required by this pallet to maintain the status of delegator.
The resulting total amount of funds staked must be within the allowed range as set in the pallet’s configuration.
Emits DelegatorStakedLess
.
sourcepub fn unlock_unstaked(
origin: OriginFor<T>,
target: <T::Lookup as StaticLookup>::Source
) -> DispatchResultWithPostInfo
pub fn unlock_unstaked( origin: OriginFor<T>, target: <T::Lookup as StaticLookup>::Source ) -> DispatchResultWithPostInfo
Unlock all previously staked funds that are now available for
unlocking by the origin account after StakeDuration
blocks have
elapsed.
sourcepub fn claim_rewards(origin: OriginFor<T>) -> DispatchResult
pub fn claim_rewards(origin: OriginFor<T>) -> DispatchResult
Claim block authoring rewards for the target address.
Requires Rewards
to be set beforehand, which can by triggered by
any of the following options
- Calling increment_{collator, delegator}_rewards (active)
- Altering your stake (active)
- Leaving the network as a collator (active)
- Revoking a delegation as a delegator (active)
- Being a delegator whose collator left the network, altered their stake or incremented rewards (passive)
The dispatch origin can be any signed one, e.g., anyone can claim for anyone.
Emits Rewarded
.
sourcepub fn increment_collator_rewards(origin: OriginFor<T>) -> DispatchResult
pub fn increment_collator_rewards(origin: OriginFor<T>) -> DispatchResult
Actively increment the rewards of a collator.
The same effect is triggered by changing the stake or leaving the network.
The dispatch origin must be a collator.
sourcepub fn increment_delegator_rewards(origin: OriginFor<T>) -> DispatchResult
pub fn increment_delegator_rewards(origin: OriginFor<T>) -> DispatchResult
Actively increment the rewards of a delegator.
The same effect is triggered by changing the stake or revoking delegations.
The dispatch origin must be a delegator.
sourcepub fn execute_scheduled_reward_change(
origin: OriginFor<T>
) -> DispatchResultWithPostInfo
pub fn execute_scheduled_reward_change( origin: OriginFor<T> ) -> DispatchResultWithPostInfo
Executes the annual reduction of the reward rates for collators and delegators.
Moreover, sets rewards for all collators and delegators before adjusting the inflation.
The dispatch origin can be any signed one because we bail if called too early.
Emits RoundInflationSet
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn is_delegator(acc: &T::AccountId) -> bool
pub fn is_delegator(acc: &T::AccountId) -> bool
Check whether an account is currently delegating.
sourcepub fn is_active_candidate(acc: &T::AccountId) -> Option<bool>
pub fn is_active_candidate(acc: &T::AccountId) -> Option<bool>
Check whether an account is currently a collator candidate and whether their state is CollatorStatus::Active.
Returns Some(is_active) if the account is a candidate, else None.
sourcepub fn selected_candidates() -> BoundedVec<T::AccountId, T::MaxTopCandidates>
pub fn selected_candidates() -> BoundedVec<T::AccountId, T::MaxTopCandidates>
Return the best MaxSelectedCandidates
many candidates.
In case a collator from last round was replaced by a candidate with the same total stake during sorting, we revert this swap to prioritize collators over candidates.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn max_selected_candidates() -> u32
pub fn max_selected_candidates() -> u32
An auto-generated getter for MaxSelectedCandidates
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn last_delegation<KArg>(k: KArg) -> DelegationCounterwhere
KArg: EncodeLike<T::AccountId>,
pub fn last_delegation<KArg>(k: KArg) -> DelegationCounterwhere KArg: EncodeLike<T::AccountId>,
An auto-generated getter for LastDelegation
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn delegator_state<KArg>(
k: KArg
) -> Option<Stake<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>where
KArg: EncodeLike<T::AccountId>,
pub fn delegator_state<KArg>( k: KArg ) -> Option<Stake<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>where KArg: EncodeLike<T::AccountId>,
An auto-generated getter for DelegatorState
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn candidate_pool<KArg>(
k: KArg
) -> Option<Candidate<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, T::MaxDelegatorsPerCollator>>where
KArg: EncodeLike<T::AccountId>,
pub fn candidate_pool<KArg>( k: KArg ) -> Option<Candidate<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, T::MaxDelegatorsPerCollator>>where KArg: EncodeLike<T::AccountId>,
An auto-generated getter for CandidatePool
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn total_collator_stake(
) -> TotalStake<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>
pub fn total_collator_stake( ) -> TotalStake<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>
An auto-generated getter for TotalCollatorStake
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn top_candidates(
) -> OrderedSet<Stake<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, T::MaxTopCandidates>
pub fn top_candidates( ) -> OrderedSet<Stake<T::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, T::MaxTopCandidates>
An auto-generated getter for TopCandidates
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn inflation_config() -> InflationInfo
pub fn inflation_config() -> InflationInfo
An auto-generated getter for InflationConfig
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn unstaking<KArg>(
k: KArg
) -> BoundedBTreeMap<BlockNumberFor<T>, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, T::MaxUnstakeRequests>where
KArg: EncodeLike<T::AccountId>,
pub fn unstaking<KArg>( k: KArg ) -> BoundedBTreeMap<BlockNumberFor<T>, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, T::MaxUnstakeRequests>where KArg: EncodeLike<T::AccountId>,
An auto-generated getter for Unstaking
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn max_candidate_stake(
) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
pub fn max_candidate_stake( ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance
An auto-generated getter for MaxCollatorCandidateStake
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn last_reward_reduction() -> BlockNumberFor<T>
pub fn last_reward_reduction() -> BlockNumberFor<T>
An auto-generated getter for LastRewardReduction
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn blocks_rewarded<KArg>(k: KArg) -> BlockNumberFor<T>where
KArg: EncodeLike<T::AccountId>,
pub fn blocks_rewarded<KArg>(k: KArg) -> BlockNumberFor<T>where KArg: EncodeLike<T::AccountId>,
An auto-generated getter for BlocksRewarded
.
Trait Implementations§
source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
source§impl<T> Benchmarking for Pallet<T>where
T: Config + Config,
u64: Into<BlockNumberFor<T>>,
<T as Config>::Currency: Mutate<T::AccountId>,
impl<T> Benchmarking for Pallet<T>where T: Config + Config, u64: Into<BlockNumberFor<T>>, <T as Config>::Currency: Mutate<T::AccountId>,
source§impl<T: Config> EstimateNextSessionRotation<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> EstimateNextSessionRotation<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn average_session_length() -> BlockNumberFor<T>
fn average_session_length() -> BlockNumberFor<T>
source§fn estimate_current_session_progress(
now: BlockNumberFor<T>
) -> (Option<Permill>, Weight)
fn estimate_current_session_progress( now: BlockNumberFor<T> ) -> (Option<Permill>, Weight)
source§fn estimate_next_session_rotation(
_now: BlockNumberFor<T>
) -> (Option<BlockNumberFor<T>>, Weight)
fn estimate_next_session_rotation( _now: BlockNumberFor<T> ) -> (Option<BlockNumberFor<T>>, Weight)
source§impl<T> EventHandler<<T as Config>::AccountId, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config + Config + Config,
impl<T> EventHandler<<T as Config>::AccountId, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where T: Config + Config + Config,
Increments the reward counter of the block author by the current number of collators in the session.
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = StorageVersion
type CurrentStorageVersion = StorageVersion
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(now: BlockNumberFor<T>) -> Weight
fn on_initialize(now: BlockNumberFor<T>) -> Weight
source§fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>
fn try_state(_n: BlockNumberFor<T>) -> Result<(), TryRuntimeError>
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
§fn pre_upgrade() -> Result<Vec<u8, Global>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8, Global>, DispatchError>
§fn post_upgrade(_state: Vec<u8, Global>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8, Global>) -> Result<(), DispatchError>
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moresource§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> SessionManager<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> SessionManager<<T as Config>::AccountId> for Pallet<T>
source§fn new_session(new_index: SessionIndex) -> Option<Vec<T::AccountId>>
fn new_session(new_index: SessionIndex) -> Option<Vec<T::AccountId>>
- A new session starts.
- In hook new_session: Read the current top n candidates from the TopCandidates and assign this set to author blocks for the next session.
- AuRa queries the authorities from the session pallet for this session and picks authors on round-robin-basis from list of authorities.
source§fn end_session(_end_index: SessionIndex)
fn end_session(_end_index: SessionIndex)
source§fn start_session(_start_index: SessionIndex)
fn start_session(_start_index: SessionIndex)
source§impl<T: Config> ShouldEndSession<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> ShouldEndSession<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn should_end_session(now: BlockNumberFor<T>) -> bool
fn should_end_session(now: BlockNumberFor<T>) -> bool
true
if the session should be ended.source§impl<T: Config> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.