mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +00:00
staking: only disable slashed validators and keep them disabled for whole era (#9448)
* session: remove disabled validators threshold logic * staking: add logic to track offending validators * staking: disable validators for the whole era * frame: fix tests * staking: add tests for disabling validators handling * staking: fix adding offending validator when already slashed in era * address review comments * session, staking: add comments about sorted vecs Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
@@ -919,7 +919,7 @@ impl<T: Config> OneSessionHandler<T::AccountId> for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
fn on_disabled(_i: usize) {
|
||||
fn on_disabled(_i: u32) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
testing::{Header, TestXt, UintAuthorityId},
|
||||
traits::{BlakeTwo256, ConvertInto, IdentityLookup},
|
||||
Perbill, Permill,
|
||||
Permill,
|
||||
};
|
||||
use sp_staking::{
|
||||
offence::{OffenceError, ReportOffence},
|
||||
@@ -146,10 +146,6 @@ parameter_types! {
|
||||
pub const Offset: u64 = 0;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
|
||||
}
|
||||
|
||||
impl pallet_session::Config for Runtime {
|
||||
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type SessionManager =
|
||||
@@ -159,7 +155,6 @@ impl pallet_session::Config for Runtime {
|
||||
type ValidatorIdOf = ConvertInto;
|
||||
type Keys = UintAuthorityId;
|
||||
type Event = Event;
|
||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user