Skip to content

feat: bump up ibc-go from v8 to v10 #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 10, 2025

Conversation

zsystm
Copy link

@zsystm zsystm commented Apr 4, 2025

Description

  • Upgraded IBC from v8 to v10.
  • Replaced all depreacted functions (to pass CI rules)
  • Implemented v2 middleware and added basic test cases to verify its functionality.
    • Note: This PR does not include comprehensive test coverage. Unit tests and E2E tests would be addressed in a separate PR.
  • Disabled feemarket base fee parameter for ExampleChain to simplify gas fee logic during testing, enabling zero gas fees for test transactions.
  • Copied and adapted several files from the ibc-go v10.0.1/testing package for the following purposes:
    • To support testing of EVM-specific scenarios (e.g., deploying an ERC20 contract), a block header context with a proposer address was needed. This required:
      • A custom TestChain to process these messages.
      • A custom SignAndDeliver function for transaction signing and delivery with proposer address.
      • A custom Coordinator to integrate the modified TestChain.
    • Due to tight coupling between TestChain, SignAndDeliver, and the testing package—and because ibc-go cannot use a TestChain defined externally—the relevant files were duplicated and tailored to ensure compatibility.

Additional Notes

  • This PR is intentionally minimal, focusing on confirming the IBC v10 integration works as expected.
  • Tests for advanced scenarios, such as receiving native ERC20 coins registered as token pairs, will be added in future PRs.

Closes: #44, #45, #50


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

@zsystm zsystm requested a review from Copilot April 4, 2025 07:13
@zsystm zsystm changed the title Feat/ibc go v8 to v10 Bump up ibc-go from v8 to v10 Apr 4, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 67 out of 69 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • contracts/package-lock.json: Language not supported
  • go.mod: Language not supported
Comments suppressed due to low confidence (1)

ibc/errors.go:7

  • The updated error message 'denom not found' is less specific than the previous 'denom trace not found'. Please ensure that downstream error handling is updated accordingly to avoid ambiguity.
ErrDenomNotFound     = errors.New("denom not found")

@zsystm zsystm added the feature label Apr 4, 2025
@zsystm zsystm self-assigned this Apr 4, 2025
@zsystm zsystm requested a review from dongsam April 4, 2025 07:14
@zsystm zsystm changed the base branch from main to feat/ibc-v10 April 4, 2025 07:17
@zsystm zsystm force-pushed the feat/ibc-go-v8-to-v10 branch 2 times, most recently from c18b6b6 to 9f3013f Compare April 6, 2025 16:21
@zsystm zsystm requested a review from Copilot April 7, 2025 08:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 70 out of 72 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • contracts/package-lock.json: Language not supported
  • go.mod: Language not supported
Comments suppressed due to low confidence (3)

ibc/errors.go:7

  • The error message was renamed from 'ErrDenomTraceNotFound' to 'ErrDenomNotFound'. Ensure that this change is well documented in the migration notes to prevent confusion for developers upgrading to v10.
ErrDenomNotFound     = errors.New("denom not found")

evmd/app.go:287

  • The removal of the CapabilityKeeper initialization and its scoped keepers may affect modules that expect capability management to be set up. Verify that all dependent modules have been updated to reflect this change and that no unexpected runtime issues will occur.
-	CapabilityKeeper      *capabilitykeeper.Keeper

evmd/precompiles.go:45

  • The change in the channelKeeper parameter type from a value to a pointer may require updates in caller functions to pass the correct type. Double-check that all invocations align with the new pointer-based API to avoid type mismatches.
channelKeeper "github.com/cosmos/ibc-go/v10/modules/core/04-channel/keeper"

@zsystm zsystm force-pushed the feat/ibc-go-v8-to-v10 branch from db82eff to a458036 Compare April 7, 2025 08:45
@zsystm
Copy link
Author

zsystm commented Apr 7, 2025

@dongsam
Could you review this PR? All CIs except PR Labeler are passed.

@zsystm zsystm marked this pull request as ready for review April 7, 2025 09:02
@zsystm zsystm requested a review from a team as a code owner April 7, 2025 09:02
@zsystm zsystm removed the feature label Apr 7, 2025
@zsystm zsystm force-pushed the feat/ibc-go-v8-to-v10 branch from 5415143 to a458036 Compare April 7, 2025 13:33
@zsystm zsystm changed the title Bump up ibc-go from v8 to v10 feat: bump up ibc-go from v8 to v10 Apr 7, 2025
@zsystm zsystm requested a review from dongsam April 7, 2025 17:22
PageResponse memory pageResponse
);

/// @dev DenomTrace defines a method for returning a denom trace.
function denomTrace(
function denom(
Copy link
Member

@dongsam dongsam Apr 8, 2025

Choose a reason for hiding this comment

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

Since this is an interface-breaking change, I thought it needed discussion, so I left a note in the issue #44

DenomTrace Endpoint Renaming in IBC v10

  • It is necessary to first check whether any existing app chains are currently using the ics20 precompile contract from either cosmos/evm or evmos/os.
  • If no such usage exists, it would be a good opportunity to align with IBC v10's new endpoint by updating the Solidity interface to use Denom.
  • If there are any, it would be a breaking change, so we may need to decide whether to proceed with a rename on the solidity level or manage versioning for the precompile accordingly.

@dongsam
Copy link
Member

dongsam commented Apr 9, 2025

@zsystm Could you bump to ibc-go v10.1.1?

@zsystm
Copy link
Author

zsystm commented Apr 9, 2025

@zsystm Could you bump to ibc-go v10.1.1?

Thanks for sharing. Will do.

@zsystm
Copy link
Author

zsystm commented Apr 9, 2025

@zsystm Could you bump to ibc-go v10.1.1?

Thanks for sharing. Will do.

@dongsam bump up done in 23fd167

@zsystm zsystm mentioned this pull request Apr 10, 2025
9 tasks
@dongsam dongsam self-requested a review April 10, 2025 03:35
Copy link
Member

@dongsam dongsam left a comment

Choose a reason for hiding this comment

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

LGTM as a temporary bump for follow-up work

Note: Since there may be additional changes in v10 and further modifications could arise during the IBC v2 work and test case PR progress, it seems good as a temporary bump targeting feat/ibc-v10 for follow-up work, rather than merging directly into main.

zsystm added 10 commits April 10, 2025 13:07
- bumped up ibc-go from v8 to v10
- removed unused ibc test codes because bumping unused testing codes are wasting time. we should use ibc testing package instead.
added ibc v1 test cases to make sure ExampleChain works with ibc v1.
disabled basefee param as default for ExampleChain to make test easier.
- added ibc v2 components
- copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well.
- added nil checks for app and keeper in NewIBCMiddleware to prevent nil pointer dereference.
- changed erc20 keeper from struct to interface type to enable proper nil checking.
To test certain key scenarios involving EVM messages (e.g., deploying an ERC20 contract), we needed a block header context with a proposer address. This required:
- A custom `TestChain` to handle these messages.
- A custom `SignAndDeliver` function to support the transaction signing and delivery process.
- A custom `Coordinator` to integrate this tailored `TestChain`.

Since `TestChain` and `SignAndDeliver` are directly or indirectly tied to most components in the testing package, and ibc-go cannot use a `TestChain` struct defined in our separate package, we had to copy and adapt nearly all related files to ensure compatibility and functionality.
Disabling the base fee to simplify testing is not ideal for a reference chain intended for developers building EVM-compatible chains. Ethereum relies on a fee market mechanism, and as a reference implementation, this chain should enable it by default to align with expected behavior.
Updated TestGetReceivedCoin to use the newly introduced interface instead of hardcoded strings.
This improves maintainability by making the test logic more aligned with the actual send/receive flow.
It also enhances readability and helps developers better understand how denoms are constructed and handled in real IBC transfers.
@zsystm zsystm force-pushed the feat/ibc-go-v8-to-v10 branch from e3c8858 to a84a59d Compare April 10, 2025 04:08
@zsystm zsystm merged commit 77e425e into cosmos:feat/ibc-v10 Apr 10, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants