-
Notifications
You must be signed in to change notification settings - Fork 93
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
Search for online accounts #1646
base: main
Are you sure you want to change the base?
Conversation
Discussion
|
A suspended account has status = 0 (offline) but has non-zero key material (SelectionID, VoterID, etc). |
Fix an issue in the underlying SQL query for the `online-only` parameter. The previous SQL query was returning online accounts with null key material. This commit filters out those accounts - only accounts with non-null key material are returned.
@agodnic thank you for the PR, a couple thoughts:
|
In the endpoint `GET /v2/accounts`, disable the `online-only` parameter by default.
@gmalouf thanks for taking the time to review this.
The new
Three basic test cases have been added to exercise the new parameter. I could be more thorough with the e2e tests, but in order to do so I'd have to create new blocks like the ones in https://github.com/algorand/indexer/tree/084577338ad4882f5797b3e1b30b84718ad40333/api/test_resources/validated_blocks. Not sure what's the best approach to generate those test blocks - I could use a msgpack editor and create the block fields from scratch, but maybe there's a less error-prone way. |
Summary
(This pull request is part of the features described in AlgoNode#4. The aforementioned features will be presented in separate, smaller pull requests to make it easier to accept/reject/discuss each one individually)
This pull request adds the
online-only
parameter toGET /v2/accounts
, which lets the user search for accounts whose participation status is "online".Test Plan
handlers_e2e_test.go
Performance
The performance of
is-online=true
lookups can be improved with the following index: