-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix fast-unstake for accounts with slashing #12963
Conversation
bot fmt |
/cmd queue -c fmt $ 1 |
@kianenigma https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2172044 was started for your command Comment |
@kianenigma Command |
…bstrate into kiz-correct-slashing-spans
@gpestana can you add a test for this as well? |
we should make sure this goes to the next possible Polkadot release, which will probably be in 2023, would be good to have your tests in here @gpestana soon nonetheless. |
can you explain what the issue was? neither issue's title does this nor there's an issue linked to this PR. Thanks 🙏 |
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.
👍 (code-wise; don't know enough to reason about business logic)
@kianenigma with the current flow, there's no path for the calculated Explanation: When calling if unlocking == T::MaxUnlockingChunks::get() as usize {
let real_num_slashing_spans = Self::slashing_spans(&controller).iter().count();
Some(Self::do_withdraw_unbonded(&controller, real_num_slashing_spans as u32)?)
} In the if ledger.unlocking.is_empty() && ledger.active < T::Currency::minimum_balance() {
Self::kill_stash(&stash, num_slashing_spans)?;
// ... i.e. the account should be killed iff there's no unlocking chunks and the balance is below the ED. Thus, the path Note: since |
This is unrelated to any business logic. |
bot rebase |
Rebased |
/cmd queue -c fmt |
@kianenigma https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2188345 was started for your command Comment |
@kianenigma Command |
bot merge |
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/path-to-fast-unstake-in-polkadot-kusama/1539/1 |
* Fix fast-unstake for accounts with slashing * ".git/.scripts/fmt.sh" 1 * fmt * fix * fix weight tracking * Adds tests for withdraw_unbonded with slashing * Removes tests for withdraw_unbonded with slashing * ".git/.scripts/fmt.sh" * Adds slash spans calculation test for withdraw_unbonded Co-authored-by: command-bot <> Co-authored-by: gpestana <g6pestana@gmail.com>
* Fix fast-unstake for accounts with slashing * ".git/.scripts/fmt.sh" 1 * fmt * fix * fix weight tracking * Adds tests for withdraw_unbonded with slashing * Removes tests for withdraw_unbonded with slashing * ".git/.scripts/fmt.sh" * Adds slash spans calculation test for withdraw_unbonded Co-authored-by: command-bot <> Co-authored-by: gpestana <g6pestana@gmail.com>
kinda subtle, but kinda ashamed that I made the mistake 🤦