Companion to Split SolutionImprovementThresholds into two types (#5324)

* Splitting `SolutionImprovementThreshold` in 2.
One for Signed phase, and one for Unsgined.

* Adding missing imports

* Removing `GetDefault`, renaming trait

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Georges
2022-04-20 20:54:25 +01:00
committed by GitHub
parent 2284a85aa3
commit e460465515
4 changed files with 195 additions and 206 deletions
+186 -200
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -407,7 +407,7 @@ parameter_types! {
pub const SignedDepositByte: Balance = deposit(0, 10) / 1024;
// Each good submission will get 1/10 KSM as reward
pub SignedRewardBase: Balance = UNITS / 10;
pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
pub BetterUnsignedThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
// 1 hour session, 15 minutes unsigned phase, 8 offchain executions.
pub OffchainRepeat: BlockNumber = UnsignedPhase::get() / 8;
@@ -451,7 +451,8 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type SlashHandler = (); // burn slashes
type RewardHandler = (); // nothing to do upon rewards
type SignedPhase = SignedPhase;
type SolutionImprovementThreshold = SolutionImprovementThreshold;
type BetterUnsignedThreshold = BetterUnsignedThreshold;
type BetterSignedThreshold = ();
type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking.
type MinerMaxLength = OffchainSolutionLengthLimit;
type OffchainRepeat = OffchainRepeat;
+3 -2
View File
@@ -448,7 +448,7 @@ parameter_types! {
pub const SignedDepositByte: Balance = deposit(0, 10) / 1024;
// Each good submission will get 1 DOT as reward
pub SignedRewardBase: Balance = 1 * UNITS;
pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
pub BetterUnsignedThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
// 4 hour session, 1 hour unsigned phase, 32 offchain executions.
pub OffchainRepeat: BlockNumber = UnsignedPhase::get() / 32;
@@ -492,7 +492,8 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type SignedMaxWeight = Self::MinerMaxWeight;
type SlashHandler = (); // burn slashes
type RewardHandler = (); // nothing to do upon rewards
type SolutionImprovementThreshold = SolutionImprovementThreshold;
type BetterUnsignedThreshold = BetterUnsignedThreshold;
type BetterSignedThreshold = ();
type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking.
type MinerMaxLength = OffchainSolutionLengthLimit;
type OffchainRepeat = OffchainRepeat;
+3 -2
View File
@@ -350,7 +350,7 @@ parameter_types! {
pub const SignedDepositByte: Balance = deposit(0, 10) / 1024;
// Each good submission will get 1 WND as reward
pub SignedRewardBase: Balance = 1 * UNITS;
pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
pub BetterUnsignedThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
// 1 hour session, 15 minutes unsigned phase, 4 offchain executions.
pub OffchainRepeat: BlockNumber = UnsignedPhase::get() / 4;
@@ -394,7 +394,8 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type SignedMaxWeight = Self::MinerMaxWeight;
type SlashHandler = (); // burn slashes
type RewardHandler = (); // nothing to do upon rewards
type SolutionImprovementThreshold = SolutionImprovementThreshold;
type BetterUnsignedThreshold = BetterUnsignedThreshold;
type BetterSignedThreshold = ();
type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking.
type MinerMaxLength = OffchainSolutionLengthLimit;
type OffchainRepeat = OffchainRepeat;