dotnet-libp2p
dotnet-libp2p copied to clipboard
Add support for PeerId as an argument in the OnMessage event handler.
Is your feature request related to a problem? Please describe. There is currently no way to track from which peer the gossip message was received. This makes it harder to identify peers that are actively sending gossip messages.
Describe the solution you'd like
In order to track messages received from gossip peers, the OnMessage event in the ITopic interface should be updated to include PeerId as an argument. For example, the event declaration can be modified from event Action<byte[]>? OnMessage; to event Action<PeerId, byte[]>? OnMessage;. This change allows the event to provide information about the peer that sent each gossip message, enabling better tracking of message sources.