Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not allow validators with zero weight to be LSM staked. #795

Merged
merged 4 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

- [792](https://github.com/persistenceOne/pstake-native/pull/792) Use GetHostChainFromHostDenom in ICA Transfer
unsuccessfulAck instead of GetHostChainFromDelegatorAddress as Rewards account too uses ICA Transfer to autocompound
- [795](https://github.com/persistenceOne/pstake-native/pull/795) Reject zero weight validator LSM shares for
liquidstakeibc

## [v2.11.0] - 2024-03-12

Expand Down
4 changes: 4 additions & 0 deletions x/liquidstakeibc/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,10 @@ func (k msgServer) validateLiquidStakeLSMDeposit(
return nil, nil, nil, errorsmod.Wrapf(types.ErrLSMValidatorInvalidState, "validator %s is not in the bonded state, it is in %s", operatorAddress, validator.Status)
}

if validator.Weight.Equal(sdktypes.ZeroDec()) {
return nil, nil, nil, errorsmod.Wrapf(types.ErrValidatorNotFound, "validator %s is not in the validator set, weight is %s", operatorAddress, validator.Weight)
}

// check delegator has enough LSM tokens
delegatorBalance := k.bankKeeper.GetBalance(ctx, delegatorAddress, delegation.Denom).Amount
if delegatorBalance.LT(delegation.Amount) {
Expand Down
Loading