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

hermes crashes on clear packets when full node indexing #851

Closed
5 tasks
ancazamfir opened this issue Apr 26, 2021 · 0 comments · Fixed by #852
Closed
5 tasks

hermes crashes on clear packets when full node indexing #851

ancazamfir opened this issue Apr 26, 2021 · 0 comments · Fixed by #852
Assignees
Labels
A: bug Admin: something isn't working I: logic Internal: related to the relaying logic
Milestone

Comments

@ancazamfir
Copy link
Collaborator

ancazamfir commented Apr 26, 2021

Crate

relayer

Summary of Bug

When hermes is started immediately after a packet send, it is possible that query_tx() does not find the Tx for the send or ack packets if full node indexing is not finished. This bug was introduced by #827.

Version

master

Steps to Reproduce

  1. setup a channel using hermes create channel... between ibc-0 and ibc-1
  2. from one terminal issue hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 150 -n 1
  3. from another terminal hermes start ibc-0 ibc-1 -p transfer -c channel-0

time between 2 and 3 should be very small, otherwise the bug cannot be reproduced. The logs look like this:

Apr 26 19:15:13.046  INFO ibc_relayer::link: [ibc-1 -> ibc-0] clearing old packets
Apr 26 19:15:13.052 DEBUG ibc_relayer::link: [ibc-1 -> ibc-0] packets that have acknowledgments on ibc-1 [1, 15, 2]
Apr 26 19:15:13.054 DEBUG ibc_relayer::link: [ibc-1 -> ibc-0] ack packets to send out to ibc-0 of the ones with acknowledgments on ibc-1: [Sequence(15)]
The application panicked (crashed).
Message:  index out of bounds: the len is 0 but the index is 0
Location: relayer/src/chain/cosmos.rs:1001

Acceptance Criteria

  • hermes should not crash. A quick try with the diffs below avoids the crash
+++ b/relayer/src/chain/cosmos.rs
@@ -992,6 +992,10 @@ impl Chain for CosmosSdkChain {
                         "packet_from_tx_search_response: unexpected number of txs"
                     );

+                    if response.txs.is_empty() {
+                        continue;
+                    }
+
                     if let Some(event) = packet_from_tx_search_response(
                         self.id(),
                         &request,

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 04.2021 milestone Apr 26, 2021
@ancazamfir ancazamfir self-assigned this Apr 26, 2021
@adizere adizere added A: bug Admin: something isn't working I: logic Internal: related to the relaying logic labels Apr 26, 2021
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 I: logic Internal: related to the relaying logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants