-
Notifications
You must be signed in to change notification settings - Fork 23
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
Further hotfix on panic when unbonding unbonded validator #75
Further hotfix on panic when unbonding unbonded validator #75
Conversation
@nnkken L440 should also continue? 🤔 |
I was keeping that because structurally it is possible to run |
if we if !found {
// due to address Bech32 prefix migration, it is possible that entry with address with old prefix was not
// deleted (e.g. jailed during unbond), so we don't panic here and instead just skip this validator
ctx.Logger().Error("validator in the unbonding queue was not found", "validator", valAddr)
continue
}
if !val.IsUnbonding() {
if val.IsUnbonded() {
// same issue as the comments above
ctx.Logger().Error("unbonding validator but the status was unbonded", "validator", valAddr)
continue
}
panic("unexpected validator in unbonding queue; status was not unbonding or unbonded")
}
val = k.UnbondingToUnbonded(ctx, val)
if val.GetDelegatorShares().IsZero() {
k.RemoveValidator(ctx, val.GetOperator())
} |
According to our discussion and the clause you wrote here. Same logic for not found (already delete) and unbound (already transit of state). |
Oh, github down resulting my previously comment is later than @chihimng one. 🗡️ |
PR updated. The SDK commit now is likecoin/cosmos-sdk@6cd3d08. |
The new SDK commit (v0.44.8-dual-prefix-hotfix-3) combined the previous commits into one commit for better review. |
Also guard the case of validator not found (since it could be already removed in previous unbonding).
Also add comments.
Related SDK commit: likecoin/cosmos-sdk@6cd3d08
The cause of the problem:
cosmos1abcd...
) was unbonding before Bech32 address prefix migrationCurrently we are guarding the unbonding code so it won't panic if validator was already unbonded or removed, but leave an error log instead.