Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BIDS-2669) api: fix ordering of result of /api/v1/validator/leaderboard #2690

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

guybrush
Copy link
Collaborator

@guybrush guybrush commented Nov 13, 2023

🤖 Generated by Copilot at ed84339

Fixed a bug in the ApiValidatorLeaderboard function that returned the wrong order of validators. Updated the SQL query in handlers/api.go to sort by rank7d in ascending order.

@guybrush guybrush requested a review from Eisei24 November 13, 2023 11:42
Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the bug with the reverse order but I noticed that the rank is not consistent.
Here is an example from Prater:

  • On /validators/leaderboard the last rank is 606106 which is for validatorindex 318888
  • When opening the validator /validator/318888 it has rank 606091
  • The API also gives rank 606091 for that validator but also has other validators for the lower ranks up to 606106 (which would be validatorindex 602078 right now)

Is this a known issue?

@guybrush
Copy link
Collaborator Author

This fixes the bug with the reverse order but I noticed that the rank is not consistent.

this is because the leaderboard only gets updated once every day (every 225 epochs)

@guybrush guybrush requested a review from Eisei24 November 15, 2023 08:28
Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@guybrush guybrush merged commit a1c70b4 into master Nov 15, 2023
4 checks passed
@guybrush guybrush deleted the BIDS-2669/fix-api-validator-leaderboard-order branch November 15, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants