-
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
fix: Use bytes instead of string comparison in delete validator queue #12303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is totally acceptable. Thanks for contributing @williamchong :)
Can you please add a quick changelog entry under "improvements" or maybe it should go under "bug fixes".
@williamchong can you rebase the PR please or allow the core team to do it? |
99ad490
to
2428b21
Compare
sure and rebased |
@marbar3778 how does a contributor allow owners to rebase/update themselves again? |
There should be a button for them in the sidebar |
2428b21
to
9bdc5c9
Compare
Can't see the option there, maybe because I am opening this PR from a fork under org account? |
It's out of date again haha. Best to figure out how to enable that option in the likecoin org 👍 🙏 |
9bdc5c9
to
733f629
Compare
Codecov Report
@@ Coverage Diff @@
## main #12303 +/- ##
==========================================
- Coverage 66.54% 66.16% -0.39%
==========================================
Files 689 675 -14
Lines 72357 71262 -1095
==========================================
- Hits 48147 47147 -1000
+ Misses 21544 21473 -71
+ Partials 2666 2642 -24 |
… (backport cosmos/cosmos-sdk#12303) (#1301) * fix : Use bytes instead of string comparison in delete validator queue (#12303) * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: William Chong <6198816+williamchong@users.noreply.github.com>
… (backport cosmos/cosmos-sdk#12303) (#1301) * fix : Use bytes instead of string comparison in delete validator queue (#12303) * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: William Chong <6198816+williamchong@users.noreply.github.com> (cherry picked from commit 1038a39) # Conflicts: # CHANGELOG.md
… (backport cosmos/cosmos-sdk#12303) (backport #1301) (#1309) * fix: Use bytes instead of string comparison in delete validator queue (backport cosmos/cosmos-sdk#12303) (#1301) * fix : Use bytes instead of string comparison in delete validator queue (#12303) * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: William Chong <6198816+williamchong@users.noreply.github.com> (cherry picked from commit 1038a39) # Conflicts: # CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Youngtaek Yoon <noreply@yoon.mailer.me>
Description
We had a chain upgrade that introduced bech32 prefix change and dual prefix support in our cosmos-sdk fork, and after ~21 days of running the upgrade, our chain halted due to this issue. Details of our chain halt incident can be found here
The root issue is in
x/staking
,DeleteValidatorQueue
does a string comparison instead of bytes, which would cause panic when dequeueing validator if the address string format is changed (in our case, default bech32 prefix changed).I am not sure if this should be considered as a useful fix for general case, since changing bech32 prefix and dual prefix support seems not common. I am also not sure how to write a test without introducing our own dual prefix support feature.
Feel free to comment how would you like to handle this PR.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change