mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
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:
@@ -239,9 +239,9 @@ pub(crate) fn compute_slash<T: Config>(
|
||||
return None
|
||||
}
|
||||
|
||||
let (prior_slash_p, _era_slash) =
|
||||
let prior_slash_p =
|
||||
<Pallet<T> as Store>::ValidatorSlashInEra::get(¶ms.slash_era, params.stash)
|
||||
.unwrap_or((Perbill::zero(), Zero::zero()));
|
||||
.map_or(Zero::zero(), |(prior_slash_proportion, _)| prior_slash_proportion);
|
||||
|
||||
// compare slash proportions rather than slash values to avoid issues due to rounding
|
||||
// error.
|
||||
@@ -390,9 +390,7 @@ fn slash_nominators<T: Config>(
|
||||
let mut era_slash =
|
||||
<Pallet<T> as Store>::NominatorSlashInEra::get(¶ms.slash_era, stash)
|
||||
.unwrap_or_else(Zero::zero);
|
||||
|
||||
era_slash += own_slash_difference;
|
||||
|
||||
<Pallet<T> as Store>::NominatorSlashInEra::insert(¶ms.slash_era, stash, &era_slash);
|
||||
|
||||
era_slash
|
||||
@@ -411,12 +409,10 @@ fn slash_nominators<T: Config>(
|
||||
let target_span = spans.compare_and_update_span_slash(params.slash_era, era_slash);
|
||||
|
||||
if target_span == Some(spans.span_index()) {
|
||||
// End the span, but don't chill the nominator. its nomination
|
||||
// on this validator will be ignored in the future.
|
||||
// end the span, but don't chill the nominator.
|
||||
spans.end_span(params.now);
|
||||
}
|
||||
}
|
||||
|
||||
nominators_slashed.push((stash.clone(), nom_slashed));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user