Description
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?