pub trait Config: Config + CreateInherent<Call<Self>> {
Show 27 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent> + TryInto<Event<Self>>;
type Currency: ReservableCurrency<Self::AccountId> + Currency<Self::AccountId>;
type EstimateCallFee: EstimateCallFee<Call<Self>, BalanceOf<Self>>;
type UnsignedPhase: Get<BlockNumberFor<Self>>;
type SignedPhase: Get<BlockNumberFor<Self>>;
type BetterSignedThreshold: Get<Perbill>;
type OffchainRepeat: Get<BlockNumberFor<Self>>;
type MinerTxPriority: Get<TransactionPriority>;
type MinerConfig: MinerConfig<AccountId = Self::AccountId, MaxVotesPerVoter = <Self::DataProvider as ElectionDataProvider>::MaxVotesPerVoter, MaxWinners = Self::MaxWinners>;
type SignedMaxSubmissions: Get<u32>;
type SignedMaxWeight: Get<Weight>;
type SignedMaxRefunds: Get<u32>;
type SignedRewardBase: Get<BalanceOf<Self>>;
type SignedDepositByte: Get<BalanceOf<Self>>;
type SignedDepositWeight: Get<BalanceOf<Self>>;
type MaxWinners: Get<u32>;
type SignedDepositBase: Convert<usize, BalanceOf<Self>>;
type ElectionBounds: Get<ElectionBounds>;
type SlashHandler: OnUnbalanced<NegativeImbalanceOf<Self>>;
type RewardHandler: OnUnbalanced<PositiveImbalanceOf<Self>>;
type DataProvider: ElectionDataProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>>;
type Fallback: InstantElectionProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>, DataProvider = Self::DataProvider, MaxWinners = Self::MaxWinners>;
type GovernanceFallback: InstantElectionProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>, DataProvider = Self::DataProvider, MaxWinners = Self::MaxWinners>;
type Solver: NposSolver<AccountId = Self::AccountId>;
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type BenchmarkingConfig: BenchmarkingConfig;
type WeightInfo: WeightInfo;
}
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.
Required Associated Types§
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent> + TryInto<Event<Self>>
sourcetype EstimateCallFee: EstimateCallFee<Call<Self>, BalanceOf<Self>>
type EstimateCallFee: EstimateCallFee<Call<Self>, BalanceOf<Self>>
Something that can predict the fee of a call. Used to sensibly distribute rewards.
sourcetype UnsignedPhase: Get<BlockNumberFor<Self>>
type UnsignedPhase: Get<BlockNumberFor<Self>>
Duration of the unsigned phase.
sourcetype SignedPhase: Get<BlockNumberFor<Self>>
type SignedPhase: Get<BlockNumberFor<Self>>
Duration of the signed phase.
sourcetype BetterSignedThreshold: Get<Perbill>
type BetterSignedThreshold: Get<Perbill>
The minimum amount of improvement to the solution score that defines a solution as “better” in the Signed phase.
sourcetype OffchainRepeat: Get<BlockNumberFor<Self>>
type OffchainRepeat: Get<BlockNumberFor<Self>>
The repeat threshold of the offchain worker.
For example, if it is 5, that means that at least 5 blocks will elapse between attempts to submit the worker’s solution.
sourcetype MinerTxPriority: Get<TransactionPriority>
type MinerTxPriority: Get<TransactionPriority>
The priority of the unsigned transaction submitted in the unsigned-phase
sourcetype MinerConfig: MinerConfig<AccountId = Self::AccountId, MaxVotesPerVoter = <Self::DataProvider as ElectionDataProvider>::MaxVotesPerVoter, MaxWinners = Self::MaxWinners>
type MinerConfig: MinerConfig<AccountId = Self::AccountId, MaxVotesPerVoter = <Self::DataProvider as ElectionDataProvider>::MaxVotesPerVoter, MaxWinners = Self::MaxWinners>
Configurations of the embedded miner.
Any external software implementing this can use the unsigned::Miner
type provided,
which can mine new solutions and trim them accordingly.
sourcetype SignedMaxSubmissions: Get<u32>
type SignedMaxSubmissions: Get<u32>
Maximum number of signed submissions that can be queued.
It is best to avoid adjusting this during an election, as it impacts downstream data
structures. In particular, SignedSubmissionIndices<T>
is bounded on this value. If you
update this value during an election, you must ensure that
SignedSubmissionIndices.len()
is less than or equal to the new value. Otherwise,
attempts to submit new solutions may cause a runtime panic.
sourcetype SignedMaxWeight: Get<Weight>
type SignedMaxWeight: Get<Weight>
Maximum weight of a signed solution.
If Config::MinerConfig
is being implemented to submit signed solutions (outside of
this pallet), then MinerConfig::solution_weight
is used to compare against
this value.
sourcetype SignedMaxRefunds: Get<u32>
type SignedMaxRefunds: Get<u32>
The maximum amount of unchecked solutions to refund the call fee for.
sourcetype SignedRewardBase: Get<BalanceOf<Self>>
type SignedRewardBase: Get<BalanceOf<Self>>
Base reward for a signed solution
sourcetype SignedDepositByte: Get<BalanceOf<Self>>
type SignedDepositByte: Get<BalanceOf<Self>>
Per-byte deposit for a signed solution.
sourcetype SignedDepositWeight: Get<BalanceOf<Self>>
type SignedDepositWeight: Get<BalanceOf<Self>>
Per-weight deposit for a signed solution.
sourcetype MaxWinners: Get<u32>
type MaxWinners: Get<u32>
The maximum number of winners that can be elected by this ElectionProvider
implementation.
Note: This must always be greater or equal to T::DataProvider::desired_targets()
.
sourcetype SignedDepositBase: Convert<usize, BalanceOf<Self>>
type SignedDepositBase: Convert<usize, BalanceOf<Self>>
Something that calculates the signed deposit base based on the signed submissions queue size.
sourcetype ElectionBounds: Get<ElectionBounds>
type ElectionBounds: Get<ElectionBounds>
The maximum number of electing voters and electable targets to put in the snapshot. At the moment, snapshots are only over a single block, but once multi-block elections are introduced they will take place over multiple blocks.
sourcetype SlashHandler: OnUnbalanced<NegativeImbalanceOf<Self>>
type SlashHandler: OnUnbalanced<NegativeImbalanceOf<Self>>
Handler for the slashed deposits.
sourcetype RewardHandler: OnUnbalanced<PositiveImbalanceOf<Self>>
type RewardHandler: OnUnbalanced<PositiveImbalanceOf<Self>>
Handler for the rewards.
sourcetype DataProvider: ElectionDataProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>>
type DataProvider: ElectionDataProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>>
Something that will provide the election data.
sourcetype Fallback: InstantElectionProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>, DataProvider = Self::DataProvider, MaxWinners = Self::MaxWinners>
type Fallback: InstantElectionProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>, DataProvider = Self::DataProvider, MaxWinners = Self::MaxWinners>
Configuration for the fallback.
sourcetype GovernanceFallback: InstantElectionProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>, DataProvider = Self::DataProvider, MaxWinners = Self::MaxWinners>
type GovernanceFallback: InstantElectionProvider<AccountId = Self::AccountId, BlockNumber = BlockNumberFor<Self>, DataProvider = Self::DataProvider, MaxWinners = Self::MaxWinners>
Configuration of the governance-only fallback.
As a side-note, it is recommend for test-nets to use type ElectionProvider = BoundedExecution<_>
if the test-net is not expected to have thousands of nominators.
sourcetype Solver: NposSolver<AccountId = Self::AccountId>
type Solver: NposSolver<AccountId = Self::AccountId>
OCW election solution miner algorithm implementation.
sourcetype ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>
Origin that can control this pallet. Note that any action taken by this origin (such) as providing an emergency solution is not checked. Thus, it must be a trusted origin.
sourcetype BenchmarkingConfig: BenchmarkingConfig
type BenchmarkingConfig: BenchmarkingConfig
The configuration of benchmarking.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
The weight of the pallet.