8000 Feat/upgrade by sh-cha · Pull Request #381 · initia-labs/initia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat/upgrade #381

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

Merged
merged 7 commits into from
Mar 28, 2025
Merged

Feat/upgrade #381

merged 7 commits into from
Mar 28, 2025

Conversation

sh-cha
Copy link
Contributor
@sh-cha sh-cha commented Mar 28, 2025

No description provided.

@sh-cha sh-cha self-assigned this Mar 28, 2025
@sh-cha sh-cha requested a review from a team as a code owner March 28, 2025 04:50
Copy link
coderabbitai bot commented Mar 28, 2025
📝 Walkthrough

Walkthrough

This pull request updates the library version from beta to release candidate by modifying the LIBMOVEVM_VERSION in the Dockerfile and the corresponding upgradeName in the upgrade handler. The upgrade logic in app/upgrade.go is enhanced with additional error handling and parameter updates. Additionally, new CLI commands and module methods are introduced in the dynamic fee package to support querying dynamic fee parameters.

Changes

File(s) Change Summary
Dockerfile Updated LIBMOVEVM_VERSION from v1.0.0-beta.0 to v1.0.0-rc.1.
app/upgrade.go Changed upgradeName constant to v1.0.0-rc.0 and enhanced upgrade logic with upgrade info reading, error handling, and parameter updates for move/dynamic fees.
x/dynamic-fee/…/query.go
x/dynamic-fee/module.go
Introduced new CLI functions (GetQueryCmd, GetCmdQueryParams) and added a GetQueryCmd method in AppModuleBasic to query dynamic fee parameters.

Sequence Diagram(s)

sequenceDiagram
    participant U as Upgrade Handler
    participant Disk as Disk (UpgradeInfo)
    participant Keeper as UpgradeKeeper
    participant Module as Move Module
    U->>Keeper: ReadUpgradeInfoFromDisk()
    Keeper-->>U: Return Upgrade Info / Error
    U->>U: Evaluate upgrade conditions
    alt Upgrade applicable
        U->>Store: Create storeUpgrades (with dynamicfeetypes.StoreKey)
        U->>Module: Run Migrations & Update Parameters
    else
        U->>U: Skip upgrade steps
    end
Loading
sequenceDiagram
    participant User as CLI User
    participant CLI as Dynamic Fee CLI
    participant Client as Query Client
    participant Module as Dynamic Fee Module
    User->>CLI: Execute query command
    CLI->>Client: Build query client & send request
    Client->>Module: Query dynamic-fee parameters
    Module-->>Client: Return parameters
    Client-->>CLI: Deliver response
    CLI-->>User: Display parameters in protobuf format
Loading

Possibly related PRs

Suggested reviewers

  • Vritra4

Poem

I'm a bunny in a digital glade,
Hopping through code where changes are made.
From beta hops to candidate leaps,
Upgrades and CLI commands like playful peeps.
With each line updated, my heart skips a beat!
🐰💻 Hop on, code friends, the future's sweet!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 5330c27 and f59d42e.

⛔ Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (1)
  • Dockerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Dockerfile

🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

Copy link
github-actions bot commented Mar 28, 2025

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

go.mod

PackageVersionLicenseIssue Type
github.com/initia-labs/OPinit1.0.0-rc.0NullUnknown License
github.com/initia-labs/movevm1.0.0-rc.1NullUnknown License
Denied Licenses: GPL-1.0-or-later, LGPL-2.0-or-later

OpenSSF Scorecard

PackageVersionScoreDetails
gomod/github.com/initia-labs/OPinit 1.0.0-rc.0 UnknownUnknown
gomod/github.com/initia-labs/movevm 1.0.0-rc.1 UnknownUnknown

Scanned Files

  • go.mod

Copy link
@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: 0

🧹 Nitpick comments (4)
x/dynamic-fee/module.go (1)

139-143: Revise the doc comment to match the actual return
The doc currently suggests "no root query command," but the function returns a valid query command. Consider adjusting the comment to be more precise.

Apply this diff to correct the doc comment:

-// GetQueryCmd returns no root query command for the move module.
+// GetQueryCmd integrates the dynamic-fee module's query commands into the move module.
x/dynamic-fee/client/cli/query.go (2)

18-30: Add integration tests for root query command
The GetQueryCmd function sets up a command tree for dynamic-fee queries. Consider adding integration tests covering both valid and invalid scenarios to ensure reliability.


32-66: Test query params flow
The GetCmdQueryParams command logic looks correct for fetching and printing the module’s parameters. It’s recommended to add more tests or manual checks to confirm the output matches expectations under varied scenarios.

app/upgrade.go (1)

19-22: Revisit panic on failed read
Panicking on an upgrade info read error may prevent graceful handling or logging. Consider a more user-friendly approach to error handling if feasible.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76f66d4 and 5330c27.

⛔ Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (4)
  • Dockerfile (1 hunks)
  • app/upgrade.go (1 hunks)
  • x/dynamic-fee/client/cli/query.go (1 hunks)
  • x/dynamic-fee/module.go (2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
x/dynamic-fee/module.go (1)
x/dynamic-fee/client/cli/query.go (1)
  • GetQueryCmd (18-30)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Analyze (go)
  • GitHub Check: Run test and upload codecov
  • GitHub Check: golangci-lint
🔇 Additional comments (8)
Dockerfile (1)

11-11:

✅ Verification successful

Confirm reference to updated library version
This environment variable is updated to v1.0.0-rc.0. Please ensure that references to the library across the codebase are aligned and that no references remain pointing to the old version.

You can run this script to search for library version references in the repository to confirm consistency:


🏁 Script executed:

#!/bin/bash
rg "v1.0.0-beta.0|v1.0.0-rc.0" -A 2

Length of output: 268


Library version update is consistent across the codebase.
The search confirmed that all instances of the library version have been updated to v1.0.0-rc.0, including in Dockerfile (line 11) and app/upgrade.go. No lingering references to the old version (v1.0.0-beta.0) were found.

x/dynamic-fee/module.go (1)

9-17: New imports for the CLI
The additions of cobra and the local cli package are appropriate for providing a query command interface.

x/dynamic-fee/client/cli/query.go (1)

1-17: Imports for new dynamic-fee CLI
The chosen imports (Cobra, Cosmos SDK, etc.) align with implementing the new query capabilities.

app/upgrade.go (5)

6-8: Imports support upgrade mechanics
Using cosmossdk.io/errors, cosmossdk.io/math, and storetypes provides enhanced error handling, math utilities, and store upgrade capabilities.


11-12: Dynamic-fee store import
Importing the dynamic-fee module's types is necessary for referencing the store key in the upgrade steps.


15-15: Upgrade name set to release candidate
The updated constant v1.0.0-rc.0 matches the Dockerfile’s version change, ensuring consistency.


24-33: Conditional store upgrade loader
The logic to add the dynamic-fee store key if the upgrade is not skipped appears correct and aligns with the new release candidate.


38-55: Validate zero gas price and fee parameter changes
Setting BaseMinGasPrice and the dynamic fee MaxChangeRate to zero effectively disables incremental fee increases. Confirm this is the desired behavior.

Would you like a helper script to search for downstream references to these parameters to ensure no unintended side effects occur?

Copy link
codecov bot commented Mar 28, 2025

Codecov Report

Attention: Patch coverage is 1.40845% with 70 lines in your changes missing coverage. Please review.

Project coverage is 39.86%. Comparing base (76f66d4) to head (f59d42e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
x/dynamic-fee/client/cli/query.go 0.00% 41 Missing ⚠️
app/upgrade.go 3.33% 27 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #381      +/-   ##
==========================================
- Coverage   39.96%   39.86%   -0.10%     
==========================================
  Files         292      293       +1     
  Lines       27141    27210      +69     
==========================================
+ Hits        10846    10847       +1     
- Misses      14621    14687      +66     
- Partials     1674     1676       +2     
Files with missing lines Coverage Δ
app/upgrade.go 11.76% <3.33%> (-38.24%) ⬇️
x/dynamic-fee/client/cli/query.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member
@beer-1 beer-1 left a comment

Choose a reason for hiding this comment

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

LGTM

@beer-1 beer-1 merged commit 5b7f769 into main Mar 28, 2025
7 checks passed
@beer-1 beer-1 deleted the feat/upgrade branch March 28, 2025 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
43D9
Development

Successfully merging this pull request may close these issues.

2 participants
0