Force new era only if 1/3 validators is disabled. (#3533)

* Force new era only when over third validators is disabled.

* Update srml/session/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update srml/staking/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Parametrize the threshold.

* Bump runtime version.

* Update node/runtime/src/lib.rs

* Fix build.

* Fix im-online test.
This commit is contained in:
Tomasz Drwięga
2019-09-19 12:04:48 +02:00
committed by Gavin Wood
parent bfe240d1b0
commit 668acca9ed
7 changed files with 95 additions and 12 deletions
+4
View File
@@ -211,6 +211,9 @@ impl_opaque_keys! {
// `SessionKeys`.
// TODO: Introduce some structure to tie these together to make it a bit less of a footgun. This
// should be easy, since OneSessionHandler trait provides the `Key` as an associated type. #2858
parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
}
impl session::Trait for Runtime {
type OnSessionEnding = Staking;
@@ -221,6 +224,7 @@ impl session::Trait for Runtime {
type ValidatorId = AccountId;
type ValidatorIdOf = staking::StashOf<Self>;
type SelectInitialValidators = Staking;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
}
impl session::historical::Trait for Runtime {