cosmos / relayer

An IBC relayer for ibc-go
Apache License 2.0
391 stars 1.71k forks source link

for same path, channel with different client and connection possible? #1311

Open taitruong opened 1 year ago

taitruong commented 1 year ago

How does client, connection and channel related to each other? Like for this path example:

paths:
    junotestnet-stargazetestnet:
        src:
            chain-id: uni-6
            client-id: 07-tendermint-629 # client CHANNEL_1_JUNO_TO_STARGAZE, target: 07-tendermint-584
            connection-id: connection-735 # connection CHANNEL_1_JUNO_TO_STARGAZE, target: connection-596
        dst:
            chain-id: elgafar-1
            client-id: 07-tendermint-584 # client CHANNEL_1_STARGAZE_TO_JUNO, target: 07-tendermint-629
            connection-id: connection-596 # connection CHANNEL_1_STARGAZE_TO_JUNO, target: connection-735
        src-channel-filter:
            rule: allowlist
            channel-list:
                - channel-721 # channel CHANNEL_1_JUNO_TO_STARGAZE, target: channel-589
                - channel-726 # channel INTERCHAIN_WHITELIST_ADDRESSES_CHANNEL_1_JUNO_TO_STARGAZE, target: channel-594

What happens if I create a new channel with a new client and connection? So I'd have 2 channels in config.yaml. Seems like in config for each path only ONE client-id and connection-id can be configured.

Guess relayer would still relay both channels, but for what are client-id and connect-id used then? Was looking into this doc, but can't find much info about this: https://github.com/cosmos/relayer/blob/main/docs/create-path-across-chain.md

agouin commented 1 year ago

In rly, a path embodies a single pair of clients, connections, and then the channels (one to many) on top of that connection pair. To relay channel(s) on a different pair of clients/connections, you should configure a separate path.

However, it is usually best practice to use the canonical pair of clients and connections between chains for all channels. rly will give a warning when creating new clients if a client already exists.

taitruong commented 1 year ago

In rly, a path embodies a single pair of clients, connections, and then the channels (one to many) on top of that connection pair. To relay channel(s) on a different pair of clients/connections, you should configure a separate path.

However, it is usually best practice to use the canonical pair of clients and connections between chains for all channels. rly will give a warning when creating new clients if a client already exists.

As far as I understand a client refers to 2 chains. Like chain A and B. So if a connection and channel is created - here also it refers to chain A and B. It is possible to use existing connection and create another channel (even for different ports/contracts).

Afaik, clients are updated e.g. on each relay. So the more connections there are, the likely hood of clients staying active is even higher with channels using same connections, right? Isn't this a good practice?

So in case of rly I have to setup an extra path for this case?