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

IBC v9 #293

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

IBC v9 #293

wants to merge 8 commits into from

Conversation

faddat
Copy link
Contributor

@faddat faddat commented Dec 4, 2024

  • build(deps): bump github.com/cometbft/cometbft in the go_modules group
  • tidy
  • golang 23
  • update ibc to v9

Summary by CodeRabbit

Release Notes

  • New Features

    • Upgraded the IBC module from version 8 to version 9, enhancing inter-blockchain communication capabilities.
  • Bug Fixes

    • Resolved potential compatibility issues by updating various dependencies to their latest versions.
  • Documentation

    • Updated import paths for modules to reflect the transition to the new IBC version, ensuring clarity in module usage.

dependabot bot and others added 6 commits November 6, 2024 15:47
Bumps the go_modules group with 1 update: [github.com/cometbft/cometbft](https://github.com/cometbft/cometbft).


Updates `github.com/cometbft/cometbft` from 0.38.12 to 0.38.15
- [Release notes](https://github.com/cometbft/cometbft/releases)
- [Changelog](https://github.com/cometbft/cometbft/blob/v0.38.15/CHANGELOG.md)
- [Commits](cometbft/cometbft@v0.38.12...v0.38.15)

---
updated-dependencies:
- dependency-name: github.com/cometbft/cometbft
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <[email protected]>
Copy link
Contributor

coderabbitai bot commented Dec 4, 2024

Walkthrough

The pull request involves upgrading the IBC module from version 8 to version 9 across multiple files in the application. This includes modifications to import statements for various IBC-related packages, ensuring that the application relies on the latest version. While the overall structure and logic of the code remain unchanged, the updates may affect the underlying functionality of components that depend on the IBC module. The changes also include updates to the go.mod file to reflect the new dependency versions.

Changes

File Change Summary
app/ante/ante.go Updated import paths for ibcante and keeper from v8 to v9. HandlerOptions and decorators unchanged.
app/ante/suite.go Updated import paths for transferkeeper, channelkeeper, and portkeeper from v8 to v9.
app/app.go Updated import paths for various modules (e.g., ica, ibcfee, transfer) from v8 to v9.
app/test_support.go Updated import path for ibckeeper from v8 to v9.
app/upgrades/types.go Updated import path for ibckeeper from v8 to v9.
go.mod Updated multiple dependencies, notably upgrading github.com/cosmos/ibc-go from v8.4.0 to v9.0.1 and other indirect dependencies.

Possibly related PRs

  • fix: Fee market blackberry #277: This PR modifies the HandlerOptions struct and the NewAnteHandler function in app/ante/ante.go, which are also key areas of change in the main PR that involves the IBC module upgrade. The changes in both PRs relate to the handling of transaction processing and decorators, indicating a direct connection in their functionality.

Suggested labels

dependencies, go

Suggested reviewers

  • hoank101

🐰 In the land of code where rabbits play,
We’ve upgraded IBC to a brighter day!
With paths now pointing to version nine,
Our imports are fresh, everything's fine!
Hopping along, we’ll test and deploy,
A leap into the future, oh what joy! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4903702 and 19ebd6c.

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

53-53: IBC-Go v9 Upgrade Impact

The upgrade from IBC-Go v8 to v9 is a major version change that requires careful verification of compatibility.

#!/bin/bash
# Description: Verify IBC-Go v9 migration completeness

# Check for any remaining v8 imports
rg -l 'github.com/cosmos/ibc-go/v8'

# Look for IBC-related type changes
ast-grep --pattern 'ibc.$$$'

72-73: DataDog Major Version Update

The DataDog client library has been upgraded from v3 to v4.

#!/bin/bash
# Description: Check DataDog integration points

# Search for DataDog usage
rg -l 'datadog'

# Look for DataDog client initialization
ast-grep --pattern 'NewClient($$$)'

Line range hint 222-249: Review Replace Directives

The replace directives include several security-related overrides and temporary fixes.

Key points to verify:

  1. The jwt-go replacement addresses security concerns
  2. The gin replacement fixes a vulnerability
  3. The goleveldb version is pinned due to store query issues

Consider documenting these replace directives with comments explaining their necessity and tracking tickets for their removal when possible.


193-193: ⚠️ Potential issue

Avoid Alpha Version of BBolt

Using bbolt v1.4.0-alpha.1 in production could introduce instability.

Consider pinning to the latest stable version (v1.3.x) unless specific alpha features are required.


60-64: Update Google Cloud Dependencies

Multiple Google Cloud dependencies have been updated. Ensure all Google Cloud integrations continue to function as expected.

Also applies to: 210-213


Line range hint 3-3: Verify Go 1.23 compatibility across the codebase

The Go version has been updated to 1.23. This is a significant change that requires verification of compatibility with all dependencies and build processes.


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>, 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 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.

@faddat faddat mentioned this pull request Dec 4, 2024
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: 4

🧹 Outside diff range and nitpick comments (2)
app/app.go (1)

Line range hint 269-272: Consider Updating FinalizeBlock Implementation

The FinalizeBlock method includes a workaround related to the migration of consensus parameters. With the SDK upgrades, verify if this workaround is still necessary or if it can be removed.

Ensure that the migration logic aligns with the current SDK version and remove any deprecated or unnecessary code.

🧰 Tools
🪛 GitHub Check: lint

[failure] 47-47:
could not import github.com/eve-network/eve/app/ante (-: # github.com/eve-network/eve/app/ante

🪛 golangci-lint (1.62.2)

47-47: could not import github.com/eve-network/eve/app/ante (-: # github.com/eve-network/eve/app/ante
app/ante/suite.go:108:144: cannot use transferkeeper.Keeper{} (value of type "github.com/cosmos/ibc-go/v9/modules/apps/transfer/keeper".Keeper) as "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper".Keeper value in argument to feeabskeeper.NewKeeper
app/ante/suite.go:108:169: cannot use channelkeeper.Keeper{} (value of type "github.com/cosmos/ibc-go/v9/modules/core/04-channel/keeper".Keeper) as "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper".Keeper value in argument to feeabskeeper.NewKeeper
app/ante/suite.go:108:193: cannot use &portkeeper.Keeper{} (value of type *"github.com/cosmos/ibc-go/v9/modules/core/05-port/keeper".Keeper) as *"github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper".Keeper value in argument to feeabskeeper.NewKeeper)

(typecheck)

go.mod (1)

94-94: Remove Unused IBC-Go v8 Dependency

The github.com/cosmos/ibc-go/v8 dependency is still listed indirectly. Since the project has been updated to use IBC-Go v9, consider removing any lingering references to v8.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8a5125e and 4903702.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • app/ante/ante.go (1 hunks)
  • app/ante/suite.go (1 hunks)
  • app/app.go (1 hunks)
  • app/test_support.go (1 hunks)
  • app/upgrades/types.go (1 hunks)
  • go.mod (8 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/upgrades/types.go
🔇 Additional comments (18)
app/app.go (3)

Line range hint 210-213: Update Proto Annotations Validation

The msgservice.ValidateProtoAnnotations function is called, but with the upgrade to Cosmos SDK v0.50.x, the method signature or behavior might have changed. Please verify that the function usage is still correct with the new SDK version.

Check the SDK documentation or source code to confirm if any changes are required for msgservice.ValidateProtoAnnotations.

🧰 Tools
🪛 GitHub Check: lint

[failure] 47-47:
could not import github.com/eve-network/eve/app/ante (-: # github.com/eve-network/eve/app/ante

🪛 golangci-lint (1.62.2)

47-47: could not import github.com/eve-network/eve/app/ante (-: # github.com/eve-network/eve/app/ante
app/ante/suite.go:108:144: cannot use transferkeeper.Keeper{} (value of type "github.com/cosmos/ibc-go/v9/modules/apps/transfer/keeper".Keeper) as "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper".Keeper value in argument to feeabskeeper.NewKeeper
app/ante/suite.go:108:169: cannot use channelkeeper.Keeper{} (value of type "github.com/cosmos/ibc-go/v9/modules/core/04-channel/keeper".Keeper) as "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper".Keeper value in argument to feeabskeeper.NewKeeper
app/ante/suite.go:108:193: cannot use &portkeeper.Keeper{} (value of type *"github.com/cosmos/ibc-go/v9/modules/core/05-port/keeper".Keeper) as *"github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper".Keeper value in argument to feeabskeeper.NewKeeper)

(typecheck)


Line range hint 386-392: Review AnteHandler Configuration

While updating the IBC modules to v9, confirm that the ante.NewAnteHandler function and its options are compatible with the new versions. Pay special attention to any changes in the ante handler requirements for IBC transactions.

Check the ante handler setup against the IBC-Go v9 documentation to ensure all necessary options are correctly configured.

🧰 Tools
🪛 GitHub Check: lint

[failure] 47-47:
could not import github.com/eve-network/eve/app/ante (-: # github.com/eve-network/eve/app/ante

🪛 golangci-lint (1.62.2)

47-47: could not import github.com/eve-network/eve/app/ante (-: # github.com/eve-network/eve/app/ante
app/ante/suite.go:108:144: cannot use transferkeeper.Keeper{} (value of type "github.com/cosmos/ibc-go/v9/modules/apps/transfer/keeper".Keeper) as "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper".Keeper value in argument to feeabskeeper.NewKeeper
app/ante/suite.go:108:169: cannot use channelkeeper.Keeper{} (value of type "github.com/cosmos/ibc-go/v9/modules/core/04-channel/keeper".Keeper) as "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper".Keeper value in argument to feeabskeeper.NewKeeper
app/ante/suite.go:108:193: cannot use &portkeeper.Keeper{} (value of type *"github.com/cosmos/ibc-go/v9/modules/core/05-port/keeper".Keeper) as *"github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper".Keeper value in argument to feeabskeeper.NewKeeper)

(typecheck)


26-45: Ensure Compatibility with IBC-Go v9 APIs

The import paths for IBC modules have been updated from v8 to v9. Please verify that the code uses the updated APIs and accounts for any breaking changes introduced in IBC-Go v9.

Run the following script to check for deprecated or changed methods in the codebase:

✅ Verification successful

Let's analyze the actual usage of IBC-Go v9 APIs in the codebase to verify compatibility.


This will help us verify the IBC-Go v9 integration and any potential compatibility issues.


IBC-Go v9 Integration Appears Compatible

The codebase shows proper integration with IBC-Go v9, with all the necessary middleware configurations and correct usage of v9 APIs:

  • All imports correctly reference ibc-go/v9 modules
  • Proper middleware stack setup using v9's patterns (ICA, fee, transfer)
  • Correct router configuration and service registration
  • No deprecated API usage detected

Note: While there is an indirect dependency on ibc-go/v8 in go.mod, this appears to be from a transitive dependency and doesn't affect the direct v9 usage in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of deprecated or changed IBC-Go v8 APIs that need updates for v9.

# Search for known deprecated functions in IBC-Go v9
rg --multiline --fixed-strings --glob "*.{go}" '
InitGenesis|
ExportGenesis|
HandleMsg|
OnRecvPacket|
OnAcknowledgementPacket|
OnTimeoutPacket
'

Length of output: 146


Script:

#!/bin/bash
# Let's check for any IBC-related function calls and implementations to verify compatibility
ast-grep --pattern 'func $$$($$$) {
  $$$
}'  | rg -A 5 "ibc|Ibc|IBC"

# Also search for any IBC-related struct definitions and interface implementations
ast-grep --pattern 'type $_ struct {
  $$$
}' | rg -A 5 "ibc|Ibc|IBC"

# Search for IBC module initialization and configuration
rg -g "*.go" "New.*Keeper|ConfigureIBC|InitIBC"

Length of output: 13405


Script:

#!/bin/bash
# Let's check for specific IBC-Go v9 API usage patterns
rg -g "*.go" "v9/modules" -B 2 -A 2

# Check for IBC middleware setup and configuration
rg -g "*.go" "NewIBCMiddleware|SetRouter|RegisterServices" -B 2 -A 2

# Look for any go.mod references to ibc-go versions
cat go.mod | rg "ibc-go"

Length of output: 6245

app/test_support.go (1)

5-5: Ensure Test Compatibility with IBC-Go v9

The import path for ibckeeper has been updated to v9. Verify that all test cases in this file are compatible with the IBC-Go v9 API and that any changes in the keeper's methods are accounted for.

Review the test implementations for any deprecated methods or changed behaviors due to the upgrade.

app/ante/suite.go (1)

7-9: ⚠️ Potential issue

Verify IBC Transfer, Channel, and Port Keepers with v9

The import paths for transferkeeper, channelkeeper, and portkeeper have been updated to v9. Ensure that the mocked keepers in the tests correctly simulate the behavior of the v9 modules.

Check for any changes in the interfaces of these keepers and update the mocks accordingly to prevent test failures.

If the interfaces have changed, the mocks must be updated to implement the new methods.

app/ante/ante.go (1)

4-5: ⚠️ Potential issue

Update AnteHandler for IBC-Go v9

The import paths for ibcante and keeper have been updated to v9. Verify that the ante decorators used are compatible with IBC-Go v9 and that any required changes in the ante handler are implemented.

Ensure that ibcante.NewRedundantRelayDecorator and any other IBC-related ante decorators are updated per the IBC-Go v9 specifications.

Review the IBC-Go v9 release notes for any changes affecting ante handler setup.

go.mod (12)

28-28: Update google.golang.org/genproto Dependency

The google.golang.org/genproto dependency has been updated to a newer version. Ensure that this does not introduce any breaking changes to the generated protobuf code used in the project.

Test the codebase to confirm that the updated genproto version is compatible.


61-65: Review Updates to Cloud Dependencies

Several cloud.google.com/go dependencies have been updated. Verify that these updates are compatible and do not introduce breaking changes affecting cloud integrations.

Run integration tests for any cloud-related functionality to confirm compatibility.


81-81: Update github.com/cenkalti/backoff/v4 Dependency

The backoff library has been updated. Verify that any usage of this library in the code conforms to the updated API.

Check for changes in method signatures or behaviors introduced in the new version.


86-86: Update github.com/cockroachdb/fifo Dependency

The fifo package from CockroachDB has been updated. Ensure that any usage of this package is compatible with the new version.

Review the changelog for any breaking changes or deprecations.


110-110: Update github.com/getsentry/sentry-go Dependency

The Sentry SDK has been updated. Verify that error reporting and event tracking remain functional with the new version.

Test Sentry integrations to ensure events are correctly reported.


130-130: Update github.com/googleapis/gax-go/v2 Dependency

The Google API extensions for Go have been updated. Check for any changes that might affect API client code.

Review any Google API client implementations for compatibility.


137-140: Update HashiCorp Dependencies

Multiple HashiCorp packages have been updated. Verify that these updates do not introduce breaking changes in plugins or logging mechanisms used in the application.

Ensure that any HashiCorp integrations, especially those related to plugins, function correctly with the updated libraries.


147-147: Update github.com/hdevalence/ed25519consensus Dependency

The ed25519consensus package has been updated to v0.2.0. Confirm that cryptographic operations using this library remain secure and function as intended.

Run cryptographic unit tests to validate the update.


158-158: Update github.com/linxGnu/grocksdb Dependency

The RocksDB Go wrapper has been updated. If RocksDB is used for storage, ensure that database operations are not affected.

Test database read/write operations to confirm stability.


203-211: Update Go Standard Library Dependencies

Several golang.org/x packages have been updated. Ensure that these updates are compatible and do not introduce breaking changes.

Review the codebase for usage of these packages and test affected functionality.


211-211: Update google.golang.org/api Dependency

The Google API client library has been updated. Verify that all Google API interactions remain functional.

Run integration tests for Google API services used by the application.


218-218: Update nhooyr.io/websocket Dependency

The WebSocket library has been updated. If WebSockets are used, ensure that connections and message handling are not disrupted.

Test WebSocket connections for stability and correctness.

@@ -50,53 +50,55 @@ require (
github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240530162148-4827cf263165
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.2.1-0.20240523101951-4b45d1822fb6
github.com/cosmos/ibc-go/v8 v8.4.0
github.com/cosmos/ibc-go/v9 v9.0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Upgrade to IBC-Go v9 Dependency

The github.com/cosmos/ibc-go/v9 module has been added, replacing v8. Confirm that all modules and code depending on IBC-Go have been updated appropriately.

Ensure that the codebase reflects all necessary changes due to the major version upgrade to avoid runtime errors.

Comment on lines +73 to 74
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Major Version Update for DataDog Dependency

The github.com/DataDog/datadog-go package has been updated from v3 to v4. This major version change may include breaking changes.

Review the DataDog integration code to ensure compatibility with v4. Update the code if necessary.

@@ -119,30 +121,30 @@
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/flatbuffers v24.3.25+incompatible // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update github.com/google/flatbuffers Dependency

The flatbuffers package has a significant version change. Confirm compatibility and verify that serialization/deserialization processes work as expected.

Test all functionalities relying on FlatBuffers to ensure data integrity.

@@ -189,7 +191,7 @@
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
go.etcd.io/bbolt v1.4.0-alpha.1 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update go.etcd.io/bbolt Dependency

The bbolt database package has been updated to an alpha version. Using alpha versions may introduce instability.

Consider pinning to a stable release unless alpha features are required. Test database interactions thoroughly.

@faddat
Copy link
Contributor Author

faddat commented Dec 4, 2024

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.

1 participant