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

SimApp uses an older version of ibc-go #173

Open
rootulp opened this issue Feb 20, 2025 · 4 comments · May be fixed by #200
Open

SimApp uses an older version of ibc-go #173

rootulp opened this issue Feb 20, 2025 · 4 comments · May be fixed by #200
Labels
bug Something isn't working

Comments

@rootulp
Copy link
Collaborator

rootulp commented Feb 20, 2025

Context

SimApp currently uses an older version of ibc-go here. The commit of solidity-ibc-eureka that this repo uses, uses a more recent version of ibc-go here.

Problem

@fl0rek reported that the attribute names in parsed simapp events don't seem compatible with the relayer in the eureka repo.

Proposal

Explore if bumping the ibc-go version resolves @fl0rek problem. If it does, bump the ibc-go version in SimApp. Note this is non-trivial because it involves bumping the SDK version of SimApp which includes a breaking change to import paths.

@rootulp rootulp added the bug Something isn't working label Feb 20, 2025
@rootulp
Copy link
Collaborator Author

rootulp commented Feb 21, 2025

Note: when we bump ibc-go we will likely have to modify the messages sent during make setup. The version of ibc-go we currently use creates channels

func createChannelOnSimapp(clientCtx client.Context, clientId string) error {
cosmosMerklePathPrefix := commitmenttypesv2.NewMerklePath([]byte("simd"))
msg := channeltypesv2.MsgCreateChannel{
ClientId: clientId,
MerklePathPrefix: cosmosMerklePathPrefix,
Signer: relayer,
}
response, err := utils.BroadcastMessages(clientCtx, relayer, 200_000, &msg)
if err != nil {
return fmt.Errorf("failed to create channel: %v", err)
}
if response.Code != 0 {
return fmt.Errorf("failed to create channel: %v", response.RawLog)
}
fmt.Println("Created channel on simapp.")
return nil
}
but that should be removed in more recent versions of ibc-go because IBC Eureka is channel-less.

Also this function

func createChannelAndCounterpartyOnReth(addresses utils.ContractAddresses, ethClient *ethclient.Client) error {
ethChainId := big.NewInt(80087)
ethPrivateKey := "0x82bfcfadbf1712f6550d8d2c00a39f05b33ec78939d0167be2a737d691f33a6a"
icsClientContract, err := ics02client.NewContract(ethcommon.HexToAddress(addresses.ICS02Client), ethClient)
if err != nil {
return fmt.Errorf("failed to instantiate ICS Core contract: %v", err)
}
counterpartyInfo := ics02client.IICS02ClientMsgsCounterpartyInfo{
ClientId: counterpartyClientId,
MerklePrefix: [][]byte{[]byte("ibc"), []byte("")},
}
tmLightClientAddress := ethcommon.HexToAddress(addresses.ICS07Tendermint)
key, err := crypto.ToECDSA(ethcommon.FromHex(ethPrivateKey))
if err != nil {
return fmt.Errorf("failed to convert private key: %v", err)
}
fmt.Printf("Adding client to the ICS Client contract on reth node with counterparty clientId %s...\n", counterpartyInfo.ClientId)
tx, err := icsClientContract.AddClient(GetTransactOpts(key, ethChainId, ethClient), ibcexported.Tendermint, counterpartyInfo, tmLightClientAddress)
if err != nil {
return fmt.Errorf("failed to add channel: %v", err)
}
receipt := GetTxReceipt(context.Background(), ethClient, tx.Hash())
event, err := GetEvmEvent(receipt, icsClientContract.ParseICS02ClientAdded)
if err != nil {
return fmt.Errorf("failed to get event: %v", err)
}
if event.ClientId != expectedClientId {
return fmt.Errorf("expected clientId %s, got %s", expectedClientId, event.ClientId)
}
if event.CounterpartyInfo.ClientId != counterpartyClientId {
return fmt.Errorf("expected counterparty clientId %s, got %s", counterpartyClientId, event.CounterpartyInfo.ClientId)
}
fmt.Printf("Added client to the ICS client contract on reth node with clientId %s and counterparty clientId %s\n", event.ClientId, event.CounterpartyInfo.ClientId)
TendermintLightClientID = event.CounterpartyInfo.ClientId
return nil
}
does not create a channel even though the function name claims it does.

Based on the spec instead of the channels, we just register counterparties.

cc: @ninabarbakadze

@rootulp
Copy link
Collaborator Author

rootulp commented Mar 5, 2025

We should tackle this in stages:

  1. First bump to the version of ibc-go that our commit of solidity-ibc-eureka uses: https://github.com/cosmos/solidity-ibc-eureka/blob/b241dc7658dc1540013430851f6e861e2df7cd51/e2e/interchaintestv8/go.mod#L314
  2. Later, only if needed bump our version of solidity-ibc-eureka to more recent commit and then bump ibc-go to the version used by that commit.

@rootulp
Copy link
Collaborator Author

rootulp commented Mar 7, 2025

We're bumping ibc-go from 3d84b47307b9 to 7dd7d2711c58: cosmos/ibc-go@7dd7d27 but that commit transitively pulls in cosmos-sdk v0.52.x which has been retracted 😢

go: github.com/cosmos/[email protected]: reading github.com/cosmos/cosmos-sdk/go.mod at revision v0.52.0: unknown revision v0.52.0

so we may have to bump to latest solidity-ibc-eureka and ibc-go

@rootulp
Copy link
Collaborator Author

rootulp commented Mar 7, 2025

ICS20 v2 was removed in this PR so I think we need to modify to just use ICS20 v1 with IBC Eureka

@rootulp rootulp linked a pull request Mar 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant