Skip to content

fix: unbonding countdown labels rounds as days #751

Description

@rickstaa

components/StakeTransactions/index.tsx:115 counts rounds and labels them days:

Tokens will be available for withdrawal in approximately{" "}
{+lock.withdrawRound - roundId} days.

A round is not a day. RoundsManager.roundLength() currently returns 6377 L1 blocks ≈ 21.3 hours, so each round shown as a day is about 11% short, and the error compounds across the ~7 rounds of an unbonding period — roughly 7 days displayed against a real ~6.2. Round length is also governance-configurable, so the gap is not fixed.

Fix

useCurrentRoundData() already returns roundLength, so the real duration is available client-side without another request:

hours = (withdrawRound - currentRound) * roundLength * AVERAGE_L1_BLOCK_TIME / 3600

AVERAGE_L1_BLOCK_TIME is already used for this kind of conversion in lib/api/polls.ts and lib/api/treasury.ts.

Simpler alternative if the conversion is not wanted: say rounds rather than days, with pluralisation. Accurate, and it matches what the protocol actually measures.

Note

Raised by Copilot on #748 against a component that has since been removed from that PR, but the same wording is on main and predates it.

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