Skip to content

feat(ibc)!: ibc-go v10 is not supported #1804

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 43 commits into
base: main
Choose a base branch
from

Conversation

JayT106
Copy link
Contributor

@JayT106 JayT106 commented May 17, 2025

Integrated ibc-go v10.1.1
For the integration tests, using hermes relayer 1.13.1 instead of the customized ibc-go-relayer. So the relayer precompiled contract and the ica precompiled contract will not working with the hermes relayer.

ref #1731

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
    • Support for IBC-Go v10 with updated protobufs and new IBC v2 protocol features.
    • Enhanced token handling in EVM contracts and events supporting denomination traces and multiple tokens per packet.
    • Added Cosmos token structures in Solidity and Go contract bindings.
  • Breaking Changes
    • Removal of IBC fee module (ICS29) and incentivized transfer features.
    • Channel upgrade functionality and related queries/transactions removed.
    • Major API changes in IBC transfer, channel, and client modules with renamed or removed protobuf messages and services.
    • Incentivized transfer and fee-related IBC tests are now skipped or disabled.
  • Improvements
    • Relayer event logs now use structured tokens for better traceability.
    • Dependency upgrades including Go 1.23 and updated Hermes relayer binary.
  • Bug Fixes
    • Fixed denom trace handling and event decoding in IBC transfers.
  • Chores
    • Updated build and Nix configurations.
    • Removed deprecated code, tests, and protobuf files.
  • Documentation
    • Updated changelog with state machine breaking changes due to IBC-Go v10 upgrade.

@JayT106 JayT106 self-assigned this May 17, 2025
Copy link
Contributor

coderabbitai bot commented May 17, 2025

Walkthrough

This change upgrades the IBC-Go dependency from v8 to v10, removes the IBC fee and capability modules, and adapts the codebase to the new IBC-Go APIs. It updates protobuf definitions, removes related fee logic, adjusts middleware and relayer contracts, and revises integration tests and configuration for compatibility with the upgraded IBC protocol.

Changes

File(s) / Group Change Summary
app/app.go, app/sim_test.go, app/upgrades.go, app/upgrades_test.go, app/versiondb.go, app/versiondb_placeholder.go Remove IBC fee/capability modules, memory store keys, and related logic; update to IBC-Go v10; update upgrade handler logic; remove expedited governance param upgrade code and tests.
cmd/cronosd/cmd/versiondb.go, versiondb/client/restore_app_db.go, versiondb/client/verify.go, versiondb/go.mod Remove capability module references and memory store key handling from versiondb logic.
default.nix, flake.nix, nix/build_overlay.nix, nix/default.nix, nix/hermes.nix, nix/sources.json, gomod2nix.toml Update package versions, overlays, and sources for Go 1.23.6, Hermes, and other dependencies; switch Hermes to prebuilt binary and update source repo.
go.mod, proto/buf.yaml, third_party/proto/buf.yaml Upgrade Go module and dependency versions, including Cosmos SDK and IBC-Go v10.
integration_tests/configs/ibc_timeout.jsonnet, integration_tests/configs/ibc_timeout_hermes.jsonnet, integration_tests/configs/upgrade-test-package.nix Update IBC test configs for feegrants and upgrade plan naming.
integration_tests/cosmoscli.py, integration_tests/ibc_utils.py, integration_tests/test_ibc.py, integration_tests/test_ibc_rly.py, integration_tests/test_ibc_rly_gas.py, integration_tests/test_ibc_timeout.py, integration_tests/test_ibc_update_client.py, integration_tests/test_ica.py, integration_tests/test_ica_incentivized.py, integration_tests/test_ica_precompile.py, integration_tests/test_upgrade.py Update integration tests for IBC-Go v10, Hermes relayer, fee module removal, and protocol changes; skip or adjust unsupported tests.
proto/cronos/query.proto, proto/cronos/tx.proto, proto/e2ee/genesis.proto, proto/e2ee/query.proto, proto/e2ee/tx.proto, proto/memiavl/changeset.proto, proto/memiavl/wal.proto Minor formatting and whitespace changes in protobuf files.
third_party/proto/ethermint/evm/v1/query.proto, third_party/proto/ethermint/evm/v1/tx.proto Add/rename fields for EVM txs (add raw, deprecate hash).
third_party/proto/ibc/applications/fee/v1/ack.proto, third_party/proto/ibc/applications/fee/v1/fee.proto, third_party/proto/ibc/applications/fee/v1/genesis.proto, third_party/proto/ibc/applications/fee/v1/metadata.proto, third_party/proto/ibc/applications/fee/v1/query.proto, third_party/proto/ibc/applications/fee/v1/tx.proto Remove all ICS29 IBC fee module protobuf definitions.
third_party/proto/ibc/applications/interchain_accounts/... (multiple files) Update go_package options to v10.
third_party/proto/ibc/applications/transfer/v1/... (multiple files) Redesign denom tracing: add token.proto, update queries, remove DenomTrace, introduce Denom/Token/Hop messages, update service methods.
third_party/proto/ibc/core/channel/v1/..., third_party/proto/ibc/core/channel/v2/... Remove channel upgrade proto definitions and related fields; add v2 channel proto files for new packet/message/query types.
third_party/proto/ibc/core/client/v1/..., third_party/proto/ibc/core/client/v2/... Remove deprecated client upgrade proposals, add v2 client proto files for counterparty/config, update queries and messages.
third_party/proto/ibc/core/commitment/v1/commitment.proto, third_party/proto/ibc/core/commitment/v2/commitment.proto Remove v1 MerklePath, add v2 MerklePath with bytes key path.
third_party/proto/ibc/lightclients/localhost/v2/localhost.proto Remove localhost v2 client proto.
x/cronos/client/cli/tx.go, x/cronos/keeper/keeper.go, x/cronos/keeper/precompiles/relayer.go, x/cronos/middleware/conversion_middleware.go, x/cronos/types/interfaces.go Remove IBC fee logic, update interfaces and keeper/middleware for IBC-Go v10, update denom/trace handling and method signatures.
x/cronos/events/bindings/cosmos/lib/cosmos_types.abigen.go, x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_module.abigen.go, x/cronos/events/bindings/src/CosmosTypes.sol, x/cronos/events/bindings/src/Relayer.sol, x/cronos/events/decoders.go Update EVM/Cosmos event bindings and Solidity contracts for new denom/token structure, remove fee and denom trace event logic.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant IBC-Go v10
    participant RelayerContract
    participant Middleware
    participant Keeper

    App->>IBC-Go v10: Initialize IBC modules (no fee/capability modules)
    App->>Middleware: Set up conversion middleware (v10 API)
    RelayerContract->>IBC-Go v10: Relay IBC packets (no fee registration)
    Middleware->>Keeper: Handle OnRecvPacket/OnAcknowledgement/OnTimeout (with new version param)
    Keeper->>Middleware: Process packet, convert tokens (new denom/trace structure)
    Middleware->>IBC-Go v10: Return ack/errors as needed
Loading

Possibly related PRs

  • crypto-org-chain/cronos#1665: Adds support for registering payees/counterparty payees in the relayer precompile; this PR removes that logic, making them directly related but with opposite effects.
  • crypto-org-chain/cronos#1623: Adds expedited governance parameter upgrade logic and tests, which this PR removes, making them directly related and opposite in scope.
  • crypto-org-chain/cronos#1782: Modifies memory store key handling in App; this PR removes memory store keys entirely, making the changes directly related but with opposing intent.

Suggested reviewers

  • leejw51crypto
  • mmsqe

Poem

Upgrading the chain, we leap and we bound,
Old fee and mem keys are nowhere to be found.
Hops and denoms now neatly in place,
IBC v10 sets a brisker pace!
Solidity and Go, in harmony sing,
As rabbits rejoice in the changes we bring.
🐇✨

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

@JayT106 JayT106 requested review from yihuang, mmsqe and thomas-nguy May 17, 2025 02:05
Copy link

socket-security bot commented May 17, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert (click for details)
Warn Critical
golang/github.com/gofiber/fiber/[email protected] has a Critical CVE.

CVE: GHSA-98j2-3j3p-fw2v Session Middleware Token Injection Vulnerability (CRITICAL)

Affected versions: < 2.52.5

Patched version: 2.52.5

From: go.modgolang/github.com/gofiber/fiber/[email protected]

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore golang/github.com/gofiber/fiber/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copy link

codecov bot commented May 17, 2025

Codecov Report

Attention: Patch coverage is 12.19512% with 108 lines in your changes missing coverage. Please review.

Project coverage is 35.75%. Comparing base (a3c2f70) to head (f5ae7d7).
Report is 81 commits behind head on main.

Files with missing lines Patch % Lines
x/cronos/middleware/conversion_middleware.go 0.00% 50 Missing ⚠️
x/cronos/events/decoders.go 0.00% 35 Missing ⚠️
.../events/bindings/cosmos/lib/cosmos_types.abigen.go 0.00% 12 Missing ⚠️
x/cronos/keeper/precompiles/utils.go 0.00% 5 Missing ⚠️
x/cronos/keeper/precompiles/relayer.go 25.00% 3 Missing ⚠️
versiondb/client/verify.go 0.00% 1 Missing ⚠️
x/cronos/keeper/keeper.go 0.00% 1 Missing ⚠️
x/cronos/keeper/mock/ibckeeper_mock.go 91.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1804       +/-   ##
===========================================
+ Coverage   16.87%   35.75%   +18.88%     
===========================================
  Files          72      127       +55     
  Lines        6163    11801     +5638     
===========================================
+ Hits         1040     4220     +3180     
- Misses       5000     7160     +2160     
- Partials      123      421      +298     
Files with missing lines Coverage Δ
app/upgrades.go 50.00% <100.00%> (+44.66%) ⬆️
app/versiondb.go 82.35% <ø> (-1.44%) ⬇️
app/versiondb_placeholder.go 0.00% <ø> (ø)
versiondb/client/restore_app_db.go 0.00% <ø> (ø)
x/cronos/client/cli/tx.go 39.26% <ø> (+0.39%) ⬆️
...smos/precompile/relayer/i_relayer_module.abigen.go 0.00% <ø> (ø)
x/cronos/events/events.go 23.07% <ø> (ø)
x/cronos/keeper/ibc.go 80.43% <ø> (+80.43%) ⬆️
x/cronos/keeper/params.go 73.52% <100.00%> (+73.52%) ⬆️
x/cronos/keeper/precompiles/ica.go 14.55% <ø> (+6.96%) ⬆️
... and 8 more

... and 61 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JayT106 JayT106 force-pushed the jt/ibc-go-v10 branch 2 times, most recently from cd8f46a to ea1599d Compare May 24, 2025 02:28
@JayT106 JayT106 force-pushed the jt/ibc-go-v10 branch 2 times, most recently from e2fa02e to 03b2b6e Compare May 27, 2025 15:51
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

♻️ Duplicate comments (1)
integration_tests/test_ibc_rly.py (1)

122-122: Fix default mutable argument.

Using a mutable list as a default argument can lead to unexpected behavior.

-def fungible(dst, src, amt, denom, trace=[]):
+def fungible(dst, src, amt, denom, trace=None):
+    if trace is None:
+        trace = []
🧹 Nitpick comments (2)
integration_tests/ibc_utils.py (1)

95-98: Fix formatting issue in conditional expression.

Apply Black formatting to fix the spacing:

-                if incentivized or is_ibc_transfer else []
+                if incentivized or is_ibc_transfer
+                else []
integration_tests/test_ibc_rly.py (1)

19-20: Fix import order.

Move the hermes_transfer import to maintain alphabetical order within the group:

 from .ibc_utils import (
     RATIO,
     assert_duplicate,
     cronos_transfer_source_tokens,
     cronos_transfer_source_tokens_with_proxy,
+    hermes_transfer,
     ibc_denom,
     ibc_incentivized_transfer,
     ibc_multi_transfer,
     ibc_transfer,
     prepare_network,
     rly_transfer,
-    hermes_transfer,
 )
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fd23f75 and 0b31277.

📒 Files selected for processing (24)
  • CHANGELOG.md (1 hunks)
  • app/app.go (12 hunks)
  • integration_tests/configs/ibc_timeout_hermes.jsonnet (1 hunks)
  • integration_tests/cosmoscli.py (1 hunks)
  • integration_tests/ibc_utils.py (10 hunks)
  • integration_tests/test_ibc.py (2 hunks)
  • integration_tests/test_ibc_rly.py (12 hunks)
  • integration_tests/test_ibc_rly_gas.py (2 hunks)
  • integration_tests/test_ibc_timeout.py (2 hunks)
  • integration_tests/test_ibc_update_client.py (2 hunks)
  • integration_tests/test_ica.py (2 hunks)
  • integration_tests/test_ica_incentivized.py (1 hunks)
  • integration_tests/test_ica_precompile.py (2 hunks)
  • integration_tests/test_upgrade.py (2 hunks)
  • nix/default.nix (1 hunks)
  • nix/hermes.nix (3 hunks)
  • nix/sources.json (2 hunks)
  • versiondb/client/restore_app_db.go (0 hunks)
  • versiondb/client/verify.go (1 hunks)
  • versiondb/go.mod (0 hunks)
  • x/cronos/keeper/keeper.go (6 hunks)
  • x/cronos/keeper/precompiles/relayer.go (4 hunks)
  • x/cronos/middleware/conversion_middleware.go (8 hunks)
  • x/cronos/types/interfaces.go (2 hunks)
💤 Files with no reviewable changes (2)
  • versiondb/go.mod
  • versiondb/client/restore_app_db.go
✅ Files skipped from review due to trivial changes (1)
  • integration_tests/test_ica_incentivized.py
🚧 Files skipped from review as they are similar to previous changes (14)
  • integration_tests/test_ica_precompile.py
  • versiondb/client/verify.go
  • CHANGELOG.md
  • integration_tests/test_ibc_timeout.py
  • nix/hermes.nix
  • integration_tests/test_ibc_rly_gas.py
  • integration_tests/test_ibc_update_client.py
  • integration_tests/configs/ibc_timeout_hermes.jsonnet
  • integration_tests/cosmoscli.py
  • integration_tests/test_ica.py
  • integration_tests/test_upgrade.py
  • nix/default.nix
  • nix/sources.json
  • integration_tests/test_ibc.py
🧰 Additional context used
🪛 GitHub Check: Lint python
integration_tests/ibc_utils.py

[failure] 98-98:
./integration_tests/ibc_utils.py:98:51: BLK100 Black would make changes.

integration_tests/test_ibc_rly.py

[failure] 19-19:
./integration_tests/test_ibc_rly.py:19:1: I001 isort found an import in the wrong position


[failure] 267-267:
./integration_tests/test_ibc_rly.py:267:25: BLK100 Black would make changes.

🪛 Ruff (0.11.9)
integration_tests/test_ibc_rly.py

122-122: Do not use mutable data structures for argument defaults

Replace with None; initialize within function

(B006)

⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: Run golangci-lint
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: unittest
  • GitHub Check: Analyze (go)
🔇 Additional comments (27)
x/cronos/types/interfaces.go (2)

11-21: LGTM! Import paths correctly updated to IBC-Go v10.

The IBC module imports have been properly updated from v8 to v10, aligning with the PR objective to integrate ibc-go version 10.1.1.


39-39: Interface method updated to match IBC-Go v10 changes.

The GetDenomTrace method has been correctly renamed to GetDenom with the return type changed from types.DenomTrace to types.Denom, which aligns with the new structured denomination handling in IBC-Go v10.

x/cronos/keeper/precompiles/relayer.go (4)

16-17: LGTM! IBC imports properly upgraded to v10.

The IBC transfer and channel types imports have been correctly updated to v10.


105-114: Correctly removed IBC fee keeper dependency.

The RelayerContract struct and its constructor have been properly updated to remove the IBC fee keeper, which is consistent with the removal of the fee module from the codebase.


159-162: Denom extraction logic updated for IBC-Go v10.

The logic has been correctly updated to use ExtractDenomFromPath and HasPrefix methods, which aligns with the new structured denom handling in IBC-Go v10 where denominations include trace hops.


199-246: Fee-related method handling properly removed.

The removal of RegisterPayee and RegisterCounterpartyPayee case handling is correct, as these methods are no longer needed without the IBC fee module.

integration_tests/ibc_utils.py (4)

53-58: Good addition of is_ibc_transfer parameter for channel version handling.

The new parameter properly distinguishes between IBC transfer channels (string version) and ICA channels (JSON version), which is necessary for correct Hermes relayer operation.

Also applies to: 154-154


164-171: Appropriate config file remapping for Hermes relayer.

The conditional remapping of config files for Hermes ensures compatibility while maintaining backward compatibility with the rly relayer.


217-223: ICA version structure correctly updated.

The ICA version has been properly updated to include all required fields for IBC-Go v10, including encoding, transaction type, and connection IDs.


458-458: Denom trace query correctly fixed.

The query now properly targets the second chain (chainmain) where the denom trace should be queried, which is the correct behavior.

integration_tests/test_ibc_rly.py (3)

76-92: Token structure correctly updated for IBC-Go v10.

The new token_dict function properly creates tokens with the structured denom format that includes base and trace fields, aligning with the IBC-Go v10 token representation.


251-258: Conditional test execution properly handles relayer differences.

The code correctly handles differences between Hermes and rly relayers, skipping log verification for Hermes since it doesn't emit EVM messages that trigger the Cronos precompiled contract.


322-322: Tests appropriately skipped for Hermes relayer.

The incentivized transfer and source token transfer tests are correctly marked as skipped when using Hermes, as the precompiled contract behavior is not supported with this relayer.

Also applies to: 419-419, 424-424

x/cronos/keeper/keeper.go (4)

18-21: IBC imports correctly updated to v10.

All IBC-related imports have been properly upgraded to v10, including the new ibccallbacktypes package needed for the callback interface.


51-51: Keeper correctly implements the IBC callbacks interface.

The explicit declaration that Keeper implements ibccallbacktypes.ContractKeeper ensures type safety and proper interface compliance.


316-323: Acknowledgement handling simplified after fee module removal.

The method now directly unmarshals to channeltypes.Acknowledgement without the fee middleware wrapping, which is the correct approach after removing the IBC fee module.


316-316: IBC callback signatures correctly updated with version parameter.

All four IBC callback methods have been properly updated to include the new version string parameter as required by IBC-Go v10.

Also applies to: 331-331, 341-341, 355-355

app/app.go (5)

113-131: Import changes look good

The IBC-Go imports have been correctly updated from v8 to v10, including the new ibccallbacks middleware and ibctm light client module imports needed for v10 compatibility.


239-265: Store key management updated correctly

The removal of capability and fee module store keys aligns with the v10 upgrade objectives. The addition of object store keys to the return signature properly supports the bank and EVM modules' object storage needs.


583-619: Keeper initialization properly migrated to v10 patterns

All IBC-related keepers have been correctly updated to use runtime.NewKVStoreService instead of direct store keys, which is the required pattern for IBC-Go v10. The removal of capability keeper dependencies is properly handled.


730-735: Light client module registration follows v10 patterns

The Tendermint light client module is correctly instantiated and registered with the client keeper using the new v10 pattern.


709-719: Verify gas limit control for IBC callbacks

The ICA controller stack correctly removes fee middleware and adds the callbacks middleware. However, using math.MaxUint64 as the gas limit for callbacks could pose a risk if not properly controlled elsewhere. The comment mentions that "cronos keeper will use network parameter to control it" - please ensure this gas control mechanism is properly implemented.

#!/bin/bash
# Description: Verify gas control implementation in cronos keeper

# Search for gas limit control in cronos keeper
ast-grep --pattern 'func ($_ *Keeper) $$$Gas$$$($$$) $$$'

# Search for gas-related parameters in cronos module
rg -A 5 "Gas|gas" --glob "x/cronos/types/*.go"

# Check for gas limit validation in IBC callback handling
rg -A 10 "OnIBCCallback|IBCCallback" --glob "x/cronos/keeper/*.go"
x/cronos/middleware/conversion_middleware.go (5)

29-52: Channel lifecycle methods correctly updated for v10

The removal of chanCap capability parameters from OnChanOpenInit and OnChanOpenTry properly aligns with IBC-Go v10's removal of the capability module.


94-125: OnRecvPacket correctly updated with v10 interface

The addition of channelVersion parameter and its usage in UnmarshalPacketData follows the v10 pattern correctly. The refactored convertVouchers call with explicit parameters improves code clarity.


127-193: Packet acknowledgement and timeout handling properly migrated

Both OnAcknowledgementPacket and OnTimeoutPacket correctly implement the v10 interface with the channelVersion parameter and properly handle packet data unmarshaling for refund scenarios.


195-216: Clean refactoring of convertVouchers method

The refactoring to use explicit parameters instead of FungibleTokenPacketData improves code clarity and reduces coupling to IBC transfer types.


227-244: Denom handling correctly modernized for v10

The migration from string-based denom handling to structured traces with Hop types is properly implemented. The logic correctly handles trace manipulation for both prefixed and non-prefixed denominations.

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: 1

♻️ Duplicate comments (1)
integration_tests/test_ibc_rly.py (1)

122-122: Fix mutable default argument (duplicate issue).

This is the same mutable default argument issue that was flagged in previous reviews.

-def fungible(dst, src, amt, denom, trace=[]):
+def fungible(dst, src, amt, denom, trace=None):
+    if trace is None:
+        trace = []
🧹 Nitpick comments (4)
integration_tests/ibc_utils.py (2)

58-58: Function parameter and version handling looks correct.

The addition of is_ibc_transfer parameter and the conditional version formatting (string for IBC transfers, JSON for ICA) aligns with the different requirements of these protocols.

Consider extracting the version formatting logic for better readability:

+ def format_version_for_hermes(version, is_ibc_transfer):
+     return str(version) if is_ibc_transfer else json.dumps(version)
+
  + (
      [
          "--channel-version",
-         str(version) if is_ibc_transfer else json.dumps(version),
+         format_version_for_hermes(version, is_ibc_transfer),
      ]
      if incentivized or is_ibc_transfer
      else []
  )

Also applies to: 96-99


165-173: Config file remapping logic is sound.

The conditional remapping for Hermes relayer appropriately handles compatibility issues with EVM-specific configurations.

Consider adding a comment explaining why these specific config files are remapped:

+ # Hermes doesn't support EVM-specific configurations, fallback to compatible configs
  if is_hermes:
      if file == "ibc_rly_evm":
          config_file = "ibc_rly"
      if file == "ibc_timeout":
          config_file = "ibc_timeout_hermes"
integration_tests/test_ibc_rly.py (2)

250-316: Appropriate conditional testing approach for different relayers.

The conditional logic correctly handles the difference between Hermes and rly relayers, with Hermes skipping EVM log verification since it doesn't trigger Cronos precompiled contracts.

Consider extracting the relayer-specific test logic into separate functions for better maintainability:

def test_ibc_with_hermes(ibc):
    ibc_transfer(ibc, hermes_transfer)
    # Hermes doesn't emit EVM messages for cronos precompiled contract

def test_ibc_with_rly(ibc):
    # Current rly-specific logic with log verification
    pass

def test_ibc(ibc):
    if ibc.hermes is not None:
        test_ibc_with_hermes(ibc)
    else:
        test_ibc_with_rly(ibc)

325-325: Appropriate test skipping for Hermes compatibility.

The skipped tests correctly identify functionality that's incompatible with Hermes relayer due to precompiled contract dependencies.

Consider tracking these skipped tests for future Hermes support or alternative testing approaches. The current approach maintains test integrity while acknowledging architectural limitations.

Also applies to: 422-422, 427-427

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0b31277 and 5b00177.

📒 Files selected for processing (3)
  • integration_tests/ibc_utils.py (10 hunks)
  • integration_tests/test_ibc_rly.py (11 hunks)
  • nix/default.nix (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • nix/default.nix
🧰 Additional context used
🪛 Ruff (0.11.9)
integration_tests/test_ibc_rly.py

122-122: Do not use mutable data structures for argument defaults

Replace with None; initialize within function

(B006)

⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: unittest
  • GitHub Check: Run golangci-lint
  • GitHub Check: Analyze (go)
🔇 Additional comments (9)
integration_tests/ibc_utils.py (5)

4-4: LGTM: Required import for environment variable access.

The os import is needed for the os.getenv("SIGNER1_MNEMONIC") call in the relayer key restore logic.


194-207: Conditional key restore logic is appropriate.

Skipping the relayer key restore for Hermes is correct since different relayers have different key management approaches.


419-419: Verify impact of reduced test coverage.

The reduction from 100 to 50 users in multi-transfer tests decreases the concurrency testing coverage.

Please confirm if this reduction is intentional and document the reasoning. Consider:

  • Performance/resource constraints
  • Test reliability improvements
  • Impact on edge case detection

If this is a temporary change, consider making it configurable:

- users = [f"user{i}" for i in range(1, 50)]
+ num_users = int(os.getenv("IBC_TEST_USERS", "50"))
+ users = [f"user{i}" for i in range(1, num_users)]

459-459: LGTM: Consistent denom trace query targeting.

Explicitly targeting ibc.chainmain.node_rpc(0) ensures consistent denom trace queries against the correct chain.

Also applies to: 564-564


868-876: LGTM: Correct ICA registration format for ibc-go v10.

The updated ICA registration version structure with "ics27-1" properly aligns with IBC-go v10 requirements for ICA protocol.

Note: This correctly uses "ics27-1" for ICA, which should also be applied to the ica_version definition earlier in the file (lines 217-223).

Likely an incorrect or invalid review comment.

integration_tests/test_ibc_rly.py (4)

5-5: LGTM: Import additions and variable usage improvements.

The new imports support dual relayer functionality, and using port_id variable instead of hardcoded "transfer" improves maintainability.

Also applies to: 13-13, 19-19, 41-41


58-60: LGTM: Fixture updated for Hermes relayer default.

The fixture correctly defaults to Hermes relayer and includes the is_ibc_transfer parameter as expected for IBC transfer tests.


76-91: LGTM: Enhanced token representation with trace support.

The token_dict function properly supports token representation with trace information, which is required for the updated IBC protocol structures.


334-334: LGTM: Updated token representation with trace information.

The enhanced fungible token events with trace information (portId and channelId) correctly implement the IBC-go v10 token representation requirements.

Also applies to: 390-390, 352-357, 396-401

@JayT106 JayT106 force-pushed the jt/ibc-go-v10 branch 5 times, most recently from bb4a596 to c4f39d0 Compare June 24, 2025 19:32
@JayT106 JayT106 changed the title feat(ibc): ibc-go v10 is not supported feat(ibc)!: ibc-go v10 is not supported Jun 24, 2025
@JayT106 JayT106 force-pushed the jt/ibc-go-v10 branch 3 times, most recently from 5858e3a to 125820c Compare June 24, 2025 21:11
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)
nix/hermes.nix (1)

61-68: Consider the performance implications of QEMU emulation for ARM64 Linux.

The QEMU emulation approach for ARM64 Linux systems is technically sound but may introduce significant performance overhead. Consider documenting this limitation or providing guidance on when native ARM64 binaries might be available.

Consider adding a comment to document this limitation:

    ${if (stdenv.isLinux && stdenv.isAarch64) then ''
+     # Note: Using x86_64 binary with QEMU emulation due to lack of native ARM64 Linux binary
+     # This may result in reduced performance compared to native execution
      # for ARM64 uses qemu to simulate x86_64
      mv $out/bin/hermes $out/bin/hermes.x86_64
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ea7f37d and 125820c.

📒 Files selected for processing (1)
  • nix/hermes.nix (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: Run golangci-lint
  • GitHub Check: gomod2nix
  • GitHub Check: build (macos-14)
  • GitHub Check: unittest
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: Analyze (go)
🔇 Additional comments (4)
nix/hermes.nix (4)

2-10: Input parameters look appropriate for binary packaging.

The transition from rustPlatform.buildRustPackage inputs to binary packaging inputs (fetchurl, makeWrapper, qemu) aligns well with the new approach of using prebuilt Hermes binaries.


36-58: Installation phase is clean and straightforward.

The derivation setup correctly uses fetchurl for the source and the installation phase properly extracts and installs the binary with appropriate permissions.


76-82: Metadata is comprehensive and well-structured.

The metadata section includes all necessary information including description, homepage, license, supported platforms, and maintainer information.


13-33: ```shell
#!/usr/bin/env bash
set -euo pipefail

echo "Verifying SHA256 hashes for Hermes v1.13.1 binaries using Python..."

Determine Python interpreter

if command -v python3 &>/dev/null; then
PY=python3
elif command -v python &>/dev/null; then
PY=python
else
echo "Error: No Python interpreter found" >&2
exit 1
fi
echo "Using interpreter: $($PY --version 2>&1)"

Expected hashes

declare -A expected=(
["aarch64-apple-darwin"]="1j87ikp29008f6x1pcbp8bc77yfhf40sa13d6iliglsisrgsjcas"
["x86_64-apple-darwin"]="0f9m8g2xg9l3ghvj42kwa7yn6gr3ralylscmz5bs99qdd5hc8fbd"
["x86_64-unknown-linux-gnu"]="0a5anc32brrl390i1aiz3yaar1s9lh3s8r70liw3v7lgd5fnpzgg"
)

for arch in "${!expected[@]}"; do
url="https://github.com/informalsystems/hermes/releases/download/v1.13.1/hermes-v1.13.1-${arch}.tar.gz"
echo
echo "Checking ${arch}:"
sha=$(
curl -sL "$url" | $PY - << 'EOF'
import sys, hashlib
h = hashlib.sha256()
for chunk in iter(lambda: sys.stdin.buffer.read(8192), b""):
h.update(chunk)
print(h.hexdigest())
EOF
)
echo "Computed: $sha"
echo "Expected: ${expected[$arch]}"
done


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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 (2)
nix/hermes.nix (2)

2-9: Remove unused import.

The pkg-config import is not used anywhere in the derivation and should be removed to keep the imports clean.

{
  lib
, stdenv
, fetchurl
, makeWrapper
, openssl
-, pkg-config
, darwin
, qemu
}:

61-68: Consider documenting the QEMU emulation approach.

The QEMU emulation for ARM64 Linux systems is a clever workaround but may have performance implications. Consider adding a comment explaining why this approach was chosen over building native ARM64 binaries.

  postFixup = ''
    ${if (stdenv.isLinux && stdenv.isAarch64) then ''
+     # Use QEMU emulation since no native ARM64 Linux binaries are available
      # for ARM64 uses qemu to simulate x86_64
      mv $out/bin/hermes $out/bin/hermes.x86_64
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 125820c and cb05761.

📒 Files selected for processing (3)
  • nix/default.nix (1 hunks)
  • nix/hermes.nix (1 hunks)
  • nix/sources.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • nix/default.nix
  • nix/sources.json
⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: unittest
  • GitHub Check: gomod2nix
  • GitHub Check: build (macos-14)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Run golangci-lint
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: Analyze (go)
🔇 Additional comments (6)
nix/hermes.nix (6)

13-13: Version alignment confirmed.

The version "1.13.1" correctly aligns with the PR objectives which specify using Hermes relayer version 1.13.1.


15-22: Platform detection logic is sound.

The platform detection correctly handles the supported platforms and provides clear error messages for unsupported ones.


36-58: Binary installation approach is well-implemented.

The switch from building from source to using prebuilt binaries is correctly implemented with proper binary extraction and permission setting.


69-74: Library path configuration is appropriate.

The OpenSSL library path configuration for Linux and the wrapper setup for other platforms is correctly implemented.


76-82: Metadata section is comprehensive.

The metadata provides good information about the package, though the maintainers field is empty which might need attention for future maintenance.


26-33: ```shell
#!/usr/bin/env bash
set -e

VERSION="1.13.1"
declare -a platforms=(
"aarch64-apple-darwin"
"x86_64-apple-darwin"
"x86_64-unknown-linux-gnu"
)

echo "Verifying SHA256 for Hermes v${VERSION} binaries..."

for platform in "${platforms[@]}"; do
url="https://github.com/informalsystems/hermes/releases/download/v${VERSION}/hermes-v${VERSION}-${platform}.tar.gz"
echo -n "$platform: "

Compute SHA256 via Python

curl -sL "$url" | python3 - << 'EOF'
import sys, hashlib
h = hashlib.sha256()
for chunk in iter(lambda: sys.stdin.buffer.read(8192), b''):
h.update(chunk)
print(h.hexdigest())
EOF
done


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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: 1

♻️ Duplicate comments (1)
integration_tests/ibc_utils.py (1)

217-224: Verify ICA version should be "ics27-1" instead of "ics20-1".

The ICA version is still set to "ics20-1" in the channel_version dictionary. Based on the previous review comment and IBC protocol standards, this should likely be "ics27-1" for ICA (Interchain Accounts) rather than "ics20-1" which is for token transfers.

What is the correct ICA (Interchain Accounts) version string for ibc-go v10? Should it be "ics27-1" or "ics20-1"?
🧹 Nitpick comments (1)
nix/hermes.nix (1)

84-90: Add missing maintainer information.

The meta section has an empty maintainers list. Consider adding appropriate maintainers for this package.

-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ /* add appropriate maintainers */ ];
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cb05761 and 47dbe30.

📒 Files selected for processing (3)
  • integration_tests/ibc_utils.py (10 hunks)
  • integration_tests/test_ibc_rly.py (11 hunks)
  • nix/hermes.nix (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • integration_tests/test_ibc_rly.py
⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: unittest
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: Run golangci-lint
  • GitHub Check: Analyze (go)
🔇 Additional comments (8)
nix/hermes.nix (2)

12-35: LGTM: Platform detection and hash handling look correct.

The platform detection logic properly handles Darwin (both x86_64 and aarch64) and Linux architectures. The conditional SHA256 hash selection is appropriate for the multi-platform approach.


63-82: Verify QEMU emulation approach for ARM64 Linux.

The QEMU wrapper approach for ARM64 Linux is interesting - it wraps the x86_64 binary with qemu-x86_64 emulation. While this should work, it may have performance implications.

Consider documenting this approach in the meta description or comments, as it's not immediately obvious why ARM64 Linux uses x86_64 binaries with emulation rather than native ARM64 binaries (if available).

#!/bin/bash
# Check if native ARM64 Linux binaries are available for Hermes v1.13.1
curl -s "https://api.github.com/repos/informalsystems/hermes/releases/tags/v1.13.1" | jq -r '.assets[].name' | grep -i aarch64 || echo "No native ARM64 binaries found"
integration_tests/ibc_utils.py (6)

58-58: LGTM: New parameter for transfer type differentiation.

The is_ibc_transfer parameter addition allows proper differentiation between regular IBC transfers and other channel types, which is essential for correct version handling.


94-100: Correct version format handling for different transfer types.

The conditional logic properly handles the version format based on transfer type - using string format for IBC transfers and JSON format for other types. This aligns with the protocol requirements.


165-173: Good config file remapping logic for Hermes compatibility.

The logic to remap config files when using Hermes relayer (e.g., ibc_rly_evmibc_rly, ibc_timeoutibc_timeout_hermes) ensures proper configuration handling for different relayer types.


215-215: Connection ID is now properly configurable.

The change from hardcoded "connection-0" to os.getenv("CONNECTION_ID", "connection-0") addresses the previous review comment about making the connection ID configurable.


419-419: User count reduction in multi-transfer tests.

The reduction from 100 to 49 users (range(1, 50)) in multi-transfer tests may be intentional for performance reasons or to align with new test requirements.

Could you clarify the reason for reducing the user count in multi-transfer tests? Is this for performance optimization or due to protocol limitations in IBC-Go v10?


459-459: Denom trace query correctly targets chainmain node.

The change to use ibc.chainmain.node_rpc(0) as the RPC endpoint for denom trace queries is correct, ensuring queries are directed to the appropriate chain for trace information.

Also applies to: 564-564

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