-
Notifications
You must be signed in to change notification settings - Fork 11
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-3095) revamp adding validators to dashboard #370
Conversation
Input string `json:"input"` | ||
Networks []network `json:"networks,omitempty"` | ||
Types []searchTypeKey `json:"types,omitempty"` | ||
IncludeValidators bool `json:"include_validators,omitempty"` |
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.
Dear Lucca,
I might be wrong but I think that you do not let anymore the front-end tell the API whether counting is needed.
When the request comes from the general search bar, a count is not needed (as far as I know). To save resources, maybe you want to keep this boolean in the spec, so you count only if we set it to true
.
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.
getting the count was the alternative to getting the validator indices, i.e. even in the old system it was always planned to return the count when setting include_validators
to false
. fetching the count is not that resource intensive, so it should be fine.
} | ||
err := db.ReaderDb.Select(&ret.Validators, "select distinct proposer from blocks where graffiti_text = $1 limit 10;", graffiti) // added a limit here to keep the query fast | ||
err := db.ReaderDb.Get(&ret.Count, "select count(distinct proposer) from blocks where graffiti_text = $1;", graffiti) // added a limit here to keep the query fast |
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.
the comment is obsolete now
No description provided.