-
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
feat!: connect app version with consensus params in end block #16244
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.
there will need to be a store migration to migrate the existing version to consensus params
This is a migration of the upgrade module right? So it would read in the old key and then set the app version in baseapp |
yes |
Does that mean I need to bump the consensus version from 2 to 3? |
yea, since its consensus breaking |
baseapp/baseapp.go
Outdated
@@ -199,8 +196,19 @@ func (app *BaseApp) Name() string { | |||
} | |||
|
|||
// AppVersion returns the application's protocol version. | |||
func (app *BaseApp) AppVersion() uint64 { | |||
return app.appVersion | |||
func (app *BaseApp) AppVersion(ctx context.Context) uint64 { |
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.
Can we have this return an error? In the ABCI++ branch, all the ABCI methods return an error so I would prefer this not to panic.
For now, we can panic in Info
which we'll adjust once we update the ABCI++ branch.
x/upgrade/types/keys.go
Outdated
// LegacyProtocolVersionByte was the prefix to look up Protocol Version (AppVersion) | ||
LegacyProtocolVersionByte = 0x3 | ||
|
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 would delete this and then define it in the migration file.
I've come across something of a deadlock here. We don't set state and the consensus params until Best solution I can think of is to deprecate the app version in the |
CHANGELOG.md
Outdated
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.
can we get those changelog entries under unreleased?
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.
gentle ping @cmwaters
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.
Sorry, I left this PR. Have tried to update it and move the changelog entries under unreleased
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
5ca9c50
to
7a52769
Compare
7a52769
to
60f3164
Compare
@@ -441,6 +402,7 @@ func (k Keeper) GetUpgradePlan(ctx context.Context) (plan types.Plan, err error) | |||
func (k Keeper) setDone(ctx context.Context, name string) error { | |||
store := k.storeService.OpenKVStore(ctx) | |||
sdkCtx := sdk.UnwrapSDKContext(ctx) | |||
fmt.Println("setting done", "height", sdkCtx.HeaderInfo().Height, "name", name) |
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 should have been using the logger
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 can remove in a follow up
Description
Closes: #16243
This PR wires up the upgrade module to the app version delivered through the
ConsensusParams
inEndBlock
(thus removing the previousappVersion
field in BaseApp).x/upgrade
no longer keeps its own copy of the app version but uses the baseapp's canonical app versionNOTE: this touches both
baseapp
andx/upgrade
. As they are different go modules, I can also split them into separate PRsAuthor 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