Skip to content

Zero-balance delegation remains with non-zero shares after redelegation/undelegation #41

Description

@YuXiaoCoder

Description

After fully undelegating from a validator on Injective, the delegation record remains on-chain with balance.amount = "0" but non-zero shares.

{
  "delegation": {
    "delegator_address": "inj18njk2lz5q7juryvzgyly2qxetuwqadxzpvmuhj",
    "validator_address": "injvaloper1rvqzf9u2uxttmshn302anlknfgsatrh5v7fl7e",
    "shares": "0.492037251164558270"
  },
  "balance": {
    "denom": "inj",
    "amount": "0"
  }
}

Because the delegation object still exists:

  • Explorers continue to display it as an active delegation.
  • The delegation can still report small staking rewards.
  • Users cannot remove it through a normal undelegation because the available token amount is zero.
Image

Expected behavior

After fully undelegating or redelegating, the delegation should be removed when its remaining shares are worth less than one base unit and the calculated balance is zero.

Actual behavior

A dust amount of shares remains permanently while the token balance is zero.

Upstream references

This appears related to the following Cosmos SDK issue and fix:

Could you please confirm whether the fix from the upstream PR is included in the Injective Cosmos SDK fork? If not, would it be possible to backport it and provide a migration or cleanup mechanism for existing zero-balance delegations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions