rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

Add `ConnectionId` in `Identify` events

Open stormshield-frb opened this issue 2 years ago • 0 comments

Description

Add a field connection_id in protocols/identify/src/behaviour.rs:Event so we can map the received event to the corresponding connection.

Motivation

In order to identify which connection has been used to receive Identify::Event and to react on it, we need to have access to the ConnectionId so that we can have access to the ConnectionInfo of the corresponding connection.

Moreover, for debugging and logging purposes it would be very helpful.

Some events do sometimes have the connection_id field (ping, dht, dctur) but other do not (identify, request_response, ...). Maybe that is something that could be uniformized across behaviours. If so, we would be open to work and participate on this, but it might be a different issue.

Current Implementation

We cannot access the ConnectionId identifying were the Identify event came from.

Are you planning to do it yourself in a pull request ?

Yes

stormshield-frb avatar Dec 05 '23 11:12 stormshield-frb