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§

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

Overarching event type

source

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

source

type FreezeIdentifier: From<FreezeReason> + PartialEq + Eq + Into<<Self as Config>::FreezeIdentifier>

source

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

source

type MinBlocksPerRound: Get<BlockNumberFor<Self>>

Minimum number of blocks validation rounds can last.

source

type DefaultBlocksPerRound: Get<BlockNumberFor<Self>>

Default number of blocks validation rounds last, as set in the genesis configuration.

source

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.

source

type ExitQueueDelay: Get<u32>

Number of rounds a collator has to stay active after submitting a request to leave the set of collator candidates.

source

type MinCollators: Get<u32>

Minimum number of collators selected from the set of candidates at every validation round.

source

type MinRequiredCollators: Get<u32>

Minimum number of collators which cannot leave the network if there are no others.

source

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.

source

type MaxDelegatorsPerCollator: Get<u32> + Debug + PartialEq

Maximum number of delegators a single collator can have.

source

type MaxTopCandidates: Get<u32> + Debug + PartialEq

Maximum size of the top candidates set.

source

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.

source

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.

source

type MinDelegatorStake: Get<<<Self as Config>::Currency as Inspect<<Self as Config>::AccountId>>::Balance>

Minimum stake required for any account to become a delegator.

source

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_candidateorexecute_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.

source

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.

source

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.

source

type NetworkRewardBeneficiary: OnUnbalanced<Credit<<Self as Config>::AccountId, <Self as Config>::Currency>>

The beneficiary to receive the network rewards.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

Required Associated Constants§

source

const BLOCKS_PER_YEAR: BlockNumberFor<Self>

Implementors§