Skip to content
Snippets Groups Projects
Unverified Commit aa67d2ae authored by Alexandru Vasile's avatar Alexandru Vasile Committed by GitHub
Browse files

notifications/libp2p: Punish notification protocol misbehavior on outbound substreams (#7781)


This PR punishes behaviors that deviate from the notification spec. When
a peer misbehaves by writing data on an unidirectional read stream, the
peer is banned and disconnected immediately.

In this PR:
- The `NotificationOutError` is enriched with termination reason and
made publically available for higher levels
- The protocol misbehavior is propagated through the `CloseDesired`
events
- The network behavior of the protocol is responsible for banning the
peer.
- The peer is banned immediately and, as a result, the reputation system
disconnects the malicious / misbehaving peer
- Logs are enriched with protocol names

Closes: https://github.com/paritytech/polkadot-sdk/issues/7722


cc @paritytech/networking

---------

Signed-off-by: default avatarAlexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: default avatarBastian Köcher <git@kchr.de>
parent 64dc0eff
No related merge requests found
Pipeline #518963 waiting for manual action with stages
in 20 minutes and 38 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment