Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
chore: Add check for uneven stores' height #14410
chore: Add check for uneven stores' height #14410
Changes from 28 commits
49e770c
a16b35f
248a816
cfea0f8
c2a1777
da1456c
5c2095e
6c9ec1e
62942cf
8cba224
57033e9
59d2d35
343e7b5
ebc8f08
a821cbd
7f23d14
d0fa186
cf71697
0352c08
2929387
a55ba07
8308d59
c65287d
54fddbe
c11e0da
db95ddd
4d12c11
f40a22f
7fe88ab
ea288e3
527583d
a322fd2
0f9e7a8
712d795
56fdd42
d948f31
3eaf5c5
22c0d95
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Maybe it is a stupid question, but why is it 0 and not
storeParams.initialVersion-1
for the initial version?It has been bumped at L254.
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.
Great Q @julienrbrt. @catShaark is this because the store already exists and is just being renamed? Let's be sure to have a test that tests this edge case.
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.
This is because we're loading the old store so that we can move data from that old store to the new store. If we want to load an already exist store, we must set initial version to 0 or else we'll have
initial version set to %v, but found earlier version %v
errorThere 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.
there's already a test for store rename which is
TestSetLoader
in x/upgrades/typesThere 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.
Right, but haven't you removed the case for the store rename? https://github.com/cosmos/cosmos-sdk/pull/14410/files#diff-d7f6a3ea9905545b1e8afd31dcd8f9fccf72124c43349d647c3bae894d4d6114L151.
I may just confused here don't mind my question if it is not relevant.
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.
So there're 2 checks, the first one checks if we can load the root store with the old store mounted, the second checks if we can load the root store with the new store mounted. I only remove the first one and also we only need the second one to confirm that new store is of correct height.