-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Removes incorrect try-state
check in staking
#14186
Conversation
Has an issue been made about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I found the reason why we had this test: this code should prevent ledger.active
from ever getting less than
substrate/frame/staking/src/pallet/mod.rs
Line 1011 in 1bbde5d
if ledger.active < T::Currency::minimum_balance() { |
Although, slashing could still violate this.
I think it is still better to first check a few of the stashes that cause this, and see what path they went through.
I think that's correct. However, if a stash has been slashed to the point of the active/total balance being below ED, someone needs to call
As mentioned in #14246, I see two paths for
From my current understanding, the try-state consistence check that this PR is removing is not correct and should be removed. We may want to think about a way to call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
All in all, I still find this situation with our assumptions around ledger a bit confusing. I hope you take a fundamental look at it and add new reasonable checks, if any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bot merge
bot rebase |
Rebased |
bot merge |
The current logic does not completely prevent the ledger active balance to remain above ED and there are code/config paths in which
ledger.active
may be 0. This PR removes the try-state check that is testing those invariants.Closes #14246