mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 12:37:57 +00:00
Automatic withdraw_unbonded upon unbond (#12582)
* 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 commit is contained in:
@@ -1644,9 +1644,12 @@ pub mod pallet {
|
||||
/// # Note
|
||||
///
|
||||
/// If there are too many unlocking chunks to unbond with the pool account,
|
||||
/// [`Call::pool_withdraw_unbonded`] can be called to try and minimize unlocking chunks. If
|
||||
/// there are too many unlocking chunks, the result of this call will likely be the
|
||||
/// `NoMoreChunks` error from the staking system.
|
||||
/// [`Call::pool_withdraw_unbonded`] can be called to try and minimize unlocking chunks.
|
||||
/// The [`StakingInterface::unbond`] will implicitly call [`Call::pool_withdraw_unbonded`]
|
||||
/// to try to free chunks if necessary (ie. if unbound was called and no unlocking chunks
|
||||
/// are available). However, it may not be possible to release the current unlocking chunks,
|
||||
/// in which case, the result of this call will likely be the `NoMoreChunks` error from the
|
||||
/// staking system.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(T::WeightInfo::unbond())]
|
||||
pub fn unbond(
|
||||
|
||||
Reference in New Issue
Block a user