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

Add ability to search for online accounts #4

Open
urtho opened this issue Sep 9, 2024 · 2 comments
Open

Add ability to search for online accounts #4

urtho opened this issue Sep 9, 2024 · 2 comments

Comments

@urtho
Copy link

urtho commented Sep 9, 2024

Upstream issue : algorand#1629

Problem

There is no way to quickly fetch all online accounts[^1].

Solution

  • Add is-online boolean filter to account search endpoint
  • Add is-reward-eligible boolean filter to account search endpoint
  • Add expires-in-hours filter that returns only accounts that will expire no later than expires-in-hours
  • Add appropriate optional partial index (for is-online only)

Response model should include:

  • total online stake
  • total eligible online stake
  • avg block time for the last 100 rounds in milliseconds

Notes:

  • is-reward-eligible assumes is-online
  • expires-in-hours should calculate avg block time over last 100 blocks using a query to block_header
  • return only accounts with non-expired keys (as online flag persists past key expiry)
  • expires-in-hours might need a better name like expires-in-hours-or-less but shorter ;)
@urtho
Copy link
Author

urtho commented Sep 19, 2024

Let's wait a bit for a confirmation on how suspended accounts look like (is-online:false + valid keyreg ?) so that we can show paused accounts in the results as well.

@urtho
Copy link
Author

urtho commented Sep 19, 2024

Thinking we should publish new , not yet merged functionality under different prefix instead of /v2. This would allow us not to break apps that used bleeding-edge stuff after the feature got renamed during the final merge.

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

No branches or pull requests

1 participant