-
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
fix: invalid return value from keeper GetLastCompleteUpgrade #11705
fix: invalid return value from keeper GetLastCompleteUpgrade #11705
Conversation
bb61d25
to
12c812c
Compare
36d2902
to
d62bb27
Compare
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
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.
LGTM. Let's be sure to add a changelog entry too 👍
Sorting is not a problem. The problem is with DB access. Now we query all upgrades. I think the better solution is to update the key and use block height (serialized as fixed len uint64) and name later. |
Actually @robert-zaremba has a good point here in that his suggestion to change the index/key is a cleaner approach. However, I don't agree with should go with this just to fix/change it again later (since we can't backport it anyway). I'd rather get this right in one go. So @daeMOn63 if you're open to it, would you be willing to take another stab at this? You'd essentially have to scrap this PR and change the key along with doing some migration stuff. I can also tackle this if you think it's something you're not interested in and/or don't have the time for. |
@alexanderbez just opened #11800 actually with this alternative implementation :) First time playing with migration, looking forward to your review there! If we directly go with #11800, we can just close this one. |
This should probably still be backported to 45 |
@ValarDragon #11800 isn't state-machine compatible with v0.45 AFAICT |
Right, but this version is! |
Would |
Afaik, both versions of this PR would return similar results, the main difference is some potential performance impact with this one as it queries all upgrades to sort them by height in the code. The v0.46 version should also apply nicely with or without this one in v0.45 as the migration will take care of reindexing things in the correct order. |
Well Im mainly concerned with determinism here. The PR that is in 0.46 can't be used because it introduces state changes. This PR doesn't but it does change the order of what |
GetLastCompletedUpgrade was a function that was added in the v0.45 line to prevent accidental downgrades on bootup, it is safe to change its semantic! (Its not used in state machine) |
Ok, I will wrap this up for 0.45 then :) |
Description
Add test case showing issue described in #11707
Expecting tests to pass, but currently fail with:
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