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:
André SilvaandAndronik Ordian authored and GitHub committed 2021-10-06 16:22:34 +00:00
1 parent 12e9e7ceb3
commit 7e5c022aea
25 files changed
+282 -134

No files matched your search

+2 -2
View File
@@ -926,8 +926,8 @@ impl<T: Config> OneSessionHandler<T::AccountId> for Pallet<T> {
Self::enact_epoch_change(bounded_authorities, next_bounded_authorities)
}
fn on_disabled(i: usize) {
Self::deposit_consensus(ConsensusLog::OnDisabled(i as u32))
fn on_disabled(i: u32) {
Self::deposit_consensus(ConsensusLog::OnDisabled(i))
}
}