Remove implicit approval chilling upon slash. (#12420)

* don't read slashing spans when taking election snapshot

* update cargo.toml

* bring back remote test

* fix merge stuff

* fix npos-voters function sig

* remove as much redundant diff as you can

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: Andronik <write@reusable.software>

* fix

* Update frame/staking/src/pallet/impls.rs

* update lock

* fix all tests

* review comments

* fmt

* fix offence bench

* clippy

* ".git/.scripts/bench-bot.sh" pallet dev pallet_staking

Co-authored-by: Andronik <write@reusable.software>
Co-authored-by: Ankan <ankan.anurag@gmail.com>
Co-authored-by: command-bot <>
This commit is contained in:
Kian Paimani
2022-12-12 17:05:13 +00:00
committed by GitHub
parent af46f85e0c
commit 0b29691688
9 changed files with 526 additions and 546 deletions
+4 -7
View File
@@ -792,12 +792,10 @@ benchmarks! {
}
get_npos_voters {
// number of validator intention.
// number of validator intention. we will iterate all of them.
let v in (MaxValidators::<T>::get() / 2) .. MaxValidators::<T>::get();
// number of nominator intention.
// number of nominator intention. we will iterate all of them.
let n in (MaxNominators::<T>::get() / 2) .. MaxNominators::<T>::get();
// total number of slashing spans. Assigned to validators randomly.
let s in 1 .. 20;
let validators = create_validators_with_nominators_for_era::<T>(
v, n, T::MaxNominations::get() as usize, false, None
@@ -806,9 +804,8 @@ benchmarks! {
.map(|v| T::Lookup::lookup(v).unwrap())
.collect::<Vec<_>>();
(0..s).for_each(|index| {
add_slashing_spans::<T>(&validators[index as usize], 10);
});
assert_eq!(Validators::<T>::count(), v);
assert_eq!(Nominators::<T>::count(), n);
let num_voters = (v + n) as usize;
}: {