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 the snapshot sync for v2 store #18

Closed
wants to merge 49 commits into from
Closed

Conversation

gsk967
Copy link

@gsk967 gsk967 commented Dec 9, 2021

Description

State Sync for V2 Store (ADR 40)

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)

Copy link
Collaborator

@roysc roysc left a comment

Choose a reason for hiding this comment

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

Looks pretty solid now, only one change

store/v2/root/snapshot_test.go Outdated Show resolved Hide resolved
@gsk967
Copy link
Author

gsk967 commented Dec 14, 2021

@roysc I address the pr comments, Can you please look into the last commit

@gsk967 gsk967 requested a review from roysc December 14, 2021 08:46
@gsk967
Copy link
Author

gsk967 commented Dec 14, 2021

@roysc I addressed the pr comments

@gsk967 gsk967 requested a review from roysc December 14, 2021 13:39
// checking snapshot restoring for store with existed schema and without existed versions
target3 := newMultiStore(t, memdb.NewDB(), 4)
// checking snapshot restoring for store with existed schema and without existing versions
target3 := newMultiStore(t, memdb.NewDB(), 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be non-zero, and the above 0

Copy link
Author

Choose a reason for hiding this comment

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

sorry , i will fix

@gsk967 gsk967 requested a review from roysc December 14, 2021 13:48
Copy link
Collaborator

@roysc roysc left a comment

Choose a reason for hiding this comment

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

LGTM

@gsk967 gsk967 marked this pull request as ready for review December 14, 2021 13:52
Copy link
Collaborator

@i-norden i-norden left a comment

Choose a reason for hiding this comment

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

A few nit-picky things to change, otherwise looks great!

"bufio"
"compress/zlib"
"fmt"
prefixdb "github.com/cosmos/cosmos-sdk/db/prefix"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's order these imports

std lib

external deps

local deps

store/v2/root/snapshot.go Show resolved Hide resolved
store/v2/root/snapshot_test.go Show resolved Hide resolved
@gsk967 gsk967 changed the base branch from roysc/adr-040-create-rootstore to master December 16, 2021 13:14
@i-norden
Copy link
Collaborator

Hey @gsk967 , we don't want to merge this into our master branch as we want that branch to be tracking the root repo's master branch. I'm not sure what branch we should merge into, @roysc what are your thoughts? Also, when you get the chance please address my minor review comments. Thanks!

@gsk967
Copy link
Author

gsk967 commented Dec 16, 2021

@i-norden I created new pull request (cosmos#10794) to cosmos-sdk master branch

Can i close this pull request and I already added your comment changes to pull request

@i-norden
Copy link
Collaborator

@gsk967 perfect, thanks! Yeah let's close this.

@i-norden i-norden closed this Dec 16, 2021
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.

3 participants