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 #1629

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

Add ability to search for online accounts #1629

urtho opened this issue Sep 9, 2024 · 0 comments
Assignees
Labels
external contribution new-feature-request Feature request that needs triage

Comments

@urtho
Copy link
Contributor

urtho commented Sep 9, 2024

Problem

There is no way to quickly fetch all online accounts1.

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 ;)

Footnotes

  1. This is a placeholder issue - Nodely is going to do PR for that soon, following tests on light-indexer and fnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external contribution new-feature-request Feature request that needs triage
Projects
None yet
Development

No branches or pull requests

2 participants