Trait pallet_staking::Config
source · pub trait Config: Config {
Show 25 associated items
type Currency: LockableCurrency<Self::AccountId, Moment = Self::BlockNumber, Balance = Self::CurrencyBalance>;
type CurrencyBalance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + TypeInfo + MaxEncodedLen;
type UnixTime: UnixTime;
type CurrencyToVote: CurrencyToVote<BalanceOf<Self>>;
type ElectionProvider: ElectionProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Pallet<Self>>;
type GenesisElectionProvider: ElectionProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Pallet<Self>>;
type MaxNominations: Get<u32>;
type RewardRemainder: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>;
type Event: From<Event<Self>> + IsType<<Self as Config>::Event>;
type Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>;
type Reward: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::PositiveImbalance>;
type SessionsPerEra: Get<SessionIndex>;
type BondingDuration: Get<EraIndex>;
type SlashDeferDuration: Get<EraIndex>;
type SlashCancelOrigin: EnsureOrigin<Self::Origin>;
type SessionInterface: SessionInterface<Self::AccountId>;
type EraPayout: EraPayout<BalanceOf<Self>>;
type NextNewSession: EstimateNextNewSession<Self::BlockNumber>;
type MaxNominatorRewardedPerValidator: Get<u32>;
type OffendingValidatorsThreshold: Get<Perbill>;
type VoterList: SortedListProvider<Self::AccountId, Score = VoteWeight>;
type MaxUnlockingChunks: Get<u32>;
type OnStakerSlash: OnStakerSlash<Self::AccountId, BalanceOf<Self>>;
type BenchmarkingConfig: BenchmarkingConfig;
type WeightInfo: WeightInfo;
}
Expand description
Configuration trait of this pallet.
Implement this type for a runtime in order to customize this pallet.
Required Associated Types§
sourcetype Currency: LockableCurrency<Self::AccountId, Moment = Self::BlockNumber, Balance = Self::CurrencyBalance>
type Currency: LockableCurrency<Self::AccountId, Moment = Self::BlockNumber, Balance = Self::CurrencyBalance>
The staking balance.
sourcetype CurrencyBalance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + TypeInfo + MaxEncodedLen
type CurrencyBalance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + TypeInfo + MaxEncodedLen
Just the Currency::Balance
type; we have this item to allow us to constrain it to
From<u64>
.
sourcetype UnixTime: UnixTime
type UnixTime: UnixTime
Time used for computing era duration.
It is guaranteed to start being called from the first on_finalize
. Thus value at
genesis is not used.
sourcetype CurrencyToVote: CurrencyToVote<BalanceOf<Self>>
type CurrencyToVote: CurrencyToVote<BalanceOf<Self>>
Convert a balance into a number used for election calculation. This must fit into a
u64
but is allowed to be sensibly lossy. The u64
is used to communicate with the
frame_election_provider_support
crate which accepts u64 numbers and does operations
in 128.
Consequently, the backward convert is used convert the u128s from sp-elections back to a
BalanceOf
.
sourcetype ElectionProvider: ElectionProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Pallet<Self>>
type ElectionProvider: ElectionProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Pallet<Self>>
Something that provides the election functionality.
sourcetype GenesisElectionProvider: ElectionProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Pallet<Self>>
type GenesisElectionProvider: ElectionProvider<AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, DataProvider = Pallet<Self>>
Something that provides the election functionality at genesis.
sourcetype MaxNominations: Get<u32>
type MaxNominations: Get<u32>
Maximum number of nominations per nominator.
sourcetype RewardRemainder: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type RewardRemainder: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Tokens have been minted and are unused for validator-reward. See Era payout.
sourcetype Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
type Slash: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::NegativeImbalance>
Handler for the unbalanced reduction when slashing a staker.
sourcetype Reward: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::PositiveImbalance>
type Reward: OnUnbalanced<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::PositiveImbalance>
Handler for the unbalanced increment when rewarding a staker.
NOTE: in most cases, the implementation of OnUnbalanced
should modify the total
issuance.
sourcetype SessionsPerEra: Get<SessionIndex>
type SessionsPerEra: Get<SessionIndex>
Number of sessions per era.
sourcetype BondingDuration: Get<EraIndex>
type BondingDuration: Get<EraIndex>
Number of eras that staked funds must remain bonded for.
sourcetype SlashDeferDuration: Get<EraIndex>
type SlashDeferDuration: Get<EraIndex>
Number of eras that slashes are deferred by, after computation.
This should be less than the bonding duration. Set to 0 if slashes should be applied immediately, without opportunity for intervention.
sourcetype SlashCancelOrigin: EnsureOrigin<Self::Origin>
type SlashCancelOrigin: EnsureOrigin<Self::Origin>
The origin which can cancel a deferred slash. Root can always do this.
sourcetype SessionInterface: SessionInterface<Self::AccountId>
type SessionInterface: SessionInterface<Self::AccountId>
Interface for interacting with a session pallet.
sourcetype EraPayout: EraPayout<BalanceOf<Self>>
type EraPayout: EraPayout<BalanceOf<Self>>
The payout for validators and the system for the current era. See Era payout.
sourcetype NextNewSession: EstimateNextNewSession<Self::BlockNumber>
type NextNewSession: EstimateNextNewSession<Self::BlockNumber>
Something that can estimate the next session change, accurately or as a best effort guess.
sourcetype MaxNominatorRewardedPerValidator: Get<u32>
type MaxNominatorRewardedPerValidator: Get<u32>
The maximum number of nominators rewarded for each validator.
For each validator only the $MaxNominatorRewardedPerValidator
biggest stakers can
claim their reward. This used to limit the i/o cost for the nominator payout.
sourcetype OffendingValidatorsThreshold: Get<Perbill>
type OffendingValidatorsThreshold: Get<Perbill>
The fraction of the validator set that is safe to be offending. After the threshold is reached a new era will be forced.
sourcetype VoterList: SortedListProvider<Self::AccountId, Score = VoteWeight>
type VoterList: SortedListProvider<Self::AccountId, Score = VoteWeight>
Something that provides a best-effort sorted list of voters aka electing nominators, used for NPoS election.
The changes to nominators are reported to this. Moreover, each validator’s self-vote is also reported as one independent vote.
sourcetype MaxUnlockingChunks: Get<u32>
type MaxUnlockingChunks: Get<u32>
The maximum number of unlocking
chunks a StakingLedger
can have. Effectively
determines how many unique eras a staker may be unbonding in.
sourcetype OnStakerSlash: OnStakerSlash<Self::AccountId, BalanceOf<Self>>
type OnStakerSlash: OnStakerSlash<Self::AccountId, BalanceOf<Self>>
A hook called when any staker is slashed. Mostly likely this can be a no-op unless other pallets exist that are affected by slashing per-staker.
sourcetype BenchmarkingConfig: BenchmarkingConfig
type BenchmarkingConfig: BenchmarkingConfig
Some parameters of the benchmarking.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.