pub trait MinerConfig {
type AccountId: Ord + Clone + Codec + Debug;
type Solution: FullCodec + Default + PartialEq + Eq + Clone + Debug + Ord + NposSolution + TypeInfo + MaxEncodedLen;
type Solver: NposSolver<AccountId = Self::AccountId>;
type MaxLength: Get<u32>;
type MaxVotesPerVoter: Get<u32>;
type MaxWinnersPerPage: Get<u32>;
type MaxBackersPerWinner: Get<u32>;
type MaxBackersPerWinnerFinal: Get<u32>;
type Pages: Get<u32>;
type VoterSnapshotPerBlock: Get<u32>;
type TargetSnapshotPerBlock: Get<u32>;
type Hash: Eq + PartialEq;
}
Expand description
Configurations for the miner.
This is extracted from the main crate’s config so that an offchain miner can readily use the
BaseMiner
without needing to deal with the rest of the pallet’s configuration.
Required Associated Types§
Sourcetype Solution: FullCodec + Default + PartialEq + Eq + Clone + Debug + Ord + NposSolution + TypeInfo + MaxEncodedLen
type Solution: FullCodec + Default + PartialEq + Eq + Clone + Debug + Ord + NposSolution + TypeInfo + MaxEncodedLen
The solution that the miner is mining. The solution type.
Sourcetype MaxLength: Get<u32>
type MaxLength: Get<u32>
The maximum length that the miner should use for a solution, per page.
This value is not set in stone, and it is up to an individual miner to configure. A good value is something like 75% of the total block length, which can be fetched from the system pallet.
Sourcetype MaxVotesPerVoter: Get<u32>
type MaxVotesPerVoter: Get<u32>
Maximum number of votes per voter.
Must be the same as configured in the crate::Config::DataProvider
.
For simplicity, this is 16 in Polkadot and 24 in Kusama.
Sourcetype MaxWinnersPerPage: Get<u32>
type MaxWinnersPerPage: Get<u32>
Maximum number of winners to select per page.
The miner should respect this, it is used for trimming, and bounded data types.
Should equal to the onchain value set in Verifier::Config
.
Sourcetype MaxBackersPerWinner: Get<u32>
type MaxBackersPerWinner: Get<u32>
Maximum number of backers per winner, per page.
The miner should respect this, it is used for trimming, and bounded data types.
Should equal to the onchain value set in Verifier::Config
.
Sourcetype MaxBackersPerWinnerFinal: Get<u32>
type MaxBackersPerWinnerFinal: Get<u32>
Maximum number of backers, per winner, across all pages.
The miner should respect this, it is used for trimming, and bounded data types.
Should equal to the onchain value set in Verifier::Config
.
Sourcetype Pages: Get<u32>
type Pages: Get<u32>
Maximum number of pages that we may compute.
Must be the same as configured in the crate::Config
.
Sourcetype VoterSnapshotPerBlock: Get<u32>
type VoterSnapshotPerBlock: Get<u32>
Maximum number of voters per snapshot page.
Must be the same as configured in the crate::Config
.
Sourcetype TargetSnapshotPerBlock: Get<u32>
type TargetSnapshotPerBlock: Get<u32>
Maximum number of targets per snapshot page.
Must be the same as configured in the crate::Config
.