diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a420fb9b005..afa093be7754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,6 +93,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (simulation) [#18196](https://github.com/cosmos/cosmos-sdk/pull/18196) Fix the problem of `validator set is empty after InitGenesis` in simulation test. * (baseapp) [#18551](https://github.com/cosmos/cosmos-sdk/pull/18551) Fix SelectTxForProposal the calculation method of tx bytes size is inconsistent with CometBFT * (baseapp) [#18895](https://github.com/cosmos/cosmos-sdk/pull/18895) Fix de-duplicating vote extensions during validation in ValidateVoteExtensions. +* (x/staking) [#18841](https://github.com/cosmos/cosmos-sdk/pull/18841) Fix delegation state when it has dust share. Change the condition of unbond to remove delegation with less than minimum share ### API Breaking Changes @@ -197,6 +198,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) Upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp. * (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `HistoricalInfo` was replaced with `HistoricalRecord`, it removes the validator set and comet header and only keep what is needed for IBC. +* (x/staking) [#18841](https://github.com/cosmos/cosmos-sdk/pull/18841) Delegates with less than the minimum share removed. ## [v0.50.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.2) - 2023-12-11 diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 5ff226ec7bbd..3802b373c789 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -1197,10 +1197,9 @@ func (k Keeper) ValidateUnbondAmount( return shares, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid shares amount") } - // Cap the shares at the delegation's shares. Shares being greater could occur - // due to rounding, however we don't want to truncate the shares or take the - // minimum because we want to allow for the full withdraw of shares from a - // delegation. + // Depending on the share, amount can be smaller than unit amount(1stake). + // If the remain amount after unbonding is smaller than the minimum share, + // it's completely unbonded to avoid leaving dust shares. tolerance, err := validator.SharesFromTokens(math.OneInt()) if err != nil { return shares, err