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

Registry reports wrong connection_id #546

Open
Buckram123 opened this issue Aug 8, 2024 · 2 comments
Open

Registry reports wrong connection_id #546

Buckram123 opened this issue Aug 8, 2024 · 2 comments

Comments

@Buckram123
Copy link

Buckram123 commented Aug 8, 2024

I have a config with 4 chains and 3 relayers between them and /ibc/{chain_1}/{chain_2} request returns incorrect connection id randomly.
For reproduction here's the config I'm using:

chains:
  - id: juno-1
    name: juno
    numValidators: 1
    ports:
      rest: 1313
      rpc: 26653
      grpc: 30658
      faucet: 8000
  - id: junotwo-1
    name: juno
    numValidators: 1
    ports:
      rest: 1317
      rpc: 26659
      grpc: 30660
      faucet: 8004
  - id: junothree-1
    name: juno
    numValidators: 1
    ports:
      rest: 1323
      rpc: 26657
      grpc: 30657
      faucet: 8001
  - id: junofour-1
    name: juno
    numValidators: 1
    ports:
      rest: 1328
      rpc: 26658
      grpc: 30659
      faucet: 8003

relayers:
  - name: juno-juno2
    type: hermes
    replicas: 1
    chains:
      - juno-1
      - junotwo-1
    config:
      event_source:
        mode: "pull"
  - name: juno2-juno3
    type: hermes
    replicas: 1
    chains:
      - junotwo-1
      - junothree-1
    config:
      event_source:
        mode: "pull"
  - name: juno3-juno4
    type: hermes
    replicas: 1
    chains:
      - junothree-1
      - junofour-1
    config:
      event_source:
        mode: "pull"

registry:
  enabled: true
  ports:
    rest: 8081

When it's running I create one channel betwenn each of them:

kubectl exec hermes-juno-juno2-0 -- hermes create channel --order unordered --a-chain juno-1 --a-connection connection-0 --a-port  transfer --b-port transfer
kubectl exec hermes-juno2-juno3-0 -- hermes create channel --order unordered --a-chain junotwo-1 --a-connection connection-0 --a-port  transfer --b-port transfer
kubectl exec hermes-juno3-juno4-0 -- hermes create channel --order unordered --a-chain junothree-1 --a-connection connection-0 --a-port  transfer --b-port transfer

After that I'm doing couple of GET requests to get connection_id between chains:

$ curl -s GET 'http://localhost:8081/ibc/juno-1/junotwo-1' | jq ".chain_1.connection_id" && curl -s GET 'http://localhost:8081/ibc/junotwo-1/junothree-1' | jq ".chain_1.connection_id" && curl -s GET 'http://localhost:8081/ibc/junothree-1/junofour-1' | jq ".chain_1.connection_id"
"connection-0"
"connection-0"
"connection-0"

If you repeat running this command eventually you will get something like that instead of correct result:

"connection-0"
"connection-0"
"connection-1"

Where one of the connection ids incorrect.

Why it's bad:
We use this endpoint to determine command for opening channels in hermes and when incorrect connection_id passed inside hermes it errors that it does not have config for the chain_b

@Anmol1696
Copy link
Collaborator

Ahh i think this is cuz there can be multiple connections between the chains, maybe some are not active or invalid even.
This is a good bug to report thanks.

I think issue could be here: https://github.com/cosmology-tech/starship/blob/main/starship/registry/chain.go#L247
Maybe we need to update the way we fetch connection information between the chains

@Buckram123
Copy link
Author

Ahh i think this is cuz there can be multiple connections between the chains, maybe some are not active or invalid even. This is a good bug to report thanks.

I think issue could be here: https://github.com/cosmology-tech/starship/blob/main/starship/registry/chain.go#L247 Maybe we need to update the way we fetch connection information between the chains

Great, thanks for active maintaining of this awesome tool!

Yeah it seems like connection_id just swaps on ibc/chain1/chain2 (in case of incorrect result), so:

  • chain1 returns chain2->chain1 connection_id
  • chain2 returns chain1->chain2 connection_id

For some time and then it gets back to normal until flips again. Can't say for sure tho, as I only observed the results

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