Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
req-resp: Fix panic on connection closed for substream open failure (#…
…291) When a new connection is reported to the request-response protocol, the protocol tracks the state of the connection if and only if it could open a substream with the remote peer. We do not track the state of the connection in cases where the substream cannot be opened because the connection is closed. A further `ConnectionClosed` event triggered a debug_assert assumption for this case. The assumption is wrong since opening substreams can fail which informs us that the connection is closed. Connection details not tracked: https://github.com/paritytech/litep2p/blob/eed0f755d591eb49e1b715a78aceb5a653ddf529/src/protocol/request_response/mod.rs#L267-L284 Which later leads to panics: https://github.com/paritytech/litep2p/blob/d6fae559fbe2aaf8cb3fff021fb5608ca7b43766/src/protocol/request_response/mod.rs#L295-L301 Related to: #290 --------- Signed-off-by: Alexandru Vasile <[email protected]>
- Loading branch information