Skip to content

Conversation

@zsystm
Copy link
Contributor

@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 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 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
Contributor 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

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI : In relation to this, not only the function name but also the return data type needs to be updated.
These changes are planned to be included in #74

@dongsam
Copy link
Contributor

dongsam commented Apr 9, 2025

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

@zsystm
Copy link
Contributor Author

zsystm commented Apr 9, 2025

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

Thanks for sharing. Will do.

@zsystm
Copy link
Contributor 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
Contributor

@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
dongsam pushed a commit that referenced this pull request Apr 24, 2025
* bump up ibc-go from v8 to v10

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

* add ibc v1 transfer test

added ibc v1 test cases to make sure ExampleChain works with ibc v1.
disabled basefee param as default for ExampleChain to make test easier.

* add ibc v2 components (module, middleware)

- added ibc v2 components
- copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well.

* add nil checks and convert erc20 keeper to interface in IBCMiddleware

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

* copy and modify from ibc-go testing

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.

* fix: ci issues

* replace deprecated functions

* revert disable base fee

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.

* update TestGetReceivedCoin

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.

* bump up ibc-go from v10.1.0 to v10.1.1
@dongsam dongsam mentioned this pull request Apr 24, 2025
9 tasks
dongsam pushed a commit that referenced this pull request Apr 25, 2025
* bump up ibc-go from v8 to v10

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

* add ibc v1 transfer test

added ibc v1 test cases to make sure ExampleChain works with ibc v1.
disabled basefee param as default for ExampleChain to make test easier.

* add ibc v2 components (module, middleware)

- added ibc v2 components
- copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well.

* add nil checks and convert erc20 keeper to interface in IBCMiddleware

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

* copy and modify from ibc-go testing

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.

* fix: ci issues

* replace deprecated functions

* revert disable base fee

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.

* update TestGetReceivedCoin

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.

* bump up ibc-go from v10.1.0 to v10.1.1
dongsam added a commit that referenced this pull request Apr 28, 2025
* feat: bump up ibc-go from v8 to v10 (#51)

* bump up ibc-go from v8 to v10

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

* add ibc v1 transfer test

added ibc v1 test cases to make sure ExampleChain works with ibc v1.
disabled basefee param as default for ExampleChain to make test easier.

* add ibc v2 components (module, middleware)

- added ibc v2 components
- copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well.

* add nil checks and convert erc20 keeper to interface in IBCMiddleware

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

* copy and modify from ibc-go testing

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.

* fix: ci issues

* replace deprecated functions

* revert disable base fee

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.

* update TestGetReceivedCoin

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.

* bump up ibc-go from v10.1.0 to v10.1.1

* tests: add ibc test cases (#63)

* add basic test cases for ibc middleware v1, v2

more test cases will be added.

* add test cases for ibc middleware v2

* add test cases for ibc middleware v1 and post state check

* add OnAcknowledgementPacket tc for v1 ibc middleware

* add OnTimeoutPacket tc for v1 ibc middleware

* chore: unify variable names

* use internal testing pkg and add TestOnRecvPacketNativeErc20 tc

* add v1 tcs for handling erc20 native coin

OnTimeoutPacket, OnAcknowledgementPacket

* refactor v1 middleware test codes

* apply gci

* fix ci: receiver name should be same

* fix ci: unify receiver name

and also update comments and variable name

* fix ci: run gofumpt and remove tc copy

* test: update TestOnRecvPacket

make sure whether it is registered as dynamic precompiled contract or not

* chore: test suite name convention

* fix!: replace erc20 prefix (#92)

* replace erc20 native coin's prefix

from: erc20/
to: erc20

* change prefix to erc20:

* don't allow legacy format

ValidateErc20Denom is not used anywhere except test code, but what if it is used from somewhere else in the future?

We shouldn't treat legacy format as valid.

* fix!: ensure ics20 precompile on ibc v1 and v2 and add test cases (#74)

* test: WIP debugging ibc e2e test

* fix: ics20 precompile receiver addr to bech32, not bech32

* test: add erc20 case for ics20 v1 e2e test

(cherry picked from commit 2737b63160d9cefcad52cf86048638a861a478a5)

* test: add ibc v2 relayer logic on testing package, add v2 ics20 precompile test cases

(cherry picked from commit 886fdb7581cdcd0dcce15592aae0d8206e78a783)

* chore: fix lint Useless assignment to local variable

* fix!: denom trace to denom for ibc v8 -> v10 breaking changes

* fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms #92

320236a

* test: add native erc20 case on ics20 precompile e2e test

(cherry picked from commit d8db271978f9a23d26a7c180ff8d7ec5edccc643)

* chore: fix lint

(cherry picked from commit 0d998cefc0c5bb57c396c01544b3ebe610f8a510)

* fix: update comments on ics20.sol

* refactor: Improve variable name clarity, apply suggestions

* Revert "fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms #92"

This reverts commit e5afb56.

* chore: update omitted contracts json by make contracts-all

* docs: update CHANGELOG.md

* tests: add erc20 native coin test cases for ibc v2 middleware (#96)

* add OnRecvPacketNativeERC20 test case

test scenario where evm chain receives erc20 native coin through IBC

* add OnTimeoutPacketNativeERC20 test case

* fix ci and comments

* fix test case

* fix: apply review comments, add testcases, error handling

---------

Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com>
Co-authored-by: Vlad J <vladjdk@gmail.com>
zsystm added a commit to zsystm/evm that referenced this pull request Nov 2, 2025
* feat: bump up ibc-go from v8 to v10 (cosmos#51)

* bump up ibc-go from v8 to v10

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

* add ibc v1 transfer test

added ibc v1 test cases to make sure ExampleChain works with ibc v1.
disabled basefee param as default for ExampleChain to make test easier.

* add ibc v2 components (module, middleware)

- added ibc v2 components
- copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well.

* add nil checks and convert erc20 keeper to interface in IBCMiddleware

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

* copy and modify from ibc-go testing

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.

* fix: ci issues

* replace deprecated functions

* revert disable base fee

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.

* update TestGetReceivedCoin

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.

* bump up ibc-go from v10.1.0 to v10.1.1

* tests: add ibc test cases (cosmos#63)

* add basic test cases for ibc middleware v1, v2

more test cases will be added.

* add test cases for ibc middleware v2

* add test cases for ibc middleware v1 and post state check

* add OnAcknowledgementPacket tc for v1 ibc middleware

* add OnTimeoutPacket tc for v1 ibc middleware

* chore: unify variable names

* use internal testing pkg and add TestOnRecvPacketNativeErc20 tc

* add v1 tcs for handling erc20 native coin

OnTimeoutPacket, OnAcknowledgementPacket

* refactor v1 middleware test codes

* apply gci

* fix ci: receiver name should be same

* fix ci: unify receiver name

and also update comments and variable name

* fix ci: run gofumpt and remove tc copy

* test: update TestOnRecvPacket

make sure whether it is registered as dynamic precompiled contract or not

* chore: test suite name convention

* fix!: replace erc20 prefix (cosmos#92)

* replace erc20 native coin's prefix

from: erc20/
to: erc20

* change prefix to erc20:

* don't allow legacy format

ValidateErc20Denom is not used anywhere except test code, but what if it is used from somewhere else in the future?

We shouldn't treat legacy format as valid.

* fix!: ensure ics20 precompile on ibc v1 and v2 and add test cases (cosmos#74)

* test: WIP debugging ibc e2e test

* fix: ics20 precompile receiver addr to bech32, not bech32

* test: add erc20 case for ics20 v1 e2e test

(cherry picked from commit 2737b63160d9cefcad52cf86048638a861a478a5)

* test: add ibc v2 relayer logic on testing package, add v2 ics20 precompile test cases

(cherry picked from commit 886fdb7581cdcd0dcce15592aae0d8206e78a783)

* chore: fix lint Useless assignment to local variable

* fix!: denom trace to denom for ibc v8 -> v10 breaking changes

* fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms cosmos#92

320236a

* test: add native erc20 case on ics20 precompile e2e test

(cherry picked from commit d8db271978f9a23d26a7c180ff8d7ec5edccc643)

* chore: fix lint

(cherry picked from commit 0d998cefc0c5bb57c396c01544b3ebe610f8a510)

* fix: update comments on ics20.sol

* refactor: Improve variable name clarity, apply suggestions

* Revert "fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms cosmos#92"

This reverts commit e5afb56.

* chore: update omitted contracts json by make contracts-all

* docs: update CHANGELOG.md

* tests: add erc20 native coin test cases for ibc v2 middleware (cosmos#96)

* add OnRecvPacketNativeERC20 test case

test scenario where evm chain receives erc20 native coin through IBC

* add OnTimeoutPacketNativeERC20 test case

* fix ci and comments

* fix test case

* fix: apply review comments, add testcases, error handling

---------

Co-authored-by: Hyunwoo Lee <124245155+zsystm@users.noreply.github.com>
Co-authored-by: Vlad J <vladjdk@gmail.com>
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