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

Upgrade IAVL and SDK with RAM improvements and bug fixes for v6.4 #907

Merged
merged 5 commits into from
Feb 21, 2022

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Feb 20, 2022

Closes: #XXX

Description

The main focus of this upgrade is stability improvements with the IAVL patch of v0.44.3x-osmo-v5.1. The big points are:

  • Fixes the "version X was already saved to a different hash" and "insufficient funds" bugs nodes were sometimes seeing after crashes.
  • Reduce the RAM overhead during the initial IAVL migration. Node operators should still have 32GB of RAM for all of their mainnet nodes.
  • Improving the log messages during migrations

The bugs people were seeing for nodes being saved to a different hash, etc. happen after restoring the node post-crash during commit (the crash could be caused by something else). The bug on restart stems from the long-standing issue that SDK commits are actually not-atomic. This manifested in a failure to flush the latest height when an error during commit occurs, causing the state invalidities on restart. We mitigated the non-atomicity problem by flushing the metadata about the stores that successfully committed a new height. As a result, on restart, the SDK now knows which stores/modules are already on the newly committed height.


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@p0mvn p0mvn changed the base branch from main to v6.x February 20, 2022 05:53
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2022

Codecov Report

Merging #907 (0b72ebb) into v6.x (9002356) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             v6.x     #907   +/-   ##
=======================================
  Coverage   19.06%   19.06%           
=======================================
  Files         167      167           
  Lines       23684    23684           
=======================================
  Hits         4516     4516           
  Misses      18387    18387           
  Partials      781      781           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9002356...0b72ebb. Read the comment docs.

@p0mvn p0mvn changed the title Upgrade IAVL and SDK with various imrovements for v6.4 Upgrade IAVL and SDK with RAM improvements and bug fixes for v6.4 Feb 20, 2022
@p0mvn p0mvn changed the title Upgrade IAVL and SDK with RAM improvements and bug fixes for v6.4 Upgrade IAVL and SDK with RAM improvements and bug fixes for v6.3.2 Feb 20, 2022
@p0mvn p0mvn requested a review from ValarDragon February 20, 2022 06:08
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM once two minor comments are in!

CHANGELOG.md Outdated Show resolved Hide resolved
@p0mvn p0mvn changed the title Upgrade IAVL and SDK with RAM improvements and bug fixes for v6.3.2 Upgrade IAVL and SDK with RAM improvements and bug fixes for v6.4 Feb 20, 2022
CHANGELOG.md Outdated

### SDK fork updates

- [sdk-#114](https://github.com/osmosis-labs/cosmos-sdk/pull/114) [commit](https://github.com/osmosis-labs/cosmos-sdk/pull/114/commits/7ec05684856bf87b868f67d05459d64931ac599d) upgrading iavl with ram optimizations during migration and extra logs
Copy link
Member

Choose a reason for hiding this comment

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

Ah sorry I didn't click through to the PR before, didn't realize its the bug fix. So then we just need to update this log message.

Suggested change
- [sdk-#114](https://github.com/osmosis-labs/cosmos-sdk/pull/114) [commit](https://github.com/osmosis-labs/cosmos-sdk/pull/114/commits/7ec05684856bf87b868f67d05459d64931ac599d) upgrading iavl with ram optimizations during migration and extra logs
- [sdk-#114](https://github.com/osmosis-labs/cosmos-sdk/pull/114) upgrading iavl with ram optimizations during migration and extra logs
- [commit](https://github.com/osmosis-labs/cosmos-sdk/pull/114/commits/7ec05684856bf87b868f67d05459d64931ac599d) Fix the bug when a node crashes during commit, and runs into non-logical commit issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I see what you meant

Copy link
Member

@faddat faddat left a comment

Choose a reason for hiding this comment

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

nice!

Syncing now....

@ValarDragon ValarDragon merged commit 86d1a03 into v6.x Feb 21, 2022
@ValarDragon ValarDragon deleted the roman/v6.4 branch February 21, 2022 01:47
@github-actions github-actions bot mentioned this pull request Apr 15, 2024
@github-actions github-actions bot mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants