Skip to content

Conversation

@mbreithecker
Copy link
Member

@mbreithecker mbreithecker commented Aug 21, 2025

Summary by CodeRabbit

  • New Features
    • Prepared the application for the v2.2.0 network upgrade to support the upcoming upgrade flow.
  • Chores
    • Bumped app version to v2.2.0 and updated build timestamp.
    • Upgraded dependencies, including Cosmos SDK v0.50.14 and related libraries.
  • Documentation
    • Updated changelog: replaced prior Unreleased Improvements entry with a dependencies upgrade entry.

@coderabbitai
Copy link

coderabbitai bot commented Aug 21, 2025

Walkthrough

Releases metadata bumped to v2.2.0, app initialization wired to a new v2_2 upgrade package, v2_2 defines UpgradeName and a modified store loader config, and module dependencies (including Cosmos SDK) are upgraded; CHANGELOG replaced an unreleased state-machine note with a deps entry.

Changes

Cohort / File(s) Summary
Release metadata
CHANGELOG.md, Makefile
VERSION updated v2.1.0 → v2.2.0; BUILD_TIME updated; CHANGELOG replaced a state-machine breaking note with a dependencies bump entry.
Upgrade wiring
app/app.go
Switched imports and calls from upgrades/v2_1upgrades/v2_2: uses v2_2.UpgradeName, v2_2.CreateUpgradeHandler, and v2_2.CreateStoreLoader.
Upgrade v2_2 package
app/upgrades/v2_2/upgrade.go, app/upgrades/v2_2/store.go
Package renamed to v2_2; UpgradeName set to "v2.2.0"; store loader config changed (Deleted ["delegation"] → Added [""]) and returns UpgradeStoreLoader(upgradeHeight, &storeUpgrades).
Dependencies
go.mod
Bumped cosmos-sdk v0.50.12 → v0.50.14 (replace to KYVE fork v0.50.14-kyve-rc1); indirect bumps: github.com/go-chi/chi/v5 and golang.org/x/oauth2.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Node as Node/Daemon
    participant App as App (Init)
    participant Upgrade as x/upgrade Module
    participant V22 as upgrades/v2_2
    participant Store as Store Loader

    App->>Upgrade: Register UpgradeHandler(name=V22.UpgradeName, handler=V22.CreateUpgradeHandler)
    Upgrade-->>App: Handler registered

    Note over Node,Upgrade: On startup, read pending upgrade plan
    Node->>Upgrade: Query pending plan
    Upgrade-->>Node: Plan(name, height)

    alt name == V22.UpgradeName
        App->>Store: loader = V22.CreateStoreLoader(upgradeHeight)
        App->>Upgrade: SetStoreLoader(loader)
        Note right of Store: Apply store upgrades at height
    else name != V22.UpgradeName
        Note over App,Upgrade: No v2_2 actions
    end

    Note over Node,Upgrade: At upgrade height
    Upgrade->>App: Invoke v2_2 handler
    App->>V22: Execute migration
    V22-->>App: Migration complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • troykessler
  • christopherbrumm

Poem

A rabbit taps the version drum—v2.2, we run!
New upgrade paths hop into light,
Stores rearranged at the midnight height.
SDK gains a subtle shine,
Thump-thump—deploy on time! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 846004c and 57998f3.

⛔ Files ignored due to path filters (1)
  • go.work.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Summary
  • GitHub Check: test / test
🔇 Additional comments (1)
CHANGELOG.md (1)

22-22: Correct PR reference and “Cosmos SDK” styling — LGTM

The line now references PR #268 and uses the consistent “Cosmos SDK” spelling. Good fix.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mbreithecker/bump-cosmos-v50.14

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

@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

🧹 Nitpick comments (4)
go.mod (1)

380-380: Replace to KYVE fork rc1 aligns with the bump; plan to move off rc when stable is cut

The replace to v0.50.14-kyve-rc1 is consistent. Track follow-up to drop “-rc” when the final KYVE-flavored release is available.

app/upgrades/v2_2/upgrade.go (2)

18-18: Avoid global logger; keep it function-local

The file-level var logger log.Logger isn’t needed and can cause confusion in concurrent contexts. Prefer a local variable inside the handler function.

Apply this diff:

-var logger log.Logger
+// no package-level logger; use a local logger per execution context

And inside the closure:

-        logger = sdkCtx.Logger().With("upgrade", UpgradeName)
+        logger := sdkCtx.Logger().With("upgrade", UpgradeName)

25-36: Improve logging semantics and error propagation

Currently “finished upgrade” is logged even if RunMigrations returns an error. Also, string formatting with fmt isn’t needed for structured logs.

Apply this diff:

-        logger = sdkCtx.Logger().With("upgrade", UpgradeName)
-        logger.Info(fmt.Sprintf("performing upgrade %v", UpgradeName))
+        logger := sdkCtx.Logger().With("upgrade", UpgradeName)
+        logger.Info("performing upgrade")

         // Run cosmos migrations
         migratedVersionMap, err := mm.RunMigrations(ctx, configurator, fromVM)

         // Run KYVE migrations

-        logger.Info(fmt.Sprintf("finished upgrade %v", UpgradeName))
-
-        return migratedVersionMap, err
+        if err != nil {
+            logger.Error("upgrade failed", "error", err)
+            return migratedVersionMap, err
+        }
+        logger.Info("finished upgrade")
+        return migratedVersionMap, nil
Makefile (1)

7-7: Consider deriving BUILD_TIME to avoid manual edits

Not blocking, but you can make BUILD_TIME default to “now” when not set, improving DX for ad-hoc builds.

Example:

-BUILD_TIME := 202507310800.00 # format [[CC]YY]MMDDhhmm[.ss]
+BUILD_TIME ?= $(shell date -u +%Y%m%d%H%M.%S) # format [[CC]YY]MMDDhhmm[.ss]

If you need reproducible artifacts for releases, keep pinning BUILD_TIME in release pipelines.

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c530a95 and 846004c.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • CHANGELOG.md (1 hunks)
  • Makefile (1 hunks)
  • app/app.go (3 hunks)
  • app/upgrades/v2_2/store.go (2 hunks)
  • app/upgrades/v2_2/upgrade.go (2 hunks)
  • go.mod (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/app.go (3)
app/upgrades/v2_2/upgrade.go (2)
  • UpgradeName (15-15)
  • CreateUpgradeHandler (20-38)
util/expected_keepers.go (1)
  • UpgradeKeeper (57-59)
app/upgrades/v2_2/store.go (1)
  • CreateStoreLoader (9-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test / test
  • GitHub Check: lint / golangci
🔇 Additional comments (10)
go.mod (3)

149-149: Indirect chi bump is fine

Bump to github.com/go-chi/chi/v5 v5.2.2 (indirect) is low-risk. No action needed.


354-354: oauth2 indirect bump acknowledged

golang.org/x/oauth2 -> v0.27.0 is OK. Watch for transitive auth behavior changes in any cloud integrations during interchaintests.


25-25: Cosmos SDK v0.50.14 bump verified

  • No occurrences of v2_1 remain in the module graph
  • go mod tidy completed without errors
  • go mod verify confirmed all modules
app/upgrades/v2_2/upgrade.go (2)

1-1: Package rename to v2_2: LGTM

The rename is consistent with the app wiring and the new upgrade.


15-16: UpgradeName updated to v2.2.0: LGTM

Matches Makefile VERSION and intended release.

app/upgrades/v2_2/store.go (1)

1-1: Package v2_2 rename: LGTM

Consistent with the new upgrade path.

Makefile (1)

5-5: VERSION bump to v2.2.0: LGTM

Matches upgrade name and module updates.

app/app.go (3)

8-8: No lingering v2_1 references detected — upgrade to v2_2 confirmed

The ripgrep scan returned “OK: no v2_1 references found,” so the import update is complete and there are no stale v2_1 usages left. Ready to merge.


415-420: Confirm v2.2.0 upgrade plan name usage

– The upgrade handler is correctly wired to v2_2.UpgradeName and CreateUpgradeHandler.
– The constant in app/upgrades/v2_2/upgrade.go is indeed set to "v2.2.0".
– No in-repo scheduling or governance proposal code references "v2.2.0" directly.

Please ensure your on‐chain upgrade proposal (or ops tooling) uses the exact plan name "v2.2.0", otherwise the handler won’t be invoked.


427-430: Critical: Prevent mounting an empty store key in the v2_2 upgrade

The current app/upgrades/v2_2/store.go defines a single empty string in its Added list, which will cause the upgrade loader to attempt mounting a non-existent key and panic at upgrade height.

• In app/app.go (around lines 427–430), wrap the loader call so it only runs when there are real store changes:

-   if upgradeInfo.Name == v2_2.UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
-       // configure store loader that checks if version == upgradeHeight and applies store upgrades
-       app.SetStoreLoader(v2_2.CreateStoreLoader(upgradeInfo.Height))
-   }
+   if upgradeInfo.Name == v2_2.UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
+       // only configure a store loader when there are actual KV-store changes
+       if v2_2.HasStoreUpgrades() {
+           app.SetStoreLoader(v2_2.CreateStoreLoader(upgradeInfo.Height))
+       }
+   }

• In app/upgrades/v2_2/store.go, replace the placeholder empty key with truly empty slices (or populate with real keys if any stores were added/removed/renamed):

var storeUpgrades = storetypes.StoreUpgrades{
    Added:   []string{},                        // no new stores
    Deleted: []string{},                        // no deletions
    Renamed: []storetypes.StoreRename{},        // no renames
}

Verify intended store changes: run the following in your repo root to list all defined KV-store keys and confirm whether v2.2.0 actually adds/removes/renames any:

#!/bin/bash
set -euo pipefail

# find all StoreKey constants
rg -nP --type=go '\bStoreKey\s*=\s*"[^"]+"' . || true

# find all sdk.NewKVStoreKey usages
rg -nP --type=go 'sdk\.NewKVStoreKey\("([^"]+)"\)' . || true

Populate storeUpgrades with any keys you discover, or leave all lists empty if there truly are no KV-store changes.

@mbreithecker mbreithecker changed the title chore: bump cosmos v0.50.14 and others chore: bump cosmos v0.50.14 and prepare upgrade handler Aug 22, 2025
@mbreithecker mbreithecker merged commit a94dcf6 into main Aug 22, 2025
4 checks passed
@mbreithecker mbreithecker deleted the mbreithecker/bump-cosmos-v50.14 branch August 22, 2025 10:17
@coderabbitai coderabbitai bot mentioned this pull request Sep 26, 2025
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.

3 participants