dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

ValidatorState.phase can be out-of-sync with Validator after re-orgs #972

Closed kostyantyn closed 5 years ago

kostyantyn commented 5 years ago

Describe the bug There is a test from https://github.com/dtr-org/unit-e/pull/937 PR which demonstrates that ValidatorState can be out-of-sync with Validator after reorgs. The mentioned PR resolves the issue with voting. We need to review every phase and resolve issues which can occur.

It seems that ValidatorState will have incorrect phase if we created a deposit but then during re-orgs it disappears. We should also write tests and check all other finalizer commits during re-orgs.

Review

  1. [x] vote (fixed in https://github.com/dtr-org/unit-e/pull/937)
  2. [ ] deposit (to be fixed in https://github.com/dtr-org/unit-e/pull/1009)
  3. [ ] slash (to be fixed in https://github.com/dtr-org/unit-e/pull/1009)
  4. [ ] logout (to be fixed in https://github.com/dtr-org/unit-e/pull/1009)
  5. [ ] withdraw (to be fixed in https://github.com/dtr-org/unit-e/pull/1009)