Companion for Decouple Staking and Election - Part 3: Signed Phase (#2793)

* Companion for Decouple Staking and Election - Part 3: Signed Phase

https://github.com/paritytech/substrate/pull/7910

* remove some config types

* allow up to 5 signed submissions on polkadot and kusama

* signed phase is equal induration to unsigned phase

* use chain defaults for base and per-byte deposits; >= 16 SignedMaxSubmissions

* use a small but non-trivial solution reward

* reduce signed deposit per byte fee

* reduce signed reward, adjust polkadot expected soln size

* copy submit benchmark from substrate

* demo calculating an appropriate fee for the signed reward

Unfortunately, this doesn't work: it needs to be a constant function,
and AFAIK there's no way to make a trait method constant.

* SignedRewardBase is 1.5x the fee to submit a signed solution

* all chains use deposit byte of base per 50k

* update Substrate

* cargo update -p pallet-election-provider-multi-phase

Co-authored-by: parity-processbot <>
This commit is contained in:
Peter Goodspeed-Niklaus
2021-06-28 14:36:20 +02:00
committed by GitHub
parent e8d7e9f0dc
commit 95736d1bf1
10 changed files with 349 additions and 187 deletions
@@ -92,4 +92,21 @@ impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo f
.saturating_add((3_731_000 as Weight).saturating_mul(d as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
}
fn finalize_signed_phase_accept_solution() -> Weight {
(47_783_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn finalize_signed_phase_reject_solution() -> Weight {
(21_277_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn submit(c: u32) -> Weight {
(78_972_000 as Weight)
// Standard Error: 16_000
.saturating_add((308_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
}