-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Automatic withdraw_unbonded
upon unbond
#12582
Automatic withdraw_unbonded
upon unbond
#12582
Conversation
f90291e
to
4e0e816
Compare
…n the staking pallet
4e0e816
to
9e569f5
Compare
…ate the consumed weight
withdraw_unbonded
upon unbond
Needs rebase. |
/cmd queue -c bench-bot $ pallet dev pallet_staking |
@gpestana https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2158490 was started for your command Comment |
@gpestana Command |
bot merge |
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-36/1529/1 |
After changes introduced in paritytech/substrate#12582 unbond method now additionaly calls withdraw_unbond_kill
* Prevents max unbonding chunk slots from being filled when unbonding in the staking pallet * hardcode num_slashing to unlock chunks automatically * refactor withdraw logic to do_withdraw; idiomatic rust improvements * a * callable unbond() to return a DispatchWithPostInfo to dynamically update the consumed weight * refunds overpaid fees when unbond with withdraw * fetches real slashing spans before withdrawal call * nits * addresses PR comments * Adds more testing * fixes doc comments * Fixes weight refunding logic for fn unbond * generalizes to return used weight or dispatch error * Update frame/staking/src/pallet/mod.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/staking/src/pallet/mod.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Addresses PR comments * Add comment to speculative num spans * adds missing add_slashing_spans in withdraw_unbonded_kill benchmarks * ".git/.scripts/bench-bot.sh" pallet dev pallet_staking * fix publish Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <>
* Prevents max unbonding chunk slots from being filled when unbonding in the staking pallet * hardcode num_slashing to unlock chunks automatically * refactor withdraw logic to do_withdraw; idiomatic rust improvements * a * callable unbond() to return a DispatchWithPostInfo to dynamically update the consumed weight * refunds overpaid fees when unbond with withdraw * fetches real slashing spans before withdrawal call * nits * addresses PR comments * Adds more testing * fixes doc comments * Fixes weight refunding logic for fn unbond * generalizes to return used weight or dispatch error * Update frame/staking/src/pallet/mod.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/staking/src/pallet/mod.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Addresses PR comments * Add comment to speculative num spans * adds missing add_slashing_spans in withdraw_unbonded_kill benchmarks * ".git/.scripts/bench-bot.sh" pallet dev pallet_staking * fix publish Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <>
This PR changes the flow of
fn unbond
to try to release unbonding chunks if the slots are full. Before unbonding,fn unbond
will check if there are still chunk slots available for the controller's account. If no available chunk slots, then thefn withdrawn_unbond
will be implicitly called to free up space in the chunk queue and proceed with the unbond. The call tofn unbound
may still fail withNoMoreChunks
if it was not possible to unlock free chunks due to the unbonding duration.