-
Notifications
You must be signed in to change notification settings - Fork 124
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
validatorUnbondingCanComplete
must take into account (re)bonded validators
#232
Closed
Tracked by
#12578
Labels
scope: cosmos-sdk
Integration with Cosmos SDK
type: bug
Issues that need priority attention -- something isn't working
Comments
danwt
added
the
type: bug
Issues that need priority attention -- something isn't working
label
Jul 13, 2022
Any fix must take care of state cleanup, which is a bit nuanced. See also this issue for taking care of leaks. |
This was referenced Jul 14, 2022
Was fixed by |
Repository owner
moved this from In Progress
to Done
in Replicated Security
Jul 28, 2022
Repository owner
moved this from Done
to In Progress
in Replicated Security
Aug 1, 2022
Fixed by cosmos/cosmos-sdk#12796 |
Closing for now as fixed by cosmos/cosmos-sdk#12796 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
scope: cosmos-sdk
Integration with Cosmos SDK
type: bug
Issues that need priority attention -- something isn't working
By the time a mature VSC is received on the provider side mapping to a validator unbonding operation the validator can already be rebonded!
We must take this into account in the code. Changes will be needed at least here
https://github.com/cosmos/cosmos-sdk/blob/c783aea68fbd856c2b188b2d467a7fa5cb4df1e6/x/staking/keeper/unbonding.go#L326-L346
In the above, if the validator is already rebonded
k.UnbondingToUnbonded
can be called triggering a panic.I am really confirmed about the following case, in addition to what is explicit above. Consider:
0
to go out1
to go out0
comes in, and theif !val.IsMature(ctx.BlockTime(), ctx.BlockHeight())
branch is entered1
completes BEFORE maturity for1
is receivedI will make a PR soon.
Found with diff testing - although, it's interesting because in the diff model I do not model explicity all the data structures. Because of that, the diff model will search the validator unbonding queue for a validator with
opID == opID
before doing anything, which avoids the problem. Still though, the model is able to generate the example case.The text was updated successfully, but these errors were encountered: