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

Panic when trying to ask for the connections between two chains #3380

Closed
5 tasks
RaulBernal opened this issue May 30, 2023 · 1 comment · Fixed by #3381
Closed
5 tasks

Panic when trying to ask for the connections between two chains #3380

RaulBernal opened this issue May 30, 2023 · 1 comment · Fixed by #3381
Assignees
Labels
A: bug Admin: something isn't working
Milestone

Comments

@RaulBernal
Copy link

Summary of Bug

Panic when trying to ask for the connections between two chains

Version

Hermes v1.4.1+45b5c29

Steps to Reproduce

./hermes query connections  --counterparty-chain cosmoshub-4 --chain bitcanna-1
2023-05-30T10:40:20.515009Z  INFO ThreadId(01) using default configuration from '/home/raul/.hermes/config.toml'
2023-05-30T10:40:20.515134Z  INFO ThreadId(01) running Hermes v1.4.1+45b5c29
thread 'main' panicked at 'removal index (is 36) should be < len (is 35)', crates/relayer-cli/src/commands/query/connections.rs:73:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Acceptance Criteria


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ancazamfir ancazamfir added this to the v1.6 milestone May 30, 2023
@romac romac self-assigned this May 30, 2023
@romac romac modified the milestones: v1.6, v1.5.1 May 30, 2023
@seanchen1991 seanchen1991 added the A: bug Admin: something isn't working label May 30, 2023
@romac
Copy link
Member

romac commented May 31, 2023

Detailed reproduction steps

First of all, create 3 connections between ibc-0 and ibc-1:

$ hermes create connection --a-chain ibc-0 --b-chain ibc-1
$ hermes create connection --a-chain ibc-0 --b-chain ibc-1
$ hermes create connection --a-chain ibc-0 --b-chain ibc-1

These connections are identified on ibc-0 as connection-0, connection-1 and connection-2.

Then create 3 connections between ibc-0 and ibc-2:

$ hermes create connection --a-chain ibc-0 --b-chain ibc-2
$ hermes create connection --a-chain ibc-0 --b-chain ibc-2
$ hermes create connection --a-chain ibc-0 --b-chain ibc-2

These connections are identified on ibc-0 as connection-3, connection-4 and connection-5.

Then, query all the connections on ibc-0:

$ hermes query connections --chain-id ibc-0
SUCCESS [
    ConnectionId(
        "connection-0",
    ),
    ConnectionId(
        "connection-1",
    ),
    ConnectionId(
        "connection-2",
    ),
    ConnectionId(
        "connection-3",
    ),
    ConnectionId(
        "connection-4",
    ),
    ConnectionId(
        "connection-5",
    ),
]

Then filter the connections to only include the ones who point to ibc-1:

❯ hermes query connections --chain ibc-0 --counterparty-chain ibc-1                                                                                            50% at 14:24:36
thread 'main' panicked at 'removal index (is 5) should be < len (is 4)', crates/relayer-cli/src/commands/query/connections.rs:73:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Let's do the same for the connections pointing to ibc-2:

$ hermes query connections --chain ibc-0 --counterparty-chain ibc-2
SUCCESS [
    ConnectionId(
        "connection-1",
    ),
    ConnectionId(
        "connection-3",
    ),
    ConnectionId(
        "connection-5",
    ),
]

While this does not crash like the command above, we see that the results are wrong.

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
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants