Cosmos-sdk: rpc /validators truncating validators with less than 1 voting power

Created on 17 Mar 2019  Â·  6Comments  Â·  Source: cosmos/cosmos-sdk

Summary of Bug


RPC endpoint /validators is truncating validators with less than 1 voting power. At the time of this writing, there are 82 active validators on the mainnet and among them 4 validators have less than 1 voting power. /validators shows only 78 validators.

Steps to Reproduce


curl localhost:26657/validators

__

For Admin Use

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

All 6 comments

Good catch @winslyn. I think this has to do with uatom to atom conversions.

Validators who delegated less than one power would not be update status, so curl localhost:26657/validators would not show them.

    // github.com/cosmos/cosmos-sdk/x/staking/keeper/val_state_change.go
        if validator.PotentialTendermintPower() == 0 {
            break
        }

I think this has to do with uatom to atom conversions.

It seems that we should add error prompt for operation create validator with less uatom than one power. @jackzampolin

K so /validators is querying Tendermint validators _not_ validators from the cosmos-sdk. Tendermint does not (and should not) receive any information about validators which are non-bonded. Thus this query actually makes sense.

if you want to get the sdk validators you need to unmarshal the result from an abci query aka with this path /abci_query?path="custom/staking/validators"

http://rpc.hub.certus.one:26657/abci_query?path="custom/staking/validators"

Overall

  • gaiacli q staking validators returns validators in cosmos-sdk
  • curl localhost:26657/validators returns validators in tendermint

The validator would be in tendermint only when it staked enough token.

So a validator who bonded less than 1 atom is considered non-bonded and an inactive validator. Got it.

It seems that we should add error prompt for operation create validator with less uatom than one power.

this makes sense.

++

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rigelrozanski picture rigelrozanski  Â·  3Comments

fedekunze picture fedekunze  Â·  3Comments

ValarDragon picture ValarDragon  Â·  3Comments

faboweb picture faboweb  Â·  3Comments

rigelrozanski picture rigelrozanski  Â·  3Comments