hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

[BUG] Sumeragi panics with "index out of bounds" message after unregistering a peer #5104

Closed 0x009922 closed 3 days ago

0x009922 commented 1 month ago

OS and Environment

macOs 14.16.1

GIT commit hash

3e86d7b3d (in #5087)

Minimum working example / Steps to reproduce

_Occured while re-implementing test network #5087, test connected_peers.rs integration test suite_

  1. Create network with 7 peers, start, wait for genesis
  2. Unregister a random one

Actual result

Sometimes one of the remaining peers may panic:

thread 'sumeragi' panicked at crates/iroha_core/src/sumeragi/main_loop.rs:626:38:
index out of bounds: the len is 6 but the index is 6

At this index access:

https://github.com/hyperledger/iroha/blob/7144f4e83d405bda553a99d7177c5a189452221e/crates/iroha_core/src/sumeragi/main_loop.rs#L626

Expected result

Expected to not panic at any time.

Logs

https://pastebin.com/LXtRDLNe

Who can help to reproduce?

@0x009922

Notes

Used release target of Iroha.