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

Setup IBC #697

Closed
7 tasks
Fraccaman opened this issue Feb 22, 2021 · 66 comments · Fixed by #1145
Closed
7 tasks

Setup IBC #697

Fraccaman opened this issue Feb 22, 2021 · 66 comments · Fixed by #1145
Assignees
Labels
A: bug Admin: something isn't working A: question Admin: further information is requested
Milestone

Comments

@Fraccaman
Copy link
Contributor

Fraccaman commented Feb 22, 2021

Crate

  • ibc

Version

v0.5.0

Summary

Hermes fails with TxNoConfirmation error constantly when trying to communicate with a full node that does not have indexing enabled.

The error can be tracked down using a patched version of Hermes, and looks like this:

Jun 30 13:39:20.800 TRACE waiting for commit of block(s)
Jun 30 13:39:21.001 ERROR query_txs fail: Internal error: transaction indexing is disabled (code: -32603)

Many thanks to @Fraccaman for helping us uncover this corner-case.

A separate, related problem was due to misconfiguration (see heliaxdev/ibc-setup#1).

Acceptance criteria:

Original discussion

Summary of Bug

Probably this is not a bug, but I can't understand whats wrong. I'm trying to open a channel between a cosmos mainnet node and a "own gaia testnet" node. I am able to build the relayer and configure it correctly (It doesn't complain so I'm assuming it is correct) but as soon as I try to run hermes channel handshake id-1 id-2 transfer transfer it throw the following error:
{"status":"error","result":"chain runtime/handle error: Light client supervisor error for chain id heliax: empty witness list"}.

p.s: @andynog suggested to open an issue

Version

  • v0.1.1

Steps to Reproduce

I have created a repository with a series of bash scripts to reproduce this use case here.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@romac
Copy link
Member

romac commented Feb 22, 2021

Something is likely going wrong with the commands that configure the light clients (ie. the light add commands).

I see that the script adds secondary peers for each node using the same network address, is that intended?

Could you remove the &>/dev/null redirect at the end of the commands in ibc.sh and report back with the output?

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Feb 22, 2021

Yes, you are right, that network address is wrong.
So this is the output (i fixed also a typo):

Building the Rust relayer...
Removing light client peers from configuration...
Adding primary peers to light client configuration...
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/hermes -c /home/ec2-user/.hermes/config.toml light add 'localhost:26657' -c stargate -f -p -s /home/ec2-user/node-stargate/data -y`
     Success Added light client:
  chain id: stargate
  address:  tcp://localhost:26657
  peer id:  648A550A0545AF774223E556117BBDE3156A3520
  height:   5229734
  hash:     CF9104D58D3FE7A35E062C02C09E52EA062C5A8F212DF5DDA358EE9A52450F84
  primary:  true
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/hermes -c /home/ec2-user/.hermes/config.toml light add 'localhost:26357' -c heliax -f -p -s /home/ec2-user/node-heliax/data -y`
     Success Added light client:
  chain id: heliax
  address:  tcp://localhost:26357
  peer id:  97DAF05D3D5CCE2DF5AC3323784C2C01A1B7D5CA
  height:   6904
  hash:     81995B52593A2F3D1629A31A20CAF034F9AB64A6235D34457C4F36B065FFD439
  primary:  true
Adding secondary peers to light client configuration...
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/hermes -c /home/ec2-user/.hermes/config.toml light add 'localhost:26657' -c stargate -s /home/ec2-user/node-stargate/data -y --peer-id 2427F8D914A6862279B3326FA64F76E3BC06DB2E`
     Success Added light client:
  chain id: stargate
  address:  tcp://localhost:26657
  peer id:  2427F8D914A6862279B3326FA64F76E3BC06DB2E
  height:   5229737
  hash:     6D874A3D9167B8C955D9AF512C20D7B7069260B831B5F1B338FC77F430AC317E
  primary:  false
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/hermes -c /home/ec2-user/.hermes/config.toml light add 'localhost:26357' -c heliax -s /home/ec2-user/node-heliax/data -y --peer-id A885BB3D3DFF6101188B462466AE926E7A6CD51E`
     Success Added light client:
  chain id: heliax
  address:  tcp://localhost:26357
  peer id:  A885BB3D3DFF6101188B462466AE926E7A6CD51E
  height:   6905
  hash:     6AED5CE877589AE582C5DF9881F008A7CF371E1DCB0F7F03DD1B81FF5A4E71ED
  primary:  false
Importing keys...
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/hermes -c /home/ec2-user/.hermes/config.toml keys add stargate /home/ec2-user/node-stargate/key_seed.json`
{"status":"success","result":"Added key node_key (cosmos1ztu56h7kpuguf9y39lhxgayhngmysnxsgl8f9u) on stargate chain"}
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/hermes -c /home/ec2-user/.hermes/config.toml keys add heliax /home/ec2-user/node-heliax/key_seed.json`
{"status":"success","result":"Added key node_key (cosmos196hkxg7c53h6u75umdrhwum6kp8xyxzw2kvu7r) on heliax chain"}
Done!

Now, the error changed and is the following:

{"status":"error","result":"chain runtime/handle error: Light client instance error for rpc address tcp://localhost:26657: invalid light block: invalid validator set: header_validators_hash=862A9C43A9A29FC6D508352B056A738DB35B3F96F0FA02F0DA2FC1ED8035A55C validators_hash=0198C4156F82C8E0B11C23A24F43FEDE7D92D9146E64FD5D37C5ED3360F53AA9"}

@romac
Copy link
Member

romac commented Feb 22, 2021

Can you post your full ~/.relayer/config.toml file after running the script?

@Fraccaman
Copy link
Contributor Author

If you mean the ~/.hermes/config.toml here it is:

[global]
timeout = '10s'
strategy = 'naive'
log_level = 'error'

[[chains]]
id = 'stargate'
rpc_addr = 'tcp://localhost:26657'
grpc_addr = 'tcp://localhost:9090'
account_prefix = 'cosmos'
key_name = 'node_key'
store_prefix = 'stargate'
gas = 3000000
clock_drift = '5s'
trusting_period = '14days'

[chains.trust_threshold]
numerator = '1'
denominator = '3'

[chains.peers]
primary = '648A550A0545AF774223E556117BBDE3156A3520'

[[chains.peers.light_clients]]
peer_id = '648A550A0545AF774223E556117BBDE3156A3520'
address = 'tcp://localhost:26657'
timeout = '10s'
trusted_header_hash = 'CF9104D58D3FE7A35E062C02C09E52EA062C5A8F212DF5DDA358EE9A52450F84'
trusted_height = '5229734'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/ec2-user/node-stargate/data/648A550A0545AF774223E556117BBDE3156A3520'

[[chains.peers.light_clients]]
peer_id = '2427F8D914A6862279B3326FA64F76E3BC06DB2E'
address = 'tcp://localhost:26657'
timeout = '10s'
trusted_header_hash = '6D874A3D9167B8C955D9AF512C20D7B7069260B831B5F1B338FC77F430AC317E'
trusted_height = '5229737'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/ec2-user/node-stargate/data/2427F8D914A6862279B3326FA64F76E3BC06DB2E'

[[chains]]
id = 'heliax'
rpc_addr = 'tcp://localhost:26357'
grpc_addr = 'tcp://localhost:9091'
account_prefix = 'cosmos'
key_name = 'node_key'
store_prefix = 'heliax'
gas = 3000000
clock_drift = '5s'
trusting_period = '14days'

[chains.trust_threshold]
numerator = '1'
denominator = '3'

[chains.peers]
primary = '97DAF05D3D5CCE2DF5AC3323784C2C01A1B7D5CA'

[[chains.peers.light_clients]]
peer_id = '97DAF05D3D5CCE2DF5AC3323784C2C01A1B7D5CA'
address = 'tcp://localhost:26357'
timeout = '10s'
trusted_header_hash = '81995B52593A2F3D1629A31A20CAF034F9AB64A6235D34457C4F36B065FFD439'
trusted_height = '6904'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/ec2-user/node-heliax/data/97DAF05D3D5CCE2DF5AC3323784C2C01A1B7D5CA'

[[chains.peers.light_clients]]
peer_id = 'A885BB3D3DFF6101188B462466AE926E7A6CD51E'
address = 'tcp://localhost:26357'
timeout = '10s'
trusted_header_hash = '6AED5CE877589AE582C5DF9881F008A7CF371E1DCB0F7F03DD1B81FF5A4E71ED'
trusted_height = '6905'

[chains.peers.light_clients.store]
type = 'disk'
path = '/home/ec2-user/node-heliax/data/A885BB3D3DFF6101188B462466AE926E7A6CD51E'

@romac
Copy link
Member

romac commented Feb 22, 2021

If you mean the ~/.hermes/config.toml here it is:

Yes it's what I meant, sorry about that! Your config looks good to me.

The light client is throwing this error when verifying the initial trusted lightblock, and gets a mismatch between the hash of validator set stored in the header and the hash of the validator set for that height that it computes.

I am not sure what could cause that. Maybe a mismatch in the Tendermint version that the nodes are running vs the version supported by tendermint-rs? Can you tell me what version of Tendermint the nodes are running?

@Fraccaman
Copy link
Contributor Author

No worries @romac!
Can you tell me how can I check that?

I can give you the output of gaiad version --long (hope this is enough):

name: gaia
server_name: gaiad
version: 4.0.0
commit: a279d091c6f66f8a91c87943139ebaecdd84f689
build_tags: netgo,ledger
go: go version go1.15.8 linux/amd64
build_deps:
- github.com/99designs/[email protected]
- github.com/ChainSafe/[email protected]
- github.com/Workiva/[email protected]
- github.com/aristanetworks/[email protected]
- github.com/armon/[email protected]
- github.com/beorn7/[email protected]
- github.com/bgentry/[email protected]
- github.com/btcsuite/[email protected]
- github.com/btcsuite/[email protected]
- github.com/cespare/xxhash/[email protected]
- github.com/confio/ics23/[email protected]
- github.com/cosmos/[email protected]
- github.com/cosmos/[email protected]
- github.com/cosmos/[email protected]
- github.com/cosmos/[email protected]
- github.com/cosmos/[email protected]
- github.com/davecgh/[email protected]
- github.com/dvsekhvalnov/[email protected]
- github.com/enigmampc/[email protected]
- github.com/ethereum/[email protected]
- github.com/felixge/[email protected]
- github.com/fsnotify/[email protected]
- github.com/go-kit/[email protected]
- github.com/go-logfmt/[email protected]
- github.com/godbus/[email protected]
- github.com/gogo/[email protected]
- github.com/gogo/[email protected] => github.com/regen-network/[email protected]
- github.com/golang/[email protected]
- github.com/golang/[email protected]
- github.com/google/[email protected]
- github.com/gorilla/[email protected]
- github.com/gorilla/[email protected]
- github.com/gorilla/[email protected]
- github.com/grpc-ecosystem/[email protected]
- github.com/grpc-ecosystem/[email protected]
- github.com/gsterjov/[email protected]
- github.com/gtank/[email protected]
- github.com/gtank/[email protected]
- github.com/hashicorp/[email protected]
- github.com/hashicorp/[email protected]
- github.com/hashicorp/[email protected]
- github.com/libp2p/[email protected]
- github.com/magiconair/[email protected]
- github.com/mattn/[email protected]
- github.com/matttproud/[email protected]
- github.com/mimoo/[email protected]
- github.com/minio/[email protected]
- github.com/mitchellh/[email protected]
- github.com/mitchellh/[email protected]
- github.com/mtibben/[email protected]
- github.com/pelletier/[email protected]
- github.com/pkg/[email protected]
- github.com/pmezard/[email protected]
- github.com/prometheus/[email protected]
- github.com/prometheus/[email protected]
- github.com/prometheus/[email protected]
- github.com/prometheus/[email protected]
- github.com/rakyll/[email protected]
- github.com/rcrowley/[email protected]
- github.com/regen-network/[email protected]
- github.com/rs/[email protected]
- github.com/rs/[email protected]
- github.com/spf13/[email protected]
- github.com/spf13/[email protected]
- github.com/spf13/[email protected]
- github.com/spf13/[email protected]
- github.com/spf13/[email protected]
- github.com/spf13/[email protected]
- github.com/stretchr/[email protected]
- github.com/subosito/[email protected]
- github.com/syndtr/[email protected]
- github.com/tendermint/[email protected]
- github.com/tendermint/[email protected]
- github.com/tendermint/[email protected]
- github.com/tendermint/[email protected]
- github.com/tendermint/[email protected]
- github.com/zondax/[email protected]
- golang.org/x/[email protected]
- golang.org/x/[email protected]
- golang.org/x/[email protected]
- golang.org/x/[email protected]
- golang.org/x/[email protected]
- google.golang.org/[email protected]
- google.golang.org/[email protected]
- google.golang.org/[email protected]
- gopkg.in/[email protected]
- gopkg.in/[email protected]
- gopkg.in/[email protected]

@romac
Copy link
Member

romac commented Feb 23, 2021

The Tendermint version looks good. We are going to try to reproduce the issue on our side and get back to you. /cc @andynog

@adizere adizere added the A: question Admin: further information is requested label Feb 23, 2021
@adizere adizere added this to the 04.2021 milestone Feb 23, 2021
@andynog
Copy link
Contributor

andynog commented Mar 2, 2021

Hi @Fraccaman, just following up on this. For the stargate chain, is this a local chain you're running or are you testing against a testnet ?

@Fraccaman
Copy link
Contributor Author

One node is running stargate mainnet, the other a local chain.

@andynog
Copy link
Contributor

andynog commented Mar 4, 2021

When you say your node is running on Stargate mainnet, are you referring to cosmoshub-4 ? Can you please send what you get if you run this API query https://localhost:26657/status

Just want to ensure we're talking about the same thing :-)

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Mar 11, 2021

Sorry for the late response, here is the result:

{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "node_info": {
      "protocol_version": {
        "p2p": "8",
        "block": "11",
        "app": "0"
      },
      "id": "3ed8666e8e7fe0ae4dac31014841c1828d240cc9",
      "listen_addr": "tcp://0.0.0.0:26656",
      "network": "cosmoshub-4",
      "version": "",
      "channels": "40202122233038606100",
      "moniker": "heliax-1",
      "other": {
        "tx_index": "on",
        "rpc_address": "tcp://127.0.0.1:26657"
      }
    },
    "sync_info": {
      "latest_block_hash": "E1B2EE22FF1B025DA902FA6B732D09BBCF7DBF8B2E406A7D65A26BED8D499CAF",
      "latest_app_hash": "A99F8C091DD628CA595098368BC57EC69E42EFC1CAAC9D66FA26929756430DD1",
      "latest_block_height": "5201056",
      "latest_block_time": "2021-02-18T13:08:36.985091499Z",
      "earliest_block_hash": "1455A0C15AC49BB506992EC85A3CD4D32367E53A087689815E01A524231C3ADF",
      "earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
      "earliest_block_height": "5200791",
      "earliest_block_time": "2019-12-11T16:11:34Z",
      "catching_up": true
    },
    "validator_info": {
      "address": "84B23508421F2B0C20F1C09308D25F0F6E8AEB41",
      "pub_key": {
        "type": "tendermint/PubKeyEd25519",
        "value": "Abh8gRTD4ZEu5ytdlb+OSkrX7DiRt8vtiPvCLUuQjOY="
      },
      "voting_power": "0"
    }
  }
}

@ancazamfir
Copy link
Collaborator

Related to informalsystems/tendermint-rs#831

@romac romac added the A: bug Admin: something isn't working label Mar 24, 2021
@andynog
Copy link
Contributor

andynog commented Mar 30, 2021

Hi @Fraccaman, we believe this bug is fixed now. We did encounter a bug and fixed in master. We could reproduce it last week and made modifications in informalsystems/tendermint-rs#831

Please let us know if this is fixed now so we can close the ticket. Thanks!

@Fraccaman
Copy link
Contributor Author

Ill try again asap and report back! Thanks! :)

@andynog
Copy link
Contributor

andynog commented Mar 31, 2021

Thanks @Fraccaman please keep us posted. 👍

@Fraccaman
Copy link
Contributor Author

So, I tried again (same setup). Now I get the following error:

{"status":"error","result":"chain runtime/handle error: Light client instance error for rpc address tcp://localhost:26657: invalid light block: not withing trusting period: expires_at=2021-03-04T15:47:08.9667102Z now=2021-04-07T15:16:02.429079517Z"}

@andynog
Copy link
Contributor

andynog commented Apr 7, 2021

So, I tried again (same setup). Now I get the following error:

{"status":"error","result":"chain runtime/handle error: Light client instance error for rpc address tcp://localhost:26657: invalid light block: not withing trusting period: expires_at=2021-03-04T15:47:08.9667102Z now=2021-04-07T15:16:02.429079517Z"}

Hi @Fraccaman, you might need to update your light client (primary and witness) if you haven't done so. It's the same command to add so run again. This will update the trusted header and height

hermes light add tcp://localhost:26657 -c stargate ...

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Apr 8, 2021

I started from a new machine, so I don't think I needed to update the trusted headers.
Anyway, I tried rerunning hermes again (you can see the scripts here), and its kinda strage. Sometime I get the same error about the trusting period but sometime I get

{"status":"error","result":"chain runtime/handle error: Light client instance error for rpc address tcp://localhost:26657: I/O error: fetched validator set is invalid: proposer with address 'C2356622B495725961B5B201A382DD57CD3305EC' not found in validator set"}

@andynog
Copy link
Contributor

andynog commented Apr 8, 2021

I started from a new machine, so I don't think I needed to update the trusted headers.
Anyway, I tried rerunning hermes again (you can see the scripts here), and its kinda strage. Sometime I get the same error about the trusting period but sometime I get

{"status":"error","result":"chain runtime/handle error: Light client instance error for rpc address tcp://localhost:26657: I/O error: fetched validator set is invalid: proposer with address 'C2356622B495725961B5B201A382DD57CD3305EC' not found in validator set"}

That's strange is this setup a clean one?

@Fraccaman
Copy link
Contributor Author

Yes, clean setup, same set of scripts.

@andynog
Copy link
Contributor

andynog commented Apr 8, 2021

OK, I might have to try to reproduce that error again. But there's a few changes related to light configuration in the next release (should be coming out soon), so I'd rather test when the new release is out.

I started from a new machine, so I don't think I needed to update the trusted headers.
Anyway, I tried rerunning hermes again (you can see the scripts here), and its kinda strage. Sometime I get the same error about the trusting period but sometime I get

{"status":"error","result":"chain runtime/handle error: Light client instance error for rpc address tcp://localhost:26657: I/O error: fetched validator set is invalid: proposer with address 'C2356622B495725961B5B201A382DD57CD3305EC' not found in validator set"}

@romac any ideas on what might cause this error ?

@romac
Copy link
Member

romac commented Apr 9, 2021

This error happens when the light client fetches the header and the validator set at height H from the chain, where the latter does not contain a validator whose address matches the proposer_address of the fetched header. It is not clear to me in which circumstances this can happen. As far as I understand, the validator that proposed a block at height H should always be present in the validator set at height H, or at least that's what the code currently enforces.


Fetching the header and validator set:

https://github.com/informalsystems/tendermint-rs/blob/e4eb6b927dd88f89d7bc9016f7e6517bae9b96b9/light-client/src/components/io.rs#L107-L111

Building the validator set:

https://github.com/informalsystems/tendermint-rs/blob/e4eb6b927dd88f89d7bc9016f7e6517bae9b96b9/light-client/src/components/io.rs#L175-L179

Ensuring there is a validator in the set with a matching address:

https://github.com/informalsystems/tendermint-rs/blob/e4eb6b927dd88f89d7bc9016f7e6517bae9b96b9/tendermint/src/validator.rs#L92-L96

@ancazamfir
Copy link
Collaborator

What version of hermes? I think this may come from the pagination issue in tendermint rpc (where we were getting an incomplete validator set) that was fixed and picked up in hermes v0.2.0.

@romac
Copy link
Member

romac commented Apr 9, 2021

What version of hermes? I think this may come from the pagination issue in tendermint rpc (where we were getting an incomplete validator set) that was fixed and picked up in hermes v0.2.0.

Oh right, that's probably it! This was fixed in tendermint v0.19.0 and will therefore indeed be fixed in Hermes v0.2.0.

@romac
Copy link
Member

romac commented Apr 9, 2021

@andynog @Fraccaman Can you try with Hermes master and see if the issue does indeed go away?

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Apr 9, 2021

Im still using 0.1.1 so maybe thats the problem! Yep, I will give it a try!

@Fraccaman
Copy link
Contributor Author

Okay, I had some bugs in the hermes config. Ill keep you posted.

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Jun 17, 2021

More updates. I have been able to create a client between the 2 chains 🎉🎉🎉
Here the output:

[ec2-user@ip-172-31-19-38 ibc-setup]$ $BINARY query client state $IBC1 07-tendermint-252
Success: ClientState {
    chain_id: ChainId {
        id: "h3liax",
        version: 0,
    },
    trust_level: TrustThresholdFraction {
        numerator: 1,
        denominator: 3,
    },
    trusting_period: 1209600s,
    unbonding_period: 1814400s,
    max_clock_drift: 5s,
    frozen_height: Height {
        revision: 0,
        height: 0,
    },
    latest_height: Height {
        revision: 0,
        height: 3437,
    },
    upgrade_path: [
        "upgrade",
        "upgradedIBCState",
    ],
    allow_update: AllowUpdate {
        after_expiry: false,
        after_misbehaviour: false,
    },
}
[ec2-user@ip-172-31-19-38 ibc-setup]$ $BINARY query client state $IBC0 07-tendermint-2
Success: ClientState {
    chain_id: ChainId {
        id: "cosmoshub-4",
        version: 4,
    },
    trust_level: TrustThresholdFraction {
        numerator: 1,
        denominator: 3,
    },
    trusting_period: 1209600s,
    unbonding_period: 1814400s,
    max_clock_drift: 5s,
    frozen_height: Height {
        revision: 0,
        height: 0,
    },
    latest_height: Height {
        revision: 4,
        height: 6614024,
    },
    upgrade_path: [
        "upgrade",
        "upgradedIBCState",
    ],
    allow_update: AllowUpdate {
        after_expiry: false,
        after_misbehaviour: false,
    },
}

Following the tutorial, I'm trying to create a connection and this one is failing.
The first command (conn-init) works:

$BINARY tx raw conn-init $IBC0 $IBC1 07-tendermint-2 07-tendermint-252
Success: OpenInitConnection(
    OpenInit(
        Attributes {
            height: Height {
                revision: 0,
                height: 4474,
            },
            connection_id: Some(
                ConnectionId(
                    "connection-0",
                ),
            ),
            client_id: ClientId(
                "07-tendermint-2",
            ),
            counterparty_connection_id: None,
            counterparty_client_id: ClientId(
                "07-tendermint-252",
            ),
        },
    ),
)

Second command (conn-try) should be working:

$BINARY tx raw conn-try $IBC1 $IBC0 07-tendermint-252 07-tendermint-2 -s connection-0
Error: tx error: failed during a transaction submission step to chain id cosmoshub-4 with underlying error: RPC error to endpoint http://localhost:26657/: RPC error to endpoint http://localhost:26657/: Internal error: timed out waiting for tx to be included in a block (code: -32603)

I think it ran successfully, but I need to increase the rpc timeout.
Third command (conn-ack) fails:

$BINARY tx raw conn-ack $IBC0 $IBC1 07-tendermint-2 07-tendermint-252 -d connection-0 -s connection-1
Error: tx error: failed with underlying cause: tx response error: deliver_tx reports error: log=Log("failed to execute message; message index: 1: connection handshake open ack failed: failed connection state verification for client (07-tendermint-2): chained membership proof failed to verify membership of value: 0A1130372D74656E6465726D696E742D32353212230A0131120D4F524445525F4F524445524544120F4F524445525F554E4F524445524544180222260A0F30372D74656E6465726D696E742D32120C636F6E6E656374696F6E2D301A050A03696263 in subroot C42B7ED48FB47D14FC71C73C510D1687C981E1827F52DDCDC80FED215C6674BA at index 0. Please ensure the path and value are both correct.: invalid proof")

Do you have any suggestions?

P.s: every command dealing with cosmoshub-4 chain "fails" with the same timeout error.

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Jun 22, 2021

I made a little progress but I'm still stuck at the same "step". I avoided the timeout error by setting in gaia timeout_broadcast_tx_commit to 300s. The error comes from the conn-try command(and not the conn-ack) and is the following:

Error: tx error: failed with underlying cause: tx response error: deliver_tx reports error: log=Log("failed to execute message; message index: 1: connection handshake open try failed: failed connection state verification for client (07-tendermint-260): chained membership proof failed to verify membership of value: 0A0F30372D74656E6465726D696E742D3012230A0131120D4F524445525F4F524445524544120F4F524445525F554E4F5244455245441801221A0A1130372D74656E6465726D696E742D3236301A050A03696263 in subroot 3A9C01E534577A1D3BD6AD66742C7A1CFE16610347EB7F677FD636EFD9D0C50F at index 0. Please ensure the path and value are both correct.: invalid proof")

You can see the transactions here.

@Fraccaman
Copy link
Contributor Author

@andynog @ancazamfir any suggestion?

@adizere
Copy link
Member

adizere commented Jun 24, 2021

Hi @Fraccaman,

@ancazamfir and others in the team are looking at this. However, would you be interested in jumping on a call with one of us for quicker troubleshooting? You can reach me for instance and would be glad to fix it together.

In the meantime, some suggestions:

  • can you ensure you're using the latest version of Hermes (currently v0.5.0)?
  • the transactions on mintscan show slightly different details, e.g., this one using client id 07-tendermint-260, not 07-tendermint-252 like detailed in your comment above.

@Fraccaman
Copy link
Contributor Author

Fraccaman commented Jun 24, 2021

Hi @adizere,

yes, sounds good! We can catch up on slack :)

  • I'm using hermes v0.4.0
  • Yes, its because I tried several times between the two comments

@adizere adizere assigned adizere and unassigned andynog Jun 28, 2021
@adizere
Copy link
Member

adizere commented Jun 28, 2021

Some pointers after @romac and I debugged together with @Fraccaman

  • Hermes is failing with error TxNoConfirmation but the actual problem is twofold:
    • the simulated transaction fails, yet Hermes is not printing anything, and instead is just using the max gas; this is probably not ideal
    • we should handle the tx_simulate error case, since the transaction might be malformed, see here
    • It's not clear why we're seeing the "chained membership proof failed to verify membership" error, since both chains are plain gaia binaries, so Hermes should be able to interoperate and correctly relay proofs; the problem may be more serious.
  • to reproduce the error, we'll try to reuse the scripts from here

later edit:

the simulation error is below

ERROR send_tx: simulation result: Error(Context { kind: Grpc, source: Some(Status { code: InvalidArgument, message: "failed to execute message; message index: 1: connection handshake open try failed: failed connection state verification for client (07-tendermint-0): chained membership proof failed to verify membership of value: 0A0F30372D74656E6465726D696E742D3012230A0131120D4F524445525F4F524445524544120F4F524445525F554E4F524445524544180122180A0F30372D74656E6465726D696E742D301A050A03696263 in subroot 9AED769106A6A77961BDE398FA4B515E5EF9F228AEA552EE1D85C2972356FCC0 at index 0. Please ensure the path and value are both correct.: invalid proof: invalid request", metadata: MetadataMap { headers: {"content-type": "application/grpc"} } }), backtrace: Some( 0: backtrace::backtrace::libunwind::trace

Note that this error has the same status "InvalidArgument" as the error we obtain when txs are split across multiple batches. In this case, the second batch (and third, fourth, etc.) fails due to missing client updates:

Jun 29 10:01:23.316 ERROR send_tx_simulate error: Status { code: InvalidArgument, message: "failed to execute message; message index: 0: receive packet verification failed: couldn't verify counterparty packet commitment: failed packet commitment verification for client (07-tendermint-1): client state height < proof height ({0 2360} < {0 2615}): invalid height: invalid request", metadata: MetadataMap { headers: {"content-type": "application/grpc"} } }

@MaxMavaIll
Copy link

hello friends, maybe someone knows what this problem is and how to deal with it.

Reason: Hermes health check failed while verifying the application compatibility for chain osmosis-1:http://localhost:9120/; caused by: SDK module at version '0.46.0' does not meet compatibility requirements >=0.41, <0.46

@adizere
Copy link
Member

adizere commented Sep 12, 2022

Hey,
That warning should be harmless. Make sure you're using the latest Hermes version
https://github.com/informalsystems/ibc-rs/releases/tag/v1.0.0

The warning appears because we didn't update the compatibility check yet (SDK releases went through several back-and-forth and we waited to stabilize).

If you notice problems relaying on Osmosis-1, please let us know, we'd be glad to help!

@MaxMavaIll
Copy link

Hello, I have a problem, I need to install a relayer and join an existing cosmos - osmosis channel, I made a configuration, checked it
hermes health-check
It struck me that everything is correct, then I executed the following commands in order to join the new channel.

hermes query channel end --chain osmosis-1 --port transfer --channel channel-0

hermes query channel end --chain cosmoshub-4 --port transfer --channel channel-141

Then I started I started the hermes servicer. After a while such errors

Sep 26 21:18:09 dedic-cyberG hermes[3669236]: 2022-09-26T19:18:09.358083Z INFO ThreadId(01) spawned client worker: client::cosmoshub-4->osmosis-1:07-tendermint-1532
Sep 26 21:18:09 dedic-cyberG hermes[3669236]: 2022-09-26T19:18:09.426945Z WARN ThreadId(91) refresh{client=07-tendermint-1532 src_chain=cosmoshub-4 dst_chain=osmosis-1}: task encountered ignorable error: failed while querying for client consensus state 07-tendermint-1532 on chain id osmosis-1 for height 4-8039226: error decoding protobuf: error converting message type into domain type: the client consensus state was not found
Sep 26 21:18:09 dedic-cyberG hermes[3669236]: 2022-09-26T19:18:09.688846Z WARN ThreadId(79) refresh{client=07-tendermint-1431 src_chain=cosmoshub-4 dst_chain=osmosis-1}: task encountered ignorable error: failed while querying for client consensus state 07-tendermint-1431 on chain id osmosis-1 for height 4-7856203: error decoding protobuf: error converting message type into domain type: the client consensus state was not found
Sep 26 21:18:10 dedic-cyberG hermes[3669236]: 2022-09-26T19:18:10.592684Z WARN ThreadId(91) refresh{client=07-tendermint-1532 src_chain=cosmoshub-4 dst_chain=osmosis-1}: task encountered ignorable error: failed while querying for client consensus state 07-tendermint-1532 on chain id osmosis-1 for height 4-8039226: error decoding protobuf: error converting message type into domain type: the client consensus state was not found
Sep 26 21:18:10 dedic-cyberG hermes[3669236]: 2022-09-26T19:18:10.816786Z WARN ThreadId(79) refresh{client=07-tendermint-1431 src_chain=cosmoshub-4 dst_chain=osmosis-1}: task encountered ignorable error: failed while querying for client consensus state 07-tendermint-1431 on chain id osmosis-1 for height 4-7856203: error decoding protobuf: error converting message type into domain type: the client consensus state was not found

what could be the problem?

@romac
Copy link
Member

romac commented Sep 27, 2022

Can you please paste your config here so we can take a look?

@romac
Copy link
Member

romac commented Sep 27, 2022

Can you also check what the pruning parameters are set to in the Tendermint config? Pruning should be disabled for Hermes to successfully retrieve consensus states from the past.

@MaxMavaIll
Copy link

MaxMavaIll commented Sep 27, 2022

[global]
log_level = 'info'
[mode]
[mode.clients]
enabled = true
refresh = true
misbehaviour = true
[mode.connections]
enabled = false
[mode.channels]
enabled = false
[mode.packets]
enabled = true
clear_interval = 100
clear_on_start = true
tx_confirmation = true
[rest]
enabled = true
host = '0.0.0.0'
port = 3000
[telemetry]
enabled = true
host = '0.0.0.0'
port = 3001

[[chains]]
id = 'osmosis-1'
rpc_addr = 'http://ip-adress:27667'
grpc_addr = 'http:/ip-adress:9120/'
websocket_addr = 'ws://ip-adress/websocket'
rpc_timeout = '10s'
account_prefix = 'osmo'
key_name = 'osmosis'
store_prefix = 'ibc'
default_gas = 100000
max_gas = 400000
gas_price = { price = 0.001, denom = 'osmo' }
gas_multiplier = 1.1
max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '13days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'cosmos' }

[[chains]]
id = 'cosmoshub-4'
rpc_addr = 'http://ip-adress:27657'
grpc_addr = 'http://ip-adress:9110'
websocket_addr = 'ws://ip-adress:27657/websocket'
rpc_timeout = '10s'
account_prefix = 'cosmos'
key_name = 'cosmos'
store_prefix = 'ibc'
default_gas = 100000
max_gas = 400000
gas_price = { price = 0.001, denom = 'atom' }
gas_multiplier = 1.1
max_msg_num = 30
max_tx_size = 107152
clock_drift = '5s'
max_block_time = '30s'
trusting_period = '14days'
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'cosmos' }

@MaxMavaIll
Copy link

root@dedic ~/.hermes # hermes version
hermes 1.0.0+ed4dd8c

@MaxMavaIll
Copy link

MaxMavaIll commented Sep 27, 2022

I have such assignments in both nodes

#default: only the last 100,000 states (approximately 1 week worth of states) are kept; pruning at 100 block intervals
#nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
#everything: 10 latest states will be kept; pruning at 10 block intervals.
#custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval'
pruning = "default"

@adizere
Copy link
Member

adizere commented Sep 27, 2022

What happens if you do?

$ hermes query client state --chain osmosis-1 --client 07-tendermint-1431

@MaxMavaIll
Copy link

MaxMavaIll commented Sep 27, 2022

I don't know, but I want to understand how it works

it seems to me that this is information about the created client

I need to join the already created channel, if you tell me the sequence of actions, I will be very grateful to you
maybe i'm doing something wrong

@adizere
Copy link
Member

adizere commented Sep 29, 2022

I need to join the already created channel, if you tell me the sequence of actions, I will be very grateful to you
maybe i'm doing something wrong

Let's continue this discussion on Discord. I can be more responsive there.
Either join the IBC Gang server here or DM me directly Adi Seredinschi (Informal)#9927.

My colleagues will also followup by providing a tutorial on how to join created channels.

@BabyDragon003
Copy link

BabyDragon003 commented Nov 21, 2023

Hi, there.
Can help me?
When I run the "hermes create client" on hermes for osmosis chain and my own chain(evmos forking), I get the error as follows.
"ERROR foreign client error: error raised while creating client for chain osmosis-1: failed when building client state: error in underlying transport when making gRPC call: transport error"
I want to fix it on hermes.
best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working A: question Admin: further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants