Skip to content
Unverified Commit 55f58a80 authored by Ankan's avatar Ankan Committed by GitHub
Browse files

[Fix|NominationPools] Only allow apply slash to be executed if the slash...


[Fix|NominationPools] Only allow apply slash to be executed if the slash amount is atleast ED (#6540)

This change prevents `pools::apply_slash` from being executed when the
pending slash amount of the member is lower than the ED.

The issue came to light with the failing [benchmark
test](https://github.com/polkadot-fellows/runtimes/actions/runs/11879471717/job/33101445269?pr=490#step:11:765)
in Kusama. The problem arises from the inexact conversion between points
and balance. Specifically, when points are converted to balance and then
back to points, rounding can introduce a small discrepancy between the
input and the resulting value. This issue surfaced in Kusama due to its
ED being different from Westend and Polkadot (1 UNIT/300), making the
rounding issue noticeable.

This fix is also significant because applying a slash is feeless and
permissionless. Allowing super small slash amounts to be applied without
a fee is undesirable. With this change, such small slashes will still be
applied but only when member funds are withdrawn.

---------

Co-authored-by: default avatarDónal Murray <[email protected]>
parent 2a421441
Pipeline #506516 waiting for manual action with stages
in 1 hour, 13 minutes, and 56 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment