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: update store module for new iavl #15568

Merged
merged 27 commits into from
Jun 6, 2023
Merged

feat: update store module for new iavl #15568

merged 27 commits into from
Jun 6, 2023

Conversation

cool-develope
Copy link
Contributor

Description

Closes: #XXXX


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)

@cool-develope cool-develope requested a review from a team as a code owner March 28, 2023 12:49
@cool-develope cool-develope marked this pull request as draft March 28, 2023 12:49
@github-prbot github-prbot requested review from a team, facundomedica and likhita-809 and removed request for a team March 28, 2023 12:50
@github-actions

This comment has been minimized.

@kocubinski kocubinski self-assigned this Mar 28, 2023
@cool-develope cool-develope marked this pull request as ready for review March 29, 2023 20:42
@github-prbot github-prbot requested a review from a team March 29, 2023 20:42
store/iavl/store.go Outdated Show resolved Hide resolved
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

before merging this we need an issue on how to do migrations

Copy link
Contributor

@elias-orijtech elias-orijtech left a comment

Choose a reason for hiding this comment

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

LGTM apart from nits.

store/pruning/manager.go Show resolved Hide resolved
store/rootmulti/store_test.go Outdated Show resolved Hide resolved
@tac0turtle
Copy link
Member

build doesnt pass

@tac0turtle
Copy link
Member

tac0turtle commented Apr 17, 2023

waiting to merge this until we have migrations tested as this merge would signify the adoption of this in the Eden release

Copy link
Collaborator

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

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

Thank you for this change @cool-develope, I've added my first round of review, please take a look.

store/pruning/manager.go Outdated Show resolved Hide resolved
store/pruning/manager.go Outdated Show resolved Hide resolved
@tac0turtle tac0turtle added the S:blocked Status: Blocked label Apr 25, 2023
@github-actions github-actions bot added C:CLI C:collections C:Confix Issues and PR related to Confix C:Cosmovisor Issues and PR related to Cosmovisor C:Hubl Tool: Hubl C:Keys Keybase, KMS and HSMs labels Apr 26, 2023
@github-actions github-actions bot added C:Confix Issues and PR related to Confix C:Cosmovisor Issues and PR related to Cosmovisor C:Rosetta Issues and PR related to Rosetta labels May 30, 2023

// "restart"
ms = newMultiStoreWithMounts(db, pruningtypes.NewCustomPruningOptions(2, 11))
ms.SetSnapshotInterval(3)
Copy link
Member

Choose a reason for hiding this comment

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

i think we should still keep this so we dont break pruning dependence on snapshot intervals

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now, the snapshot interval doesn't affect the pruning strategy if we don't call HandleHeightSnapshot.

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

Looks good. Been running this on juno for a week now

@tac0turtle
Copy link
Member

lets resolve the conflicts then we can merge this

baseapp/options.go Show resolved Hide resolved
- Remov `DeleteVersion`, `DeleteVersions`, `LazyLoadVersionForOverwriting` from `iavl` tree API.
- Add `DeleteVersionsTo` and `SaveChangeSet`, since it will keep versions sequentially like `fromVersion` to `toVersion`.
- Refactor the pruning manager to use `DeleteVersionsTo`.
- Remove `IAVLLazyLoading` option from baseapp.
Copy link
Member

Choose a reason for hiding this comment

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

This one should be in the main changelog ./CHANGELOG.md instead of under store/CHANGELOG.md

TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error
SaveChangeSet(changeSet *iavl.ChangeSet) (int64, error)
Copy link
Member

@julienrbrt julienrbrt Jun 3, 2023

Choose a reason for hiding this comment

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

This comment is still unimplemented.

if err != nil {
return err
// Consider the snapshot height
pruneHeight := height - 1 - int64(m.opts.KeepRecent) // we should keep the current height at least
Copy link
Member

Choose a reason for hiding this comment

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

What if pruneHeight gets negative?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will be checked in PruneStores when pruning in rootmulti

store/go.mod Outdated
@@ -10,7 +10,7 @@ require (
github.com/cometbft/cometbft v0.38.0-alpha.2
github.com/cosmos/cosmos-db v1.0.0
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/iavl v0.21.0
github.com/cosmos/iavl v1.0.0-beta.1
Copy link
Member

Choose a reason for hiding this comment

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

nit, use v1.0.0-beta.2

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

utACK, few nits

@alexanderbez
Copy link
Contributor

Let's get @julienrbrt's suggestions in and we can merge. The conflicts should be trivial to resolve.

@github-actions github-actions bot added the C:Hubl Tool: Hubl label Jun 6, 2023
@cool-develope cool-develope added this pull request to the merge queue Jun 6, 2023
Merged via the queue into main with commit 3e18f40 Jun 6, 2023
@cool-develope cool-develope deleted the store/new_iavl branch June 6, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:Confix Issues and PR related to Confix C:Cosmovisor Issues and PR related to Cosmovisor C:Hubl Tool: Hubl C:Rosetta Issues and PR related to Rosetta C:Store C:x/circuit C:x/evidence C:x/feegrant C:x/nft C:x/upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants