litep2p is the networking library behind Polkadot SDK. It's a Rust implementation of libp2p, the protocol suite that handles everything from peer discovery to block propagation across the Polkadot network. Every validator, collator, and light client uses it.
One of the most basic protocols in libp2p is ping. You send 32 random bytes to a peer, they send the same bytes back, and you measure how long it took. Simple. Except litep2p's ping implementation was broken in ways that actually mattered. This article is about PR #416, where I fixed it. What started as a "simple" fix turned into a 30-commit, multi-month effort that ended up touching the connection lifecycle across every transport.
Here's where ping sits in litep2p's architecture, for context:
+-------------------------------------------------------------------------+