Skip to content

fix: warn the user when undelegating is blocked by a pending delegator #740

Description

@rickstaa

Switching delegate sets startRound to currentRound + 1, making the delegator Pending for the rest of the round. BondingManager rejects unbond in that state, so the simulation reverts and Undelegate.tsx:86 disables the button — correctly, but with no explanation.

renderUnstakeWarnings in Footer.tsx already has the right message:

Your account is in a pending state. You can undelegate during the next round.

It never renders because getDelegatorStatus (lib/utils.tsx:30-57) compares subgraph values. After a switch the new startRound is not yet indexed, so it returns Bonded while the chain says Pending.

Observed: on-chain startRound 4276 against currentRound 4275 — genuinely pending, no notice shown.

Reproduction

  1. Delegate to orchestrator A.
  2. Move Delegated Stake to orchestrator B.
  3. Same round, Undelegate tab, enter an amount below your stake.
  4. Button is disabled with no reason. Clears when the next round starts.

Fix

Read BondingManager.delegatorStatus(address) on-chain so the pending warning shows. Sourcing only currentRound on-chain is not enough — the stale value is startRound, so both operands must come from the chain.

Related: #739.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions