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

a validator exists on /validatorsets but not on /staking/validators #4096

Closed
4 tasks
1xCL opened this issue Apr 10, 2019 · 8 comments
Closed
4 tasks

a validator exists on /validatorsets but not on /staking/validators #4096

1xCL opened this issue Apr 10, 2019 · 8 comments
Labels
C:x/staking T: Dev UX UX for SDK developers (i.e. how to call our code)

Comments

@1xCL
Copy link

1xCL commented Apr 10, 2019

Summary of Bug

A validator named My Basement Validator is currently seems an active validator and has been validating since block#114,435. I can find the validator on /validatorsets/latest as below

{
      "address": "cosmosvalcons1h3ay33d02vduusd6uhzrqnf8fjk72up7h82dn4",
      "pub_key": "cosmosvalconspub1zcjduepqnhcc9dfkcwlepa2m65pssd9xs8acfjpu7gw7n688x2qu4tjvnxlq2ejp7j",
      "proposer_priority": "-32829557",
      "voting_power": "100"
}

However, the validator is not available on /staking/validators since block#352,276.

On The Big Dipper
https://cosmos.bigdipper.live/validator/BC7A48C5AF531BCE41BAE5C4304D274CADE5703E

On Hubble
https://hubble.figment.network/chains/cosmoshub-1/validators/BC7A48C5AF531BCE41BAE5C4304D274CADE5703E
The validator seems not available on Hubble too.

Version

gaiad version --long
cosmos-sdk: 0.33.2
git commit: dba33693c4b714db7c01eb3926edf780be12a8e5
vendor hash: cbc093c9143b454dd277ac2d304ca2edf042b213
build tags: netgo ledger
go version go1.11.5 linux/amd64
gaiacli version --long
cosmos-sdk: 0.33.2
git commit: dba33693c4b714db7c01eb3926edf780be12a8e5
vendor hash: cbc093c9143b454dd277ac2d304ca2edf042b213
build tags: netgo ledger
go version go1.11.5 linux/amd64

Steps to Reproduce

curl localhost:26659/validatorsets/latest
curl localhost:26659/staking/validators


For Admin Use

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

alexanderbez commented Apr 11, 2019

@winslyn thanks for creating an issue!

You validator is not bonded, that's why in /staking/validators your validator is not included (/staking/validators/cosmosvaloper1lc4wdzlvryg7fk9fc39d3yceu56gv4ea4jet3z).

@fedekunze
Copy link
Collaborator

maybe we should include a query param, say?includeNotBonded=<boolean>, to return all validators ?

@fedekunze
Copy link
Collaborator

the main problem here is that wallets expose validators that are returned by GET /staking/validators. Thus, new validators that are not bonded have less chance of receiving delegations (specially now that transfers aren't enabled yet).

We should discuss and reconsider if we want to keep this logic. Maybe returning all of them + displaying self-delegation % (see #3936) could help delegators in their decision process of choosing a validator.

@alexanderbez
Copy link
Contributor

alexanderbez commented Apr 11, 2019

I was incorrect, apologies. Validator cosmosvaloper1lc4wdzlvryg7fk9fc39d3yceu56gv4ea4jet3z is bonded and that endpoint returns all validators up to stakingParams.MaxValidators with no preference of ordering (correct me if I'm wrong @rigelrozanski).

Indeed, /validatorsets/latest is returning the validator (coming from TM) and /staking/validators isnt, but I don't know why?

My best guess is that there are actually > 100 validators (which is true), and since /staking/validators doesn't have a preference on bond status OR power, it simply returns the top MaxValidators from the store (in fact, I see unbonded validators returned).


My suggestion is that /staking/validators:

  1. Allow for a query param(s) (e.g. ?status=bonded&...)
  2. Always sort by power/tokens before returning MaxValidators results (or allow for pagination)

How does this sound?

@alexanderbez alexanderbez added REST C:x/staking T: Dev UX UX for SDK developers (i.e. how to call our code) and removed will-close labels Apr 11, 2019
@rigelrozanski
Copy link
Contributor

My basement validator seems fine, here is a query i just did on it

gaiacli query staking validator cosmosvaloper1lc4wdzlvryg7fk9fc39d3yceu56gv4ea4jet3z --chain-id=cosmoshub-1

Validator
  Operator Address:           cosmosvaloper1lc4wdzlvryg7fk9fc39d3yceu56gv4ea4jet3z
  Validator Consensus Pubkey: cosmosvalconspub1zcjduepqnhcc9dfkcwlepa2m65pssd9xs8acfjpu7gw7n688x2qu4tjvnxlq2ejp7j
  Jailed:                     false
  Status:                     Bonded
  Tokens:                     100100000
  Delegator Shares:           100100000.000000000000000000
  Description:                {My Basement Validator   }
  Unbonding Height:           0
  Unbonding Completion Time:  1970-01-01 00:00:00 +0000 UTC
  Minimum Self Delegation:    100000
  Commission:                 rate: 0.500000000000000000, maxRate: 0.800000000000000000, maxChangeRate: 0.010000000000000000, updateTime: 2019-03-22 22:40:05.047958727 +0000 UTC

@alexanderbez

My suggestion is that /staking/validators:
Allow for a query param(s) (e.g. ?status=bonded&...)
Always sort by power/tokens before returning MaxValidators results (or allow for pagination)
How does this sound?

Sounds great

@1xCL
Copy link
Author

1xCL commented Apr 12, 2019

My basement validator seems fine, here is a query i just did on it

I can confirm that My Basement Validator is available via gaiacli query staking validator but the problem was the validator wasn't showing on /staking/validators

Thanks all for the help!

@rigelrozanski
Copy link
Contributor

@winslyn yeah bez just opened up a new issue in response to this (#4099) which will make rest browsing of the validator endpoint much more intuitive!

@1xCL
Copy link
Author

1xCL commented Apr 12, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/staking T: Dev UX UX for SDK developers (i.e. how to call our code)
Projects
None yet
Development

No branches or pull requests

4 participants