Skip to content

[CRITICAL] get_rank returns 0 for any player outside the top-50 — misleading and inconsistent #159

Description

@grantfox-oss

Summary

leaderboard/src/lib.rs get_rank returns 0 for any address not in the top-50 list. A return value of 0 is indistinguishable from "rank 0" (the first position), making it impossible to tell whether a player is ranked first or not ranked at all.

Impact

Fix

Return UNRANKED_RANK (51) for any player not in the top-50, ensuring rank > MAX_TOP_PLAYERS is the sole marker for "not ranked".

Reproduction

  1. Query get_rank for an address that has never played.
  2. Observe the return value 0.
  3. Compare with get_top_players()[0] — the first entry has rank 1, so 0 appears to be ahead of rank 1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third CampaigncriticalCritical severity - funds at risk

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions