MindBlockLabs/mindBlock_app

Implement Sorted Leaderboard with Persistent Player Index

Open

#292 opened on Mar 18, 2026

View on GitHub
 (4 comments) (0 reactions) (0 assignees)TypeScript (78 forks)auto 404
enhancementgood first issuesoroban

Repository metrics

Stars
 (2 stars)
PR merge metrics
 (PR metrics pending)

Description

Description:

The get_leaderboard() function currently returns an empty vector and serves as a placeholder. This needs to be fully implemented to support the game's social competition features.

Current Behavior:

get_leaderboard() accepts a limit: u32 parameter but always returns an empty Vec regardless of registered players or their XP. Expected Behavior: The function should return the top N players (where N = limit) sorted by XP in descending order.

Requirements:

  • Maintain a registry of all player addresses whenever a new player registers
  • The leaderboard query should respect the limit parameter
  • Players should be ranked by their current XP value
  • The implementation must work within Soroban's storage constraints — note that iterating all storage keys directly is not supported on Soroban; a separate index structure must be maintained

Acceptance Criteria:

  • get_leaderboard(5) returns the top 5 players by XP
  • Results are sorted highest XP first
  • A new player registration updates the player index
  • A test covering leaderboard ordering is included

Contributor guide