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

Problem: versiondb migration don't support iavl v1 #1395

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Apr 16, 2024

fixes: #1389

Solution:

  • fix changeset dump command
  • restore-app-db still restore iavl v0 db, but since iavl v1 is backward compatible, so it's fine for now.

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • New Features

    • Added a new flag to enhance version control in database dumps.
    • Introduced compatibility for inclusive end handling in version range blocks.
  • Refactor

    • Updated logic to retrieve the first version based on specific versioning standards.
    • Adjusted key format variables for database restoration.
  • Tests

    • Re-enabled an integration test for database migration.

@yihuang yihuang requested a review from a team as a code owner April 16, 2024 08:58
@yihuang yihuang requested review from mmsqe and thomas-nguy and removed request for a team April 16, 2024 08:58
Copy link
Contributor

coderabbitai bot commented Apr 16, 2024

Walkthrough

The recent updates to the versiondb focus on supporting both iavl v0 and iavl v1 formats. Changes include introducing new flags and constants, modifying functions for different iavl versions, updating key format handling, and enabling tests for iavl v1 support.

Changes

File Path Change Summary
.../client/dump.go, .../client/flags.go Added support for iavl v1, new flags, and modified functions for different iavl versions.
.../client/restore_app_db.go Updated key format variables and added constants for iavl v1 support.
integration_tests/test_versiondb.py Enabled tests for versiondb migration with iavl v1 support.

Assessment against linked issues

Objective Addressed Explanation
Support both iavl v0 and v1 in versiondb migration (#1389)

Poem

🐇 In the realm of code, where changes bloom,
Flags unfurled, dispelling gloom.
🌱 iavl v0 and v1 dance in delight,
Tests enabled, all is right.
🎉 To the developers, our gratitude flows,
For ensuring versiondb grows and glows!


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 90fc8be and b8f43e8.
Files selected for processing (4)
  • integration_tests/test_versiondb.py (1 hunks)
  • versiondb/client/dump.go (6 hunks)
  • versiondb/client/flags.go (2 hunks)
  • versiondb/client/restore_app_db.go (2 hunks)
Files skipped from review as they are similar to previous changes (4)
  • integration_tests/test_versiondb.py
  • versiondb/client/dump.go
  • versiondb/client/flags.go
  • versiondb/client/restore_app_db.go

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yihuang yihuang requested a review from a team April 16, 2024 08:58
versiondb/client/dump.go Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

integration_tests/test_versiondb.py Show resolved Hide resolved
versiondb/client/restore_app_db.go Show resolved Hide resolved
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 35.31%. Comparing base (90fc8be) to head (b8f43e8).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1395      +/-   ##
==========================================
- Coverage   35.38%   35.31%   -0.07%     
==========================================
  Files         124      124              
  Lines        9440     9458      +18     
==========================================
  Hits         3340     3340              
- Misses       5741     5759      +18     
  Partials      359      359              
Files Coverage Δ
versiondb/client/restore_app_db.go 0.00% <ø> (ø)
versiondb/client/dump.go 0.00% <0.00%> (ø)

defer itr.Close()

var version int64
for ; itr.Valid(); itr.Next() {

Check warning

Code scanning / CodeQL

Unreachable statement Warning

This statement is unreachable.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

versiondb/client/dump.go Show resolved Hide resolved
versiondb/client/dump.go Show resolved Hide resolved
fixes: crypto-org-chain#1389

Solution:
- fix changeset dump command
- restore-app-db still restore iavl v0 db, but since iavl v1 is backward
  compatible, so it's fine.

Update versiondb/client/dump.go

Signed-off-by: yihuang <[email protected]>
@yihuang yihuang added this pull request to the merge queue Apr 17, 2024
Merged via the queue into crypto-org-chain:main with commit cae2cd5 Apr 17, 2024
36 of 37 checks passed
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.

Problem: versiondb migration don't support iavl v1
2 participants