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

fix: state-sync - app version stored in params (backport #241) #243

Merged
merged 1 commit into from
May 23, 2022

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented May 23, 2022

This is an automatic backport of pull request #241 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Closes: #XXX

## What is the purpose of the change

Backporting and expanding on: cosmos#11182

This is an attempt to fix app version bug related to state-sync and tendermit. More context is in the linked-above PR.

Upon backporting all relevant commits from the linked-above PR, it was discovered that some integration and simulation tests were failing. With the original design, it was difficult to find the source of the problem due to storing the protocol version in 2 database locations. Therefore, the original work was significantly redesigned to only keep the protocol version in param store.

Additionally, the protocol version was assumed to have already been set. Since we are creating a new entry in the database, it is now possible that the protocol version is non-existent at the start. As a result, mechanisms for detecting a missing protocol version were added:
- `baseapp.init(...)`
   * This is called on every restart. Here, we check if the protocol version is already in db. If not, set it to 0
- `baseapp.InitChain(...)`
   * This is called once at genesis. Here, we always set protocol version to 0

Then, on every upgrade the version gets incremented by 1

## Brief Changelog

- cherry-picked all relevant commits from cosmos#11182
- fixed some issues
- addressed some style comments from code review in cosmos#11182
- redesigned to only store protocol version in params store and removed logic for storing it in the upgrade keeper
- added logic for detecting missing protocol version and, if missing, setting it to 0
- unit and integration tested
- fixed all tests

## Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

This change is already covered by existing tests, such as *(please describe tests)*.

TODO: This change needs to be manually tested

## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? yes
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no
  - How is the feature or change documented? not applicable

(cherry picked from commit a68d28e)
@alexanderbez alexanderbez merged commit 6afaa2e into v0.45.0x-osmo-v7 May 23, 2022
@alexanderbez alexanderbez deleted the mergify/bp/v0.45.0x-osmo-v7/pr-241 branch May 23, 2022 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants