Crate pallet_collator_selection
source ·Expand description
Collator Selection pallet.
A pallet to manage collators in a parachain with council-approved candidacy.
§Overview
The Collator Selection pallet manages the collators of a parachain. Collation is not a secure activity and this pallet does not implement any game-theoretic mechanisms to meet BFT safety assumptions of the chosen set.
§Permissioned Candidacy System
As of this version, collator candidacy requires governance approval:
- Accounts must first apply via
apply_for_candidacy
(reserves bond) - Governance reviews and either approves via
approve_application
(directly adds to candidates) or rejects viaclose_application
(unreserves bond) - Governance can force-remove candidates with slashing via
kick_candidate
- Users can withdraw pending applications via
close_application
(only before processing)
The old register_as_candidate
extrinsic is deprecated and will fail with a Permission error.
§Terminology
- Collator: A parachain block producer.
- Bond: An amount of
Balance
reserved for candidate registration. - Invulnerable: An account guaranteed to be in the collator set.
- Pending Application: An application that has been submitted but not yet processed.
§Governance Origins
The pallet uses two configurable origins for governance actions:
GovernanceOrigin
: Can approve/close candidacy applicationsForceRemovalOrigin
: Can forcibly remove active candidates
§Implementation
The final Collators
are aggregated from two individual lists:
Invulnerables
: a set of collators appointed by governance. These accounts will always be collators.Candidates
: these are governance-approved candidates to the collation task and may or may not be elected as a final collator.
The current implementation resolves congestion of Candidates
in a first-come-first-serve
manner.
Candidates will not be allowed to get kicked or leave_intent if the total number of candidates fall below MinCandidates. This is for potential disaster recovery scenarios.
§Rewards
The Collator Selection pallet maintains an on-chain account (the “Pot”). In each block, the collator who authored it receives:
- Half the value of the Pot.
- Half the value of the transaction fees within the block. The other half of the transaction fees are deposited into the Pot.
To initiate rewards an ED needs to be transferred to the pot address.
Note: Eventually the Pot distribution may be modified as discussed in this issue.
Re-exports§
pub use pallet::*;
Modules§
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet. - Autogenerated weights for
pallet_collator_selection