hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Support for ICS 09 localhost clients

Open ljoss17 opened this issue 1 year ago • 2 comments

Summary

Ibc-go simapp v7.1.0 introduced a localhost lightclient https://github.com/cosmos/ibc-go/blob/v7.1.0/CHANGELOG.md#features.

The current version of Hermes v1.5.1 does not handle the localhost client, https://github.com/informalsystems/hermes/blob/v1.5.1/crates/relayer/src/client_state.rs#L136.

Proposal

  • [ ] Update ibc-proto-rs to have the new localhost v2, https://github.com/cosmos/ibc-go/blob/v7.1.0/proto/ibc/lightclients/localhost/v2/localhost.proto
  • [ ] Implement localhost client

For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate milestone (priority) applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

ljoss17 avatar Jun 20 '23 08:06 ljoss17

I remember @romac mentioning that he'd started looking into adding support for localhost clients in Hermes, but that it would require extensive refactoring. We might need to figure out whether we can support localhost clients by leveraging relayer-next.

seanchen1991 avatar Jun 20 '23 15:06 seanchen1991

I am running hermes and two chains on localhost

Is this issue #3435 related to why I get a warning, like in the logs below:

Steps:

  1. Start chains A and B.
  2. Start hermes. It comes up fine and I can see the client is valid message for both chains A and B
  3. Kill hermes.
  4. Kill chain B
  5. Start chain C
  6. Start hermes by creating clients, connections and channels for chains A & C.
  7. hermes starts but I never the the client is valid message (see the log snippet) below.
2023-07-27T23:59:26.528353Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}: scanning chain...
2023-07-27T23:59:26.528571Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}: scanning chain for all clients, connections and channels
2023-07-27T23:59:26.528608Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}: scanning all clients...
2023-07-27T23:59:26.536226Z  WARN ThreadId(19) scan.chain{chain=ccv_111-100}: failed to parse client state IdentifiedClientState { client_id: 09-localhost, client_state: Any { type_url: /ibc.lightclients.localhost.v2.ClientState } }. Error: unknown client state type: /ibc.lightclients.localhost.v2.ClientState
2023-07-27T23:59:26.536429Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}:scan.client{client=07-tendermint-0}: scanning client...
2023-07-27T23:59:26.536540Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}:scan.client{client=07-tendermint-1}: scanning client...
2023-07-27T23:59:26.536607Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}:scan.client{client=07-tendermint-2}: scanning client...
2023-07-27T23:59:26.540899Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}:scan.client{client=07-tendermint-3}: scanning client...
2023-07-27T23:59:26.540966Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}:scan.client{client=07-tendermint-4}: scanning client...
2023-07-27T23:59:26.545277Z  INFO ThreadId(01) scan.chain{chain=ccv_111-100}:scan.client{client=07-tendermint-5}: scanning client...
2023-07-27T23:59:26.548617Z  INFO ThreadId(01) scan.chain{chain=mychain_1690501373458990-1}: scanning chain...
2023-07-27T23:59:26.548877Z  INFO ThreadId(01) scan.chain{chain=mychain_1690501373458990-1}: scanning chain for all clients, connections and channels
2023-07-27T23:59:26.548927Z  INFO ThreadId(01) scan.chain{chain=mychain_1690501373458990-1}: scanning all clients...
2023-07-27T23:59:26.552670Z  WARN ThreadId(20) scan.chain{chain=mychain_1690501373458990-1}: failed to parse client state IdentifiedClientState { client_id: 09-localhost, client_state: Any { type_url: /ibc.lightclients.localhost.v2.ClientState } }. Error: unknown client state type: /ibc.lightclients.localhost.v2.ClientState
2023-07-27T23:59:26.552856Z  INFO ThreadId(01) scan.chain{chain=mychain_1690501373458990-1}:scan.client{client=07-tendermint-0}: scanning client...
2023-07-27T23:59:26.556205Z  INFO ThreadId(01) scan.chain{chain=mychain_1690501373458990-1}:scan.client{client=07-tendermint-1}: scanning client...
2023-07-27T23:59:26.563427Z  INFO ThreadId(01) scan.chain{chain=mychain_1690501373458990-1}:scan.client{client=07-tendermint-2}: scanning client...
2023-07-27T23:59:26.566089Z  INFO ThreadId(01) scanned chains:
2023-07-27T23:59:26.566187Z  INFO ThreadId(01) # Chain: ccv_111-100
  - Client: 07-tendermint-2
  - Client: 07-tendermint-4
  - Client: 07-tendermint-5
# Chain: mychain_1690501373458990-1
  - Client: 07-tendermint-0
  - Client: 07-tendermint-1
  - Client: 07-tendermint-2

2023-07-27T23:59:26.567638Z  INFO ThreadId(01) spawn:chain{chain=ccv_111-100}: spawning Wallet worker: wallet::ccv_111-100
2023-07-27T23:59:26.567879Z  INFO ThreadId(01) spawn:chain{chain=mychain_1690501373458990-1}: spawning Wallet worker: wallet::mychain_1690501373458990-1
2023-07-27T23:59:26.591922Z  INFO ThreadId(01) Hermes has started

My launch-hermes.sh script:

export PATH=$PATH:/home/ashish/.hermes/bin
PROVIDER_CHAIN=ccv_111-100
CONSUMER_CHAIN=mychain_1690501373458990-1

hermes --config .hermes/config.toml config validate

hermes --config .hermes/config.toml keys add --chain $PROVIDER_CHAIN --mnemonic-file keys/relayer.file
hermes --config .hermes/config.toml keys add --chain $CONSUMER_CHAIN --mnemonic-file keys/relayer.file

hermes --config .hermes/config.toml create client --host-chain $PROVIDER_CHAIN --reference-chain $CONSUMER_CHAIN
hermes --config .hermes/config.toml create client --host-chain $CONSUMER_CHAIN --reference-chain $PROVIDER_CHAIN

hermes --config .hermes/config.toml create connection --a-chain $PROVIDER_CHAIN --a-client 07-tendermint-0 --b-client 07-tendermint-0
hermes --config .hermes/config.toml create channel --a-chain $PROVIDER_CHAIN --a-connection connection-0 --a-port transfer --b-port transfer

hermes --config .hermes/config.toml start

ashishchandr70 avatar Jul 28 '23 00:07 ashishchandr70