-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Invoking a "unbond begin" twice causes CLI to panic #1831
Comments
I know it's calling |
Able to reproduce. Not limited to calling twice, calling |
Yup. I've noticed pretty much any stake command where it cannot find/decode an account, it panics :-/ |
Should be solved with #870 Adding a recover in |
I don't think thats the correct framing of this. We should avoid these panics before getting to the relevant code in attempting to execute the tx in the CLI. The panics existence is a different matter for if this did happen on-chain.
Iirc I added a method to ensure sign build broadcast to make sure the account exists. We can just copy paste that method over to the staking commands / within some command the relevant staking commands all run. |
Yeah, this should suffice I think. We have to just make sure there is no other branch possible for other panics to creep up 👍 |
… x/stake commands * Handle panic gracefully when unbond begin fails See #1831 * Handle failure to query delegation gracefully. Closes #1907 * Update PENDING.md * Reuse stake's error functions * New ErrBadValidatorAddr error UnmarshalValidator() checks the address length first; it does not make sense to attempt unmarshalling if the address is wrong. * New ErrBadDelegationAddr error * Introduce ErrBad{Redelegation,UnbondingDelegation}Addr custom errors to replace errors.New() calls * Replace ErrBadUnbondingDelegationAddr with ErrBadDelegationAddr to avoid duplication Thanks: @melekes for pointing this out * Use sdk.AddrLen instead of hardcoded address length * s/triple/tuple/ ## mention PR id in PENDING.md
Summary of Bug
Executing
$ gaiacli stake unbond begin ...
twice in a row causes the second execution to panic (assuming first was successful).Running on
0.23.0-e0e31c5
Steps to Reproduce
commits to block...
2. Execute again, panic occurs in CLI:
For Admin Use
The text was updated successfully, but these errors were encountered: