Skip to content

Commit

Permalink
Merge pull request #855 from persistenceOne/puneet/zerovalunbonding
Browse files Browse the repository at this point in the history
fix: do not allow zero delegation unbondings
  • Loading branch information
puneet2019 authored Dec 5, 2024
2 parents 502dfbd + 1e1bcce commit 163d163
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

### Improvements

- [855](https://github.com/persistenceOne/pstake-native/pull/855) Add condition for not allowing zero delegation unbondings icq

## [v2.15.0] - 2024-05-30

### Improvements
Expand Down
3 changes: 2 additions & 1 deletion x/liquidstakeibc/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@ func (k *Keeper) ValidatorUndelegationWorkflow(ctx sdk.Context, epoch int64) {
for _, validator := range hc.Validators {
// check if there are validators that need to be unbonded
if validator.UnbondingEpoch > 0 &&
validator.UnbondingEpoch+liquidstakeibctypes.UnbondingStateEpochLimit <= epoch {
validator.UnbondingEpoch+liquidstakeibctypes.UnbondingStateEpochLimit <= epoch &&
validator.DelegatedAmount.GT(sdk.ZeroInt()) {

// unbond all delegated tokens from the validator
validatorUnbonding := &liquidstakeibctypes.ValidatorUnbonding{
Expand Down

0 comments on commit 163d163

Please sign in to comment.