Crate pallet_parachain_staking
source ·Expand description
§Parachain Staking
Minimal staking pallet that implements collator selection by total backed stake.
The main difference between this pallet and frame/pallet-staking
is that this pallet
uses direct delegation. Delegators choose exactly who they delegate and with what stake.
This is different from frame/pallet-staking
where delegators approval vote and run Phragmen.
§Rules
There is a new round every <Round<T>>::get().length
blocks.
At the start of every round,
- issuance is calculated for collators (and their delegators) for block authoring
T::RewardPaymentDelay
rounds ago - a new set of collators is chosen from the candidates
Immediately following a round change, payments are made once-per-block until all payments have
been made. In each such block, one collator is chosen for a rewards payment and is paid along
with each of its top T::MaxTopDelegationsPerCandidate
delegators.
To join the set of candidates, call join_candidates
with bond >= MinCandidateStk
.
To leave the set of candidates, call schedule_leave_candidates
. If the call succeeds,
the collator is removed from the pool of candidates so they cannot be selected for future
collator sets, but they are not unbonded until their exit request is executed. Any signed
account may trigger the exit T::LeaveCandidatesDelay
rounds after the round in which the
original request was made.
To join the set of delegators, call delegate
and pass in an account that is
already a collator candidate and bond >= MinDelegation
. Each delegator can delegate up to
T::MaxDelegationsPerDelegator
collator candidates by calling delegate
.
To revoke a delegation, call revoke_delegation
with the collator candidate’s account.
To leave the set of delegators and revoke all delegations, call leave_delegators
.
Re-exports§
pub use inflation::InflationInfo;
pub use inflation::Range;
pub use weights::WeightInfo;
pub use RoundIndex;
pub use pallet::*;
pub use traits::*;
pub use types::*;
Modules§
- Helper methods for computing issuance based on inflation
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - traits for parachain-staking
- Types for parachain-staking
- Autogenerated weights for pallet_parachain_staking
Structs§
- Represents the auto-compounding amount for a delegation.
- Represents the auto-compounding [Delegations] for
T: Config
- Represents a cancelled scheduled request for emitting an event.
- Represents a scheduled request that define a DelegationAction. The request is executable iff the provided RoundIndex is achieved.
Enums§
- An action that can be performed upon a delegation