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

x/staking: A sequence of transactions causes one to delete a non-existent validator #2189

Closed
ValarDragon opened this issue Aug 30, 2018 · 3 comments · Fixed by #2238
Closed
Assignees

Comments

@ValarDragon
Copy link
Contributor

Our previous detection algorithm for this was incorrect. This was fixed in #2188, and as shown there it causes errors. That PR has one such sequence of purely staking events that causes this to happen. #2188. See https://circleci.com/gh/cosmos/cosmos-sdk/25616?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

/cc @cwgoes @rigelrozanski
@zmanian had asked if we could merge into a patch release as gaia v0.24.3

@alexanderbez alexanderbez changed the title staking: A sequence of transactions causes one to delete a non-existent validator x/staking: A sequence of transactions causes one to delete a non-existent validator Sep 4, 2018
@alexanderbez
Copy link
Contributor

alexanderbez commented Sep 5, 2018

Update from #2238:

In terms of not sending TM a validator (that was not previously bonded) that goes from zero power, to non-zero power, back to zero power, #2238 addresses and fixes that.

However, during testing of gaia sim slow (thanks @ValarDragon ), the same failure triggered, but it seems it's for a different reason -- perhaps related to #2241.

Summary as follows (based on logs I added):

Given validatorA:

  • height 16: bonded (bondedHeight: 6, unbondingHeight: 0)
  • height 18: unbonded (bondedHeight: 6, unbondingHeight: 18)
  • height 56: bonded (bondedHeight: 56, unbondingHeight: 18)
  • height 68: unbonded (bondedHeight: 56, unbondingHeight: 68)
  • height 75: ??? (validatorA not sent in GetTendermintUpdates -- should be since next line indicates it's unbonded)
  • height 88: unbonded (bondedHeight: 75, unbondingHeight: 88) -> simulation fails because TM does not have validatorA.

So validatorA does not go from zero, to non-zero, back to zero it seems, but something else seems to be happening. Correct me if I'm wrong.

@cwgoes
Copy link
Contributor

cwgoes commented Sep 6, 2018

@alexanderbez Do you have a commit revision and a simulation seed to reproduce that exact event sequence?

@alexanderbez
Copy link
Contributor

@cwgoes yes.

Manually set the seed to: 1536164987760853304 (I also think I set the number of blocks to 500 but I dont think that matters)
Run:

GOCACHE=off go test github.com/cosmos/cosmos-sdk/x/stake/simulation -run ^TestStakeWithRandomMessages$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants