-
Notifications
You must be signed in to change notification settings - Fork 4
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
api/consensus/validators: Expose validator signed blocks info #760
Conversation
55f9939
to
9294586
Compare
3cebf3d
to
34b6a16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this impl looks pretty good. Mostly left minor comments; the only major one is about supporting the validator dashboard mocks, which call for information on all validators over the past 24hrs.
storage/client/queries/queries.go
Outdated
ValidatorLast100BlocksSigned = ` | ||
SELECT | ||
height, | ||
COALESCE($1 = ANY(signer_entity_ids), FALSE) | ||
FROM ( | ||
SELECT height, signer_entity_ids | ||
FROM chain.blocks | ||
ORDER BY height DESC | ||
LIMIT 100 | ||
) AS subquery | ||
ORDER BY height ASC` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a use case to sort by height ASC
? I think the explorer is displaying the blocks in desc order so maybe we can just leave it as height DESC
, and it simplifies the query too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will ask forntend if they care about the order here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to return in DESC order and simplified the query.
34b6a16
to
41f7ea4
Compare
41f7ea4
to
1e7c373
Compare
Whether it is a validator prop or separated endpoint is up to backend. Oasis Scan returns an array of { block: boolean height: number }
https://www.oasisscan.com/mainnet/validator/stats?address=oasis1qqekv2ymgzmd8j2s2u7g0hhc7e77e654kvwqtjwm
In UI we want to showLast 100 blocks