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

Gaia lite batch endpoint for validator signing info #3226

Closed
4 tasks
faboweb opened this issue Jan 4, 2019 · 11 comments
Closed
4 tasks

Gaia lite batch endpoint for validator signing info #3226

faboweb opened this issue Jan 4, 2019 · 11 comments
Assignees
Milestone

Comments

@faboweb
Copy link
Contributor

faboweb commented Jan 4, 2019

Summary

We need to query the signing info for ever validator. This means several requests which takes a while. Let's add a batch endpoint as you usually will want to query all the info at once.

Proposal:
/slashing/validators/signing_info or /slashing/validators

Problem Definition

Proposal


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@jackzampolin
Copy link
Member

Great idea @faboweb!

@fedekunze fedekunze removed their assignment Jan 23, 2019
@jackzampolin jackzampolin added this to the v0.32.0 milestone Jan 29, 2019
@faboweb
Copy link
Contributor Author

faboweb commented Mar 13, 2019

This currently is 100 requests when we open the validators page.
Same goes for displaying rewards per validator. (also 100 requests)

@jackzampolin jackzampolin modified the milestones: Backlog, v0.34.0 Mar 13, 2019
@sabau
Copy link
Contributor

sabau commented Mar 13, 2019

I will like to have the first one as we have other routes that share that prefix

@faboweb
Copy link
Contributor Author

faboweb commented Mar 13, 2019

but then it conflicts with /slashing/validators/{validator address}. just saying

@faboweb
Copy link
Contributor Author

faboweb commented Mar 15, 2019

Upvote. This is really annoying in production.

@cwgoes
Copy link
Contributor

cwgoes commented Mar 15, 2019

@faboweb I presume you want just bonded validators, not all validators?

@alexanderbez
Copy link
Contributor

@sabau @fedekunze any interest in picking this up? Good intro into the REST client.

@faboweb
Copy link
Contributor Author

faboweb commented Mar 15, 2019

@faboweb I presume you want just bonded validators, not all validators?

does it make it difference?

@sabau sabau self-assigned this Mar 20, 2019
@sabau
Copy link
Contributor

sabau commented Mar 20, 2019

I agree, it conflict with the current route. I think some routes hasn't been pre-designed so it's easy to fall in this now.
Currently there is a single route in slashing, so we can just forget about signing_info but I think we should re-think our routing a bit to allow this kind or requests easily.

Either having a keyword that says all but it's hacky and if we validate addresses or other parameters it won't work easily, we have to add conditions for that all around.

Usually I would like instead to push variables as close to the end as possible to avoid those cases, as when you do when you use the CLI.
/slashing/validators/{validatorPubKey}/signing_info -> /slashing/validators/signing_info/{validatorPubKey}

Or in distribution for example in:
/distribution/delegators/{delegatorAddr}/rewards -> /distribution/delegators/rewards/{delegatorAddr}
/distribution/delegators/{delegatorAddr}/rewards/{validatorAddr} -> /distribution/delegators/rewards/{delegatorAddr}/{validatorAddr}

Of course this need discussion and can't be done in this PR

@alexanderbez
Copy link
Contributor

Interesting proposal @sabau. I agree with some of those routes, but we should also keep in mind they should be grouped by (REST) resource.

e.g. /distribution/delegators/{delegatorAddr}/rewards. This reads to me as "for a given delegator from all delegators, give me the delagator's rewards".

@sabau
Copy link
Contributor

sabau commented Mar 20, 2019

Regarding that it's true if you see the delegator as resource and the reward as detail of that.
I was imagining to see the list of rewards as list or resources and a particular delegator as single resource. Let's continue on the issue context (rewards list is not even a nice / useful example probably :) )

alessio pushed a commit that referenced this issue Mar 28, 2019
Also remove duplicate pagination:
- move function to extract query params into types/rest
- adjust pagination values locally until available in tendermint for validators

Code cleanup:
- helper function in test
- fix pagination description in swagger.yaml
- uint instead of int when possible

Closes: #3226
Closes: #3991
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

6 participants