Cosmos-sdk: Allow querying of /staking/validators

Created on 11 Apr 2019  Â·  11Comments  Â·  Source: cosmos/cosmos-sdk

Summary

Currently /staking/validators doesn't have a preference on bond status OR power, it simply returns the top MaxValidators from the store. So this could mean unbonded or even jailed validators could be included and bonded validators excluded (ref: #4096).

Proposal

Allow this query endpoint to take query params -- at the very least status. Also, support direct pagination instead of forcing to MaxValidators.

Acceptance Criteria

  • Implement pagination for /staking/validators
  • Implement status query param for /staking/validators

For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
REST staking

Most helpful comment

@clawmvp yes, I just started work on this right now. Since it's critical for many clients, I suggest that once I complete this, we merge this into develop __and__ into a patch release, v0.34.2 (cc @jackzampolin).

If all goes well, expect something this week.

All 11 comments

Can we hotfix this by just returning all validators for now? Probably less then 200 am I right?
This problem results in a validator not showing up in Lunie.

I'm not sure @faboweb. We already have this issue in the upcoming release and we're not making a patch release of 0.34.0, so what would be the point?

When is 0.35 coming?

It's currently being worked on -- the active sprint/release. I'm not sure we have a set-in-stone date on it yet. Do we @alessio?

In any case, check the board: https://app.zenhub.com/workspaces/sdk-sprint-board-5acbc6a3ebb7e24fed9a8499/board?milestones=v0.35.0%232019-04-26&filterLogic=any&repos=51193526

@faboweb The team hasn't yet come to an agreement on what release model we should adopt. It's nobody's fault, we just are not in the position to address such issue until we manage to split gaia from sdk [1].
Once we've got there, we'll make a decision about how to go about managing releases for each of the two products and will announce our strategy timely.

In other words: no dates quite yet.

[1] https://github.com/cosmos/cosmos-sdk/issues/4071 (ZenHub is required to be able to see issue's dependencies)

Ok. To me it sounds more like a bug then a feature request as it breaks expected behaviour. Therefor I would have fixed it asap and put it into a 0.34.1 which could be rolled out as a non breaking update. But I am probably missing sth.. Looking forward to the fix. Thanks guys.

hey guys, any update on this? i m still out of the lists on every explorer that uses this.

@clawmvp yes, I just started work on this right now. Since it's critical for many clients, I suggest that once I complete this, we merge this into develop __and__ into a patch release, v0.34.2 (cc @jackzampolin).

If all goes well, expect something this week.

Great, thank you!

Great thanks @alexanderbez

Thanks @alexanderbez !
and you got a typo :)

 - in: query
          name: page
          description: The gage number.

The gage number

Was this page helpful?
0 / 5 - 0 ratings