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

Genesis Validators bonding status showing Unbond after starting a new chain #1666

Closed
sherry13131 opened this issue Jul 13, 2018 · 7 comments · Fixed by #1724
Closed

Genesis Validators bonding status showing Unbond after starting a new chain #1666

sherry13131 opened this issue Jul 13, 2018 · 7 comments · Fixed by #1724
Assignees
Labels
C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T:Bug

Comments

@sherry13131
Copy link
Contributor

I tried to run my chain with cosmos v0.20.0, and I found out the validators (genesis) shows the bonding status as Unbonded, except one of the validators. In my case, I have 4 validators and only the last validator (the owner with account number 3) showing Bonded.
All of them definitely are bonded since they have voting power, and their votes are showing on the log as well. When I tried to revoke and unrevoke one of those validators which shown Unbonded, it shows Bonded as expected. Also, when someone delegate to those validators, it will show Unbonded to Bonded too. There is no problem on the bonding status for a full node to become a validator.

@rigelrozanski
Copy link
Contributor

rigelrozanski commented Jul 13, 2018

Interesting, thanks for the catch - could you outline the exact commands you used to reproduce this bug? That would be very useful

@sherry13131
Copy link
Contributor Author

sherry13131 commented Jul 14, 2018

First, I create the genesis file as usual by doing init gen-tx and init --gen-txs, then start the chain.
You can try to do these cmd to check if the validator is bonded instead of what it shown on the status (Unbonded)

  1. mycli stake unrevoke cosmosaccaddr1hyvksj9cj7yxnkxm5pgucp3n8rw63ncwxccnaw --chain-id chain-001 --from sherry
    You cannot unrevoke it since it is still Bonded
  2. mycli stake create-validator --from newme --address-validator cosmosaccaddr19qpswqy4ucmarn99z9wsp6sxwan2qte054ceva --amount 4steak --pubkey cosmosvalpub1zcjduepq7v2rw70ag89chj5ngmayzqxppk65ep5ndqssd540uvhupl4rxz9q53mp75 --chain-id chain-001
    where the pubkey is one of the existing validators, you cannot create a validator since it's already exist.

Then do the following will catch the bugs:

  1. mycli stake delegate --address-delegator cosmosaccaddr19qpswqy4ucmarn99z9wsp6sxwan2qte054ceva --address-validator cosmosaccaddr1pvtv6y293rj5wz3ua77xaxpdm7v2raxdleyyjm --chain-id chain-001 --from sherry
    This you will see the validator with Unbonded status (which it should be Bonded), changes its state to Bonded after delegated
  2. Stop one validator and revoke it, then run it again after revoke. Do unrevoke and you will see the status is changed to Bonded
    Unrevoke cmd: mycli stake unrevoke cosmosaccaddr1hyvksj9cj7yxnkxm5pgucp3n8rw63ncwxccnaw --chain-id chain-001 --from sherry2

@rigelrozanski
Copy link
Contributor

Thanks @sherry13131 I'll debug this one v soon

@rigelrozanski rigelrozanski self-assigned this Jul 14, 2018
@rigelrozanski rigelrozanski added the T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). label Jul 16, 2018
@jinghiskwon
Copy link

Either a UX bug or something more problematic:

RE: Bucky

yeh they all say unbonded

i think this is due to the “remove global shares” change. can you open an issue?

Here is the outputs:

gaiacli stake validator cosmosaccaddr182ujqw3r8p5fffjqkf0rxzj29pg5q96nxd2khq
Validator 
Owner: cosmosaccaddr182ujqw3r8p5fffjqkf0rxzj29pg5q96nxd2khq
Validator: cosmosvalpub1zcjduepq2k5scsfrcyfwfqh5mshtl3vks6m925np7l2m2y0ruxa2fxrysp8sgwe8u4
Status: Unbonded
Tokens: 100.0000000000
Delegator Shares: 100.0000000000
Description: {Umbrella   }
Bond Height: 0
Proposer Reward Pool: 
Commission: 0/1
Max Commission Rate: 0/1
Commission Change Rate: 0/1
Commission Change Today: 0/1
Previous Bonded Tokens: 0/1

Cant unrevoke:

 gaiacli stake unrevoke cosmosaccaddr182ujqw3r8p5fffjqkf0rxzj29pg5q96nxd2khq --chain-id=gaia-7001 --from=Umbrella                                                                                             
Defaulting to account number: 48
Defaulting to next sequence number: 0
Password to sign with 'Umbrella':
ERROR: checkTx failed: (655463) Msg 0 failed: === ABCI Log ===
Codespace: 10
Code:      103
ABCICode:  655463
Error:     --= Error =--
Data: common.FmtError{format:"validator not revoked, cannot be unrevoked", args:[]interface {}(nil)}
Msg Traces:
--= /Error =--

=== /ABCI Log ===

But validator seems to be signing blocks:

"height/round/step": "1757/0/1",
"Vote{52:7E0289744CEB 1757/00/1(Prevote) 000000000000 /F9AD6E9E1C7A.../ @ 2018-07-17T17:19:00.775Z}",

@jinghiskwon
Copy link

Looks like delegating more steak fixes the UI:

gaiacli stake validator cosmosaccaddr182ujqw3r8p5fffjqkf0rxzj29pg5q96nxd2khq
Validator 
Owner: cosmosaccaddr182ujqw3r8p5fffjqkf0rxzj29pg5q96nxd2khq
Validator: cosmosvalpub1zcjduepq2k5scsfrcyfwfqh5mshtl3vks6m925np7l2m2y0ruxa2fxrysp8sgwe8u4
Status: Bonded
Tokens: 110.0000000000

@rigelrozanski
Copy link
Contributor

thanks @jinghiskwon looks related

@rigelrozanski
Copy link
Contributor

WOW interesting edge case - turns out that you CAN create duplicate records in the power store due to a bug in staking genesis. Basically what I understand is happening is that multiple validators with the same initial voting power are set to be added in the genesis - because the intra-tx counter is not set during genesis (aka left at 0 default) there is nothing to distinguish the key for the power store, so only one record gets added to the power-store, and only one record is looped through when updating the full validator set. The solution is to add an intra-tx counter for the validators being included at genesis, which mean that validators located earlier on in the genesis file will be given preference if they have identical voting power to another genesis validator.

As far as I can tell this is the only genesis bug which would make a validator not-bonded, symptoms seem to match up. Seems to fix the problem when I replicated in a local testnet should be resolved in #1724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants