Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix election lookahead
  • Loading branch information
kianenigma committed Feb 23, 2021
commit 160f992015d561b6704688cba2071cd8f9928885
5 changes: 2 additions & 3 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,8 @@ parameter_types! {
// no signed phase for now, just unsigned.
pub const SignedPhase: u32 = 0;
// NOTE: length of unsigned phase is, for now, different than `ElectionLookahead` to make sure
// that we won't run OCW threads at the same time with staking. Once staking's election is out,
// replace with `/ 4`.
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 8;
// that we won't run OCW threads at the same time with staking.
pub const UnsignedPhase: u32 = ElectionLookahead::get() / 2;

// fallback: no need to do on-chain phragmen while we re on a dry-run.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
Expand Down
5 changes: 2 additions & 3 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,8 @@ parameter_types! {
// no signed phase for now, just unsigned.
pub const SignedPhase: u32 = 0;
// NOTE: length of unsigned phase is, for now, different than `ElectionLookahead` to make sure
// that we won't run OCW threads at the same time with staking. Once staking's election is out,
// replace with `/ 4`.
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 8;
// that we won't run OCW threads at the same time with staking.
pub const UnsignedPhase: u32 = ElectionLookahead::get() / 2;

// fallback: no need to do on-chain phragmen while we re on a dry-run.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
Expand Down
4 changes: 3 additions & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ impl pallet_session::historical::Config for Runtime {
parameter_types! {
// no signed phase for now, just unsigned.
pub const SignedPhase: u32 = 0;
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4;
// NOTE: length of unsigned phase is, for now, different than `ElectionLookahead` to make sure
// that we won't run OCW threads at the same time with staking.
pub const UnsignedPhase: u32 = ElectionLookahead::get() / 2;

// fallback: no need to do on-chain phragmen while we re on a dry-run.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
Expand Down