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
fix: Fix v0.45->v0.46 migration #12028
fix: Fix v0.45->v0.46 migration #12028
Changes from 7 commits
f7f181b
543fe08
11a48e4
9884ac5
fbb5bab
3146574
8a8b57b
73dfe79
55ae6b7
881179a
d8b5f0c
f9e46fb
26eebaf
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.
@facundomedica In the upgrade handler, no. See the original issue, we need to run the key migration before starting tendermint, so way before the upgrade handler is called.
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.
Alternative solution, the SDK's
start
command is a combination of TM'skey-migrate
+start
.key-migrate
is idempotent, so it can be run multiple times.However, if we decide to show logs, as we do in this PR and as it's done in tendermint, then those logs will be shown on each startup:
Any opinions on separate
key-migrate
andstart
commands VS onestart
command which runskey-migrate
under the hood?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'm shocked we have to actually write any substantial code here. I would've presumed Tendermint would've exposed a command that'll do all of this for us?
In any case, does Tendermint not expose the contexts we want to migrate?
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.
TM exposes:
https://github.com/tendermint/tendermint/blob/f33722b4233159a31cdf6c33258fbc601cdbd1d4/cmd/tendermint/commands/key_migrate.go#L15
But it needs additional flags to get the DB dir right. In this PR, we use the same code, but with
serverCtx
.I couldn't think of less code re-use, best I could do was to mention this was copy-pasted from tendermint - like other commands in that file.
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 see. Such an easy problem to solve if the TM command just had a function that the command called instead. Sigh...
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 feel this should be communicated in the release notes too
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.
Release notes imo are brief & high-level (see proposed defs in #11587).
How about int he UPGRADING.md document?
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.
encountered the same bug as in #9484, so applied the same fix