Skip to content
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!: add app version to param store #347

Merged
merged 4 commits into from
Nov 13, 2023
Merged

Conversation

cmwaters
Copy link

@cmwaters cmwaters commented Oct 11, 2023

Description

This PR adds app version to the ParamStore meaning that app version is no longer just in memory but is also persisted. We need this for example when a node restarts as Tendermint will call Info and it must remember the correct app version. It's also important for ensuring that state sync works beyond v1

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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@cmwaters cmwaters changed the title add app version to param store feat!: add app version to param store Oct 11, 2023
Comment on lines -148 to -155
type baseappVersions struct {
// application's version string
version string

// application's protocol version that increments on every upgrade
// if BaseApp is passed to the upgrade keeper's NewKeeper method.
appVersion uint64
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this is removed in v0.47 and v0.50

Comment on lines -510 to +512
// We're explicitly not storing the Tendermint app_version in the param store. It's
// stored instead in the x/upgrade store, with its own bump logic.
app.paramStore.Set(ctx, ParamStoreKeyVersionParams, cp.Version)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't store it in upgrade because we have a different module hence we should store it here. In v0.50.x, the SDK also begins to store the app version in the ParamStore of BaseApp

@cmwaters cmwaters changed the base branch from release/v0.46.x-celestia to main October 11, 2023 12:44
@cmwaters cmwaters changed the base branch from main to release/v0.46.x-celestia October 11, 2023 12:54
@cmwaters cmwaters changed the base branch from release/v0.46.x-celestia to main October 11, 2023 12:59
@cmwaters cmwaters marked this pull request as ready for review October 12, 2023 15:53
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm. The main question I have has to do with where we need migration/if statement switches for reading/writing state

baseapp/options.go Outdated Show resolved Hide resolved
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM only a question and collective reminder

@@ -18,6 +18,7 @@ var (
ParamStoreKeyBlockParams = []byte("BlockParams")
ParamStoreKeyEvidenceParams = []byte("EvidenceParams")
ParamStoreKeyValidatorParams = []byte("ValidatorParams")
ParamStoreKeyVersionParams = []byte("VersionParams")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget, are these accessible by the gov handler? are we going to have to add this to the params filter? If so we should create an issue ofc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should. Good catch. Are the other params here protected by the paramsfilter

Comment on lines +118 to +121
if ctx.BlockHeader().Version.App >= 2 {
vp := &tmproto.VersionParams{AppVersion: v}
app.paramStore.Set(ctx, ParamStoreKeyVersionParams, vp)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when does SetAppVersion get called when version.App == 1?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in InitGenesis

@cmwaters cmwaters merged commit 562a626 into main Nov 13, 2023
32 of 33 checks passed
@cmwaters cmwaters deleted the cal/perist-app-version branch November 13, 2023 13:47
@cmwaters cmwaters restored the cal/perist-app-version branch November 20, 2023 10:32
@cmwaters cmwaters mentioned this pull request Nov 20, 2023
19 tasks
Copy link

mergify bot commented Nov 20, 2023

⚠️ The sha of the head commit of this PR conflicts with #360. Mergify cannot evaluate rules on this PR. ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants