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: LSM slasing of redelegation #22755

Merged
Merged
Changes from 1 commit
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
12 changes: 3 additions & 9 deletions x/staking/keeper/slash.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,14 @@ func (k Keeper) SlashRedelegation(ctx context.Context, srcValidator types.Valida

// if the delegator holds a validator bond to destination validator, decrease the destination validator bond shares
if delegation.ValidatorBond {
if err := k.SafelyDecreaseValidatorBond(ctx, valDstAddr, sharesToUnbond); err != nil {
return math.ZeroInt(), err
}
k.SafelyDecreaseValidatorBond(ctx, valDstAddr, sharesToUnbond)
stana-miric marked this conversation as resolved.
Show resolved Hide resolved
}

// if this delegation is from a liquid staking provider (identified if the delegator
// is an ICA account), the global and validator liquid totals should be decremented
if k.DelegatorIsLiquidStaker(delegatorAddress) {
if err := k.DecreaseTotalLiquidStakedTokens(ctx, tokensToBurn); err != nil {
return math.ZeroInt(), err
}
if _, err := k.DecreaseValidatorLiquidShares(ctx, valDstAddr, sharesToUnbond); err != nil {
return math.ZeroInt(), err
}
k.DecreaseTotalLiquidStakedTokens(ctx, tokensToBurn)
stana-miric marked this conversation as resolved.
Show resolved Hide resolved
k.DecreaseValidatorLiquidShares(ctx, valDstAddr, sharesToUnbond)
}

// tokens of a redelegation currently live in the destination validator
Expand Down
Loading