Skip to content

Revert "feat(upgrades): implement v2.5.0 upgrade handler that modifies the stNIBI ERC20 and Bank Coin metadata in place" #2323

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

k-yang
Copy link
Contributor

@k-yang k-yang commented Jun 3, 2025

Reverts #2315

@k-yang k-yang requested a review from a team as a code owner June 3, 2025 23:10
Copy link
Contributor

coderabbitai bot commented Jun 3, 2025

📝 Walkthrough

Walkthrough

This change removes the v2.5.0 upgrade handler and its associated test suite, deletes related code and references throughout the application, and standardizes the naming of the upgrade keeper field. Minor code cleanups and comment clarifications are also included, with no changes to core logic outside the upgrade removal.

Changes

File(s) Change Summary
app/upgrades/v2_5_0/v2_5_0.go, app/upgrades/v2_5_0/v2_5_0_test.go Deleted the v2.5.0 upgrade handler implementation and its test suite.
app/upgrades.go Removed v2.5.0 upgrade import and handler; renamed UpgradeKeeper to upgradeKeeper.
app/keepers.go, app/app.go Standardized upgrade keeper field naming from UpgradeKeeper to upgradeKeeper; updated struct fields.
app/keepers/all_keepers.go Removed UpgradeKeeper field from PublicKeepers struct and related import.
CHANGELOG.md Removed changelog entry for v2.5.0 upgrade handler.
x/evm/evmtest/test_deps.go Removed NewEVMLessVerboseLogger function.
x/evm/keeper/erc20.go Removed erc20Calls.TotalSupply method.
x/evm/keeper/evm_state.go Clarified comment on EvmState.AccState primary key.
x/evm/keeper/funtoken_from_coin.go Reformatted ABI Pack call for conciseness; no logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant UpgradeHandler
    participant EVM
    participant Bank

    App->>UpgradeHandler: (Previously) Register v2.5.0 handler
    UpgradeHandler->>EVM: (Previously) Modify stNIBI ERC20 contract
    UpgradeHandler->>Bank: (Previously) Update coin metadata
    Note over App,UpgradeHandler: Now, v2.5.0 handler and flow are removed
Loading

Possibly related PRs

Suggested labels

x: evm

Suggested reviewers

  • onikonychev

Poem

A rabbit hopped through code today,
Tidying upgrades swept away.
The stNIBI tale, now in the past,
Keeper names aligned at last.
With fields renamed and tests all gone,
The blockchain's journey hops along!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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
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: 0

🧹 Nitpick comments (1)
x/evm/keeper/evm_state.go (1)

34-35: Comment clarification is helpful but could be more precise.

The updated comment correctly emphasizes the composite primary key (EthAddr + EthHash), but the phrase “because there's exactly one deployer and withdrawer” may confuse readers unfamiliar with the context. Consider rephrasing to clarify that the contract address uniquely identifies the contract’s storage namespace and the state key hash scopes individual entries, for example:

//  - primary key (PK): (EthAddr + EthHash). 
//    The contract address identifies the contract namespace, and the state key hash distinguishes its storage slots.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 38c87ca and d0bd5a1.

📒 Files selected for processing (11)
  • CHANGELOG.md (0 hunks)
  • app/app.go (2 hunks)
  • app/keepers.go (4 hunks)
  • app/keepers/all_keepers.go (0 hunks)
  • app/upgrades.go (2 hunks)
  • app/upgrades/v2_5_0/v2_5_0.go (0 hunks)
  • app/upgrades/v2_5_0/v2_5_0_test.go (0 hunks)
  • x/evm/evmtest/test_deps.go (0 hunks)
  • x/evm/keeper/erc20.go (0 hunks)
  • x/evm/keeper/evm_state.go (1 hunks)
  • x/evm/keeper/funtoken_from_coin.go (1 hunks)
💤 Files with no reviewable changes (6)
  • CHANGELOG.md
  • app/keepers/all_keepers.go
  • x/evm/keeper/erc20.go
  • x/evm/evmtest/test_deps.go
  • app/upgrades/v2_5_0/v2_5_0.go
  • app/upgrades/v2_5_0/v2_5_0_test.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
x/evm/keeper/funtoken_from_coin.go (1)
x/evm/embeds/embeds.go (1)
  • SmartContract_ERC20MinterWithMetadataUpdates (68-71)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: integration-tests
  • GitHub Check: e2e-evm
  • GitHub Check: unit-tests
  • GitHub Check: lint
🔇 Additional comments (8)
x/evm/keeper/funtoken_from_coin.go (1)

77-77: Formatting simplification is safe and clear.

Consolidating the ABI.Pack call into a single line retains the exact same arguments and logic. Given the short parameter list, readability remains high, and no functional change is introduced.

app/upgrades.go (1)

76-76: LGTM: Consistent field naming convention applied.

The renaming from UpgradeKeeper to upgradeKeeper follows Go naming conventions for unexported fields and is applied consistently across all upgrade keeper method calls.

Also applies to: 87-87, 92-92

app/app.go (2)

315-315: LGTM: Dependency injection correctly updated.

The depinject configuration properly targets the renamed upgradeKeeper field, maintaining the same initialization behavior.


495-495: LGTM: InitChainer usage updated consistently.

The SetModuleVersionMap call correctly uses the renamed upgradeKeeper field, preserving the module version initialization functionality.

app/keepers.go (4)

34-34: LGTM: Import added for upgrade keeper.

The import for upgradekeeper package is correctly added to support the new field declaration.


74-74: LGTM: Upgrade keeper field properly added to AppKeepers.

The upgradeKeeper field is correctly added as a private field to the AppKeepers struct, following Go naming conventions and improving encapsulation by moving it from PublicKeepers.


151-151: LGTM: IBC keeper initialization uses renamed field.

The IBC keeper initialization correctly references the renamed upgradeKeeper field, maintaining the same functionality.


345-345: LGTM: Governance router setup updated consistently.

The software upgrade proposal handler correctly uses the renamed upgradeKeeper field in the governance router configuration.

@k-yang
Copy link
Contributor Author

k-yang commented Jun 5, 2025

We won't have to revert this PR if we get #2324 merged, which is a hot-fix on top of the v2.5.0 upgrade handler

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.

2 participants