New slashing mechanism (#554)

* Slashing improvements

- unstake when balance too low
- unstake after N slashes according to val prefs
- don't early-terminate session/era unless unstaked
- offline grace period before punishment

* Fix warning

* Cleanups and ensure slash_count decays

* Bump authoring version and introduce needed authoring stub

* Rename

* Fix offline tracker

* Fix offline tracker

* Renames

* Add test

* Tests

* Tests.
This commit is contained in:
Gav Wood
2018-08-15 18:08:21 +02:00
committed by GitHub
parent 22c9ac76aa
commit 314e2eeaf9
5 changed files with 67 additions and 37 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ use super::{Call, UncheckedExtrinsic, Extrinsic, Staking};
use runtime_primitives::traits::{Checkable, AuxLookup};
use timestamp::Call as TimestampCall;
use parachains::Call as ParachainsCall;
use session::Call as SessionCall;
use staking::Call as StakingCall;
/// Produces the list of inherent extrinsics.
pub fn inherent_extrinsics(data: ::primitives::InherentData) -> Vec<UncheckedExtrinsic> {
@@ -41,7 +41,7 @@ pub fn inherent_extrinsics(data: ::primitives::InherentData) -> Vec<UncheckedExt
if !data.offline_indices.is_empty() {
inherent.push(make_inherent(
Call::Session(SessionCall::note_offline(data.offline_indices))
Call::Staking(StakingCall::note_missed_proposal(data.offline_indices))
));
}