notifications/libp2p: Terminate the outbound notification substream on `std::io::Errors` (#7724)
This PR handles a case where we called the `poll_next` on an outbound
substream notification to check if the stream is closed. It is entirely
possible that the `poll_next` would return an `io::error`, for example
end of file.
This PR ensures that we make the distinction between unexpected incoming
data, and error originated from `poll_next`.
While at it, the bulk of the PR change propagates the PeerID from the
network behavior, through the notification handler, to the notification
outbound stream for logging purposes.
cc @paritytech/networking
Part of: https://github.com/paritytech/polkadot-sdk/issues/7722
---------
Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io>
parent
9adb8d28
Showing
- prdoc/pr_7724.prdoc 13 additions, 0 deletionsprdoc/pr_7724.prdoc
- substrate/client/network/src/protocol/notifications/behaviour.rs 18 additions, 6 deletions...te/client/network/src/protocol/notifications/behaviour.rs
- substrate/client/network/src/protocol/notifications/handler.rs 30 additions, 7 deletions...rate/client/network/src/protocol/notifications/handler.rs
- substrate/client/network/src/protocol/notifications/upgrade/notifications.rs 55 additions, 13 deletions...twork/src/protocol/notifications/upgrade/notifications.rs