Trait parachain_staking::pallet::Config
source · pub trait Config: Config + Config + Config {
Show 22 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type Currency: Balanced<Self::AccountId> + MutateFreeze<Self::AccountId, Balance = Self::CurrencyBalance, Id = <Self as Config>::FreezeIdentifier> + Eq;
type FreezeIdentifier: From<FreezeReason> + PartialEq + Eq + Into<<Self as Config>::FreezeIdentifier>;
type CurrencyBalance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + From<u128> + Into<<Self as Config>::Balance> + From<<Self as Config>::Balance> + From<BlockNumberFor<Self>> + TypeInfo + MaxEncodedLen + Send + Sync;
type MinBlocksPerRound: Get<BlockNumberFor<Self>>;
type DefaultBlocksPerRound: Get<BlockNumberFor<Self>>;
type StakeDuration: Get<BlockNumberFor<Self>>;
type ExitQueueDelay: Get<u32>;
type MinCollators: Get<u32>;
type MinRequiredCollators: Get<u32>;
type MaxDelegationsPerRound: Get<u32>;
type MaxDelegatorsPerCollator: Get<u32> + Debug + PartialEq;
type MaxTopCandidates: Get<u32> + Debug + PartialEq;
type MinCollatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type MinCollatorCandidateStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type MinDelegatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>;
type MaxUnstakeRequests: Get<u32>;
type NetworkRewardStart: Get<BlockNumberFor<Self>>;
type NetworkRewardRate: Get<Perquintill>;
type NetworkRewardBeneficiary: OnUnbalanced<Credit<<Self as Config>::AccountId, <Self as Config>::Currency>>;
type WeightInfo: WeightInfo;
const BLOCKS_PER_YEAR: BlockNumberFor<Self>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait. Configuration trait of this pallet.
Required Associated Types§
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
Overarching event type
sourcetype Currency: Balanced<Self::AccountId> + MutateFreeze<Self::AccountId, Balance = Self::CurrencyBalance, Id = <Self as Config>::FreezeIdentifier> + Eq
type Currency: Balanced<Self::AccountId> + MutateFreeze<Self::AccountId, Balance = Self::CurrencyBalance, Id = <Self as Config>::FreezeIdentifier> + Eq
The currency type Note: Declaration of Balance taken from pallet_gilt
type FreezeIdentifier: From<FreezeReason> + PartialEq + Eq + Into<<Self as Config>::FreezeIdentifier>
sourcetype CurrencyBalance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + From<u128> + Into<<Self as Config>::Balance> + From<<Self as Config>::Balance> + From<BlockNumberFor<Self>> + TypeInfo + MaxEncodedLen + Send + Sync
type CurrencyBalance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + From<u64> + From<u128> + Into<<Self as Config>::Balance> + From<<Self as Config>::Balance> + From<BlockNumberFor<Self>> + TypeInfo + MaxEncodedLen + Send + Sync
Just the Currency::Balance
type; we have this item to allow us to
constrain it to From<u64>
.
Note: Definition taken from pallet_gilt
sourcetype MinBlocksPerRound: Get<BlockNumberFor<Self>>
type MinBlocksPerRound: Get<BlockNumberFor<Self>>
Minimum number of blocks validation rounds can last.
sourcetype DefaultBlocksPerRound: Get<BlockNumberFor<Self>>
type DefaultBlocksPerRound: Get<BlockNumberFor<Self>>
Default number of blocks validation rounds last, as set in the genesis configuration.
sourcetype StakeDuration: Get<BlockNumberFor<Self>>
type StakeDuration: Get<BlockNumberFor<Self>>
Number of blocks for which unstaked balance will still be locked
before it can be unlocked by actively calling the extrinsic
unlock_unstaked
.
sourcetype ExitQueueDelay: Get<u32>
type ExitQueueDelay: Get<u32>
Number of rounds a collator has to stay active after submitting a request to leave the set of collator candidates.
sourcetype MinCollators: Get<u32>
type MinCollators: Get<u32>
Minimum number of collators selected from the set of candidates at every validation round.
sourcetype MinRequiredCollators: Get<u32>
type MinRequiredCollators: Get<u32>
Minimum number of collators which cannot leave the network if there are no others.
sourcetype MaxDelegationsPerRound: Get<u32>
type MaxDelegationsPerRound: Get<u32>
Maximum number of delegations which can be made within the same round.
NOTE: To prevent re-delegation-reward attacks, we should keep this to be one.
sourcetype MaxDelegatorsPerCollator: Get<u32> + Debug + PartialEq
type MaxDelegatorsPerCollator: Get<u32> + Debug + PartialEq
Maximum number of delegators a single collator can have.
sourcetype MaxTopCandidates: Get<u32> + Debug + PartialEq
type MaxTopCandidates: Get<u32> + Debug + PartialEq
Maximum size of the top candidates set.
sourcetype MinCollatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
type MinCollatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
Minimum stake required for any account to be elected as validator for a round.
sourcetype MinCollatorCandidateStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
type MinCollatorCandidateStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
Minimum stake required for any account to be added to the set of candidates.
sourcetype MinDelegatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
type MinDelegatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>
Minimum stake required for any account to become a delegator.
sourcetype MaxUnstakeRequests: Get<u32>
type MaxUnstakeRequests: Get<u32>
Max number of concurrent active unstaking requests before unlocking.
NOTE: To protect against irremovability of a candidate or delegator,
we only allow for MaxUnstakeRequests - 1 many manual unstake
requests. The last one serves as a placeholder for the cases of
calling either kick_delegator
, force_remove_candidateor
execute_leave_candidates`. Otherwise, a user could max out their
unstake requests and prevent themselves from being kicked from the
set of candidates/delegators until they unlock their funds.
sourcetype NetworkRewardStart: Get<BlockNumberFor<Self>>
type NetworkRewardStart: Get<BlockNumberFor<Self>>
The starting block number for the network rewards. Once the current block number exceeds this start, the beneficiary will receive the configured reward in each block.
sourcetype NetworkRewardRate: Get<Perquintill>
type NetworkRewardRate: Get<Perquintill>
The rate in percent for the network rewards which are based on the maximum number of collators and the maximum amount a collator can stake.
sourcetype NetworkRewardBeneficiary: OnUnbalanced<Credit<<Self as Config>::AccountId, <Self as Config>::Currency>>
type NetworkRewardBeneficiary: OnUnbalanced<Credit<<Self as Config>::AccountId, <Self as Config>::Currency>>
The beneficiary to receive the network rewards.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.