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

Channel creation fails when trying to create an Interchain-Account #8168

Open
Roc8Trppn opened this issue Mar 10, 2025 · 2 comments
Open

Channel creation fails when trying to create an Interchain-Account #8168

Roc8Trppn opened this issue Mar 10, 2025 · 2 comments

Comments

@Roc8Trppn
Copy link

Roc8Trppn commented Mar 10, 2025

Hi,

In a local dev environment we are running a provider chain that is connected via relayer to a consumer chain (neutron clone).

The overall idea is that the entire governance logic on that particular consumer is being done via the provider. Here Interchain-Accounts seem like a good solution to implement such a logic.

So for that we have created a custom module to handle a custom proposal type.
If a proposal passes the ConsumerGovProposal function is triggered and in here we are trying to create
an ICA programmatically:

	govAccountAddress := authtypes.NewModuleAddress(govtypes.ModuleName).String()
	portID, err := icatypes.NewControllerPortID(govAccountAddress)
	if err != nil {
		k.Logger(ctx).Error("SubmitTx: failed to create NewControllerPortID:", "error", err)
		return nil, errors.Wrap(err, "failed to create NewControllerPortID")
	}

	k.Logger(ctx).Info("Created PortId", "portid", portID)

	_, found := k.icsControllerKeeper.GetInterchainAccountAddress(ctx, connectionID, portID)
	if !found {
		k.Logger(ctx).Info("ICA Address not found. Register new ICA")

		icaMetadata := icatypes.Metadata{
			Version:                 "ics27-1",
			ControllerConnectionId:   connectionID,
			HostConnectionId:         connectionID,
			Encoding:                 "proto3",
			TxType:                   "sdk_multi_msg",
		}

		versionBz, err := json.Marshal(icaMetadata)
		if err != nil {
			return nil, errors.Wrap(err, "failed to marshal ICA metadata")
		}

		msg := &icacontrollertypes.MsgRegisterInterchainAccount{
			ConnectionId: connectionID,
			Owner:        govAccountAddress,
    		Version:	string(versionBz),
			Ordering: channeltypes.UNORDERED,
		}
		
		res , err2 := k.icaControllerMsgServer.RegisterInterchainAccount(ctx, msg)
		if err2 != nil {
			k.Logger(ctx).Error("RegisterInterchainAccount: failed to register account:", "error", err2)
			return nil, errors.Wrap(err2, "failed to create InterchainAccount")
		}

		k.Logger(ctx).Info("Response", "res", res.String())

	}

So for testing we run the provider, vote for consumer addition, run the consumer and then establish a connection, cannel and run the relayer. Next we submit a custom proposal and when the voting period passes it triggers the above function.

And that one always looks like it's working since we never enter the error block:

if err2 != nil {
			k.Logger(ctx).Error("RegisterInterchainAccount: failed to register account:", "error", err2)
			return nil, errors.Wrap(err2, "failed to create InterchainAccount")
		}

All the inputs look correct to me and I've compared them to the instructions here:
https://github.com/cosmos/ibc-go/wiki/How-to-use-groups-with-ICA

Now as far as I have understood the process of creating an ICA, icacontrollertypes.MsgRegisterInterchainAccount should trigger an automatic channel creation with the provided connectionID via IBC.

And indeed the OnChanOpenInit is successfully called, but then nothing happens...
I.e. the relayer is not reacting nor the OnChanOpenTry on the consumer...
It does look like the event is emitted correctly (as far as I could debug) but for some reason it seems that the relayer is not picking it up...

So the most obvious idea is to check the chains.packet_filter of the .config of hermes but we have added:

policy = "allow"
list = [["transfer", "*"], ["ccv-provider", "*"], ["ccv-consumer", "*"], ["provider", "*"], ["consumer", "*"], ["ica*", "*"], ["interchainaccounts*", "*"]]

so I guess that shouldn't be the problem...

So I wanted to ask if anyone knows or has some ideas what the problem might be?

@gjermundgaraba
Copy link
Contributor

It seems like a relayer problem, but without knowing a bit more about which version of ibc-go and hermes, it is hard to know for sure. Maybe try to set the allow list to simply "", "" to see if that does anything.

@Roc8Trppn
Copy link
Author

hi @gjermundgaraba , thanks for the quick response!

I've tried to set the allow list like you suggested, but still no response from the relayer...
We are using ibc-go v8 and hermes version 1.10.4+542e14f

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

No branches or pull requests

2 participants