-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Faulty slashing when ex-validator is reintroduced into the validator set #1867
Comments
Thanks for this bug report! We should investigate soon. CC @cwgoes @alexanderbez |
Talking with @alexanderbez bout this now I think that this is a general situation which applies to all validators who have left the validator set and are entering back into the validator set - not just the cliff validators. We probably need to implement some a custom way of updating the |
I kind of get the gist of what you're saying, but do you want to elaborate on this a bit more?
Interesting idea, but indeed, as you pointed out, this would not be very efficient. Perhaps like @rigelrozanski we could have a special case of updating |
I think this specific reported problem is only an issue when a full In the usual case, the validator has been signing for awhile and However, if a full I think there are two ways to fix this that preserve the semantics we want:
The latter requires extra store operations, so I think the former is preferable. I think we also need to perform additional logic upon entering/leaving the bonded validator set later on after unrevoking, so that validators have at least The first thing we should do here (after deciding upon an approach) is update the spec. |
I'm going to try to deal with this before Game of Stakes. |
Latest approach outlined at #2480 (comment) |
* prepare v8 release (backport cosmos#1860) (cosmos#1867) * prepare v8 release (cosmos#1860) * chore: changelog * chore: update changelog * chore: add changelog for v7.0.3 * chore: add v7.1.0 to changelog Co-authored-by: Yaru Wang <[email protected]> (cherry picked from commit f0397fd) # Conflicts: # CHANGELOG.md * Update CHANGELOG.md Co-authored-by: billy rennekamp <[email protected]> * Added migrations for quicksilver stuck fund fix * Migrations for quicksilver * Check if balance of the refund addess is positive Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: billy rennekamp <[email protected]> Co-authored-by: lg <[email protected]>
* prepare v8 release (backport cosmos#1860) (cosmos#1867) * prepare v8 release (cosmos#1860) * chore: changelog * chore: update changelog * chore: add changelog for v7.0.3 * chore: add v7.1.0 to changelog Co-authored-by: Yaru Wang <[email protected]> (cherry picked from commit f0397fd) # Conflicts: # CHANGELOG.md * Update CHANGELOG.md Co-authored-by: billy rennekamp <[email protected]> * docs: update changelog Signed-off-by: Yaru Wang <[email protected]> * docs: update docs Signed-off-by: Yaru Wang <[email protected]> Signed-off-by: Yaru Wang <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: billy rennekamp <[email protected]>
Summary of Bug
When a validator is removed from the validator set because it was on the cliff and is later readded to the voting set the
SigningInfo
is not reset and the validator is slashed as if it was not signing in the period in which it was not in the validator set.Example:
https://figment.network/cosmos/hubble/gaia-7003/validators/02C231DA2DFF636671D3789B5D651AED09B1B834
Our secondary validator was on the cliff in block 2943 and replaced by another validator with more voting power. As a result it was removed from the active validator-set.
On block 10004 the first slashing period ended and inactive validators (those who really missed blocks) were dropped from the validator-set. As a result our validator was readded to the validator-set.
However the SigningInfo was not reset so
StartHeight
andSignedBlocksCounter
were still in the state in which they were in block <2943.That later triggered the slashing code since we obviously did not sign blocks while we were not in the active validator-set but the code still thought we started signing on height 0 (
StartHeight
).That way the following condition was true even though:
cosmos-sdk/x/slashing/keeper.go
Lines 104 to 105 in c9936b3
Solution
There are many ways to solve this of which some keep the number of missed blocks and others drop it.
The easiest would be resetting the SigningInfo but that would allow Byzantine validators to reset their SigningState by redelegating between multiple validators and cliffing themselves which we obviously not want.
Another way would be tracking the LastSignedHeight and adapting StartHeight (possible causing writes on every block).
Since this is only a fraction of possible solutions and this certainly requires some discussion in the SDK team the Certus.One team decided to not create a PR and rather start a discussion about what would be the best solution.
For Admin Use
The text was updated successfully, but these errors were encountered: