-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[fix] Bound staking ledger correctly with MaxUnlockingChunks from configuration #12343
[fix] Bound staking ledger correctly with MaxUnlockingChunks from configuration #12343
Conversation
bot rebase |
Rebased |
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.
Looks good in itself. But there's a follow-up.
First, look into chill_other
and what it does. You will find this wacky code in it:
if Nominators::<T>::contains_key(&stash) && Nominators::<T>::get(&stash).is_none() {
Self::chill_stash(&stash);
return Ok(())
}
This is basically checking: if a nominator is in a state where it is not decodable, then chill it.
I think we can take this a step further. Look into reap_stash
. We can also add a clause to this function, that if a staker (regardless of the role), is in a state where it is not decodable (e.g. Ledger::contains_key(staler) && Ledger::get(staker).is_none()
) then they can be reaped as well.
There is an issue here since ledger itself is undecodable, the stash can't be read to chill it.
|
Assuming that we know the slash is only un-decodable because of the latter Let's discuss this in a dedicated issue though. |
bot rebase |
Rebased |
bot merge |
…figuration (paritytech#12343) * used maxunlockingchunks from config * mhl MaxUnlockingChunks * no migration needed * changes as per requested * fmt * fix tests * fix benchmark * warning in the doc for abrupt changes in the config * less unnecessary details in the test * fix tests Co-authored-by: mrisholukamba <abdulrazzaqlukamba@gmail.com> Co-authored-by: parity-processbot <>
Fixes #12227
Original PR #12289 and contributor: @MrishoLukamba