referrerpolicy=no-referrer-when-downgrade
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§

Source

type AccountId: Ord + Clone + Codec + Debug

The account id type.

Source

type Solution: FullCodec + Default + PartialEq + Eq + Clone + Debug + Ord + NposSolution + TypeInfo + MaxEncodedLen

The solution that the miner is mining. The solution type.

Source

type Solver: NposSolver<AccountId = Self::AccountId>

The solver type.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

type Pages: Get<u32>

Maximum number of pages that we may compute.

Must be the same as configured in the crate::Config.

Source

type VoterSnapshotPerBlock: Get<u32>

Maximum number of voters per snapshot page.

Must be the same as configured in the crate::Config.

Source

type TargetSnapshotPerBlock: Get<u32>

Maximum number of targets per snapshot page.

Must be the same as configured in the crate::Config.

Source

type Hash: Eq + PartialEq

The hash type of the runtime.

Implementors§