litep2p icon indicating copy to clipboard operation
litep2p copied to clipboard

identify: Open inbound substream for unknown peer

Open lexnv opened this issue 2 months ago • 3 comments

There seems to be a state mismatch in the identify protocol implementation.

The following warning appeared 44 times on a warp sync node and 8 times on a full sync node, both nodes were running for almost 2 weeks.

2024-05-06 03:16:41.456  WARN tokio-runtime-worker litep2p::ipfs::identify: inbound identify substream opened for peer who doesn't exist peer=PeerId("12D3KooWA5taCbB5CEcz1VS126XjcbwBYqm9GmsASX5mBZU8611v") protocol=/ipfs/id/1.0.0

The warning is coming from:

https://github.com/paritytech/litep2p/blob/42ed1c1463a8b11eac5344af2871ba752335b06e/src/protocol/libp2p/identify.rs#L255-L266

This may happen when:

  1. on_connection_established fails to open a new substream, either because the peerID isn't connected or the connection is clogged
  2. on_connection_closed is called before on_inbound_substream
  3. on_inbound_substream is called before on_connection_established

cc @paritytech/networking

lexnv avatar May 06 '24 13:05 lexnv