NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #4523 most downloaded on crates.io
Peer-to-peer networking library
Last release 5 days ago
02 Oct 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 40 of 40 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
41 releases · first in 2023
One column per quarter.
This release adds client-server mode to Kademlia. Light clients and DHT crawlers can now run without responding to queries and without being added to
This release adds client-server mode to Kademlia. Light clients and DHT crawlers can now run without responding to queries and without being added to remote routing tables, so they no longer pollute the DHT.
It also fixes a set of panics around local provider records: an active local registration can no longer be evicted or expired out of the memory store, and removing one no longer panics.
Note that KademliaEvent is not #[non_exhaustive] and #611 adds a PeersDiscovered variant to it, so every exhaustive match over KademliaEvent needs a new arm to keep compiling.
Note that max_provider_keys now applies separately to the provider keys of remote peers and to the keys this node provides itself, so a node can hold up to twice that many keys in total.
KademliaEvent gained a PeersDiscovered variant; the enum is not #[non_exhaustive], so exhaustive matches over it must add an arm (#611)This release ensures upper-layer protocols are informed about closed connections and substreams that can no longer be opened. Errors in TCP, QUIC and
This release ensures upper-layer protocols are informed about closed connections and substreams that can no longer be opened.
Errors in TCP, QUIC and WebSocket connections now always close the connection and report it as closed. Previously, a peer could look connected forever and could not be connected to again.
When the primary connection to a peer closes and the secondary connection takes over, outbound substreams still opening over the closed connection are now reported as SubstreamOpenFailure, so requests sent over it fail with RejectReason::ConnectionClosed instead of hanging.
A remote host could send an oversized UDP datagram (possibly reassembled from IP fragments) to a WebRTC endpoint and crash the entire process. Datagra
This is a security release.
A remote host could send an oversized UDP datagram (possibly reassembled from IP fragments) to a WebRTC endpoint and crash the entire process. Datagrams larger than 2000 bytes are now dropped at ingress, pending a fix upstream in str0m. Only nodes with the WebRTC transport enabled are affected — upgrading is strongly recommended for all such deployments.
str0m when handling oversized datagrams (#661)This release hardens the WebRTC transport. Substream teardown is now always driven and bounded under backpressure, fixing leaks when substreams are dr
This release hardens the WebRTC transport.
Substream teardown is now always driven and bounded under backpressure, fixing leaks when substreams are dropped.
Substream open and write failures are reported to upper-layer protocols instead of leaving them hanging on substreams that will never open.
Data channels are now ordered and reliable, and any datagram that isn't STUN or DTLS is dropped at ingress, rather than letting str0m reject it and tear down a live connection.
Also bumps str0m to 0.23.1.
OutboundOpening (#658)on_channel_opened (#653)This release focuses on WebRTC. It is the first release with official WebRTC support. Expect things to break and get fixed in subsequent point release
This release focuses on WebRTC. It is the first release with official WebRTC support. Expect things to break and get fixed in subsequent point releases.
This release is also semver breaking on the error API. Error::CannotReadSystemDnsConfig now carries an opaque DnsInitError instead of a hickory-resolver error type, and the new Error::DnsResolverInit variant reports resolver construction failures. Error is now #[non_exhaustive], so external match expressions over it require a wildcard arm. Together these changes keep hickory-resolver out of the public API, making future resolver bumps semver compatible.
hickory-resolver and str0m (#642)str0m to 0.22 (#639)WebRtcTransport stream (#623)This patch release is dedicated entirely to strengthening the WebRTC transport layer, specifically focusing on connection resilience and build stabili
This patch release is dedicated entirely to strengthening the WebRTC transport layer, specifically focusing on connection resilience and build stability.
This release hardens the Bitswap and WebRTC protocols against silent failure modes that could leave connections or pending work stuck without ever bei
This release hardens the Bitswap and WebRTC protocols against silent failure modes that could leave connections or pending work stuck without ever being reported to higher-level protocols.
Bitswap now handles SubstreamOpenFailure, DialFailure, and ConnectionClosed events, bringing it in line with the other protocols. Previously, a failed outbound substream would leave responses stacking onto a dead queue, causing the peer to silently stop being served until the local node was restarted.
WebRTC replaces several unwrap/expect calls in the connection event loop with proper error propagation, and now reports substream open failures to upper layers when the RTC association is no longer healthy, preventing protocols from hanging on a substream that will never open.
This release focuses on advancing the WebRTC transport layer toward production readiness, along with stability patches and CI improvements.
This release focuses on advancing the WebRTC transport layer toward production readiness, along with stability patches and CI improvements.
WebRTC has received substantial upgrades, including multiple listening addresses, backpressure handling, a spec-compliant multistream-select implementation, and critical bug fixes. While the implementation is still considered experimental, it is significantly closer to being production-ready.
Additionally, this release mitigates overflow issues for long-running mDNS nodes and introduces QUIC support for DNS dialing.
WebRtcListener to support multiple listen addresses (#579)Notably, this version introduces a breaking change to error handling: the PeerId::from_bytes method now returns a specialized ParseError instead of a…
This release updates several core dependencies, aligns clippy rules with the latest Rust version, and enhances observability for notification protocols.
Notably, this version introduces a breaking change to error handling: the PeerId::from_bytes method now returns a specialized ParseError instead of a multihash::Error.
This release bumps the rust yamux dependency to 0.13.10 to align with the latest upstream version, which includes important stability fixes.
This release bumps the rust yamux dependency to 0.13.10 to align with the latest upstream version, which includes important stability fixes.
This is a hotfix release fixing ping protocol panic in debug builds. The release also includes WebRTC fixes.
This is a hotfix release fixing ping protocol panic in debug builds. The release also includes WebRTC fixes.
This release includes multiple fixes of transports and protocols, fixing connection stability issues with other libraries (specifically, smoldot ) and
This release includes multiple fixes of transports and protocols, fixing connection stability issues with other libraries (specifically, smoldot) and increasing success rates of dialing & opening substreams, especially in extreme cases when remote nodes have a lot of private addresses published to the DHT.
FIN/FIN_ACK handshake for substream shutdown (#513)This release brings multiple fixes to both the transport and application-level protocols.
This release brings multiple fixes to both the transport and application-level protocols.
Specifically, it enhances WebSocket stability by resolving AsyncWrite errors and ensuring that partial writes during the negotiation phase no longer trigger connection failures.
At the same time, Bitswap client functionality is introduced, which makes this release semver breaking.
This release improves the robustness of the multistream-select negotiation over WebRTC transport and fixes inbound bandwidth metering on substreams. I
This release improves the robustness of the multistream-select negotiation over WebRTC transport and fixes inbound bandwidth metering on substreams. It also enhances the dialing success rate by improving the transport dialing logic. Additionally, it re-exports CID's multihash to facilitate the construction of CID V1.
This release allows all Bitswap CIDs (v1) to pass regardless of the used hash. It also enhances local address checks in the transport manager.
This release allows all Bitswap CIDs (v1) to pass regardless of the used hash. It also enhances local address checks in the transport manager.
This release adds support for connecting to multiple Kademlia DHT networks. The change is backward-compatible, no client code modifications should be
This release adds support for connecting to multiple Kademlia DHT networks. The change is backward-compatible, no client code modifications should be needed compared to v0.12.0.
This release adds KademliaEvent::PutRecordSuccess & KademliaEvent::AddProviderSuccess events to Kademlia, allowing to track whether publishing a recor
This release adds KademliaEvent::PutRecordSuccess & KademliaEvent::AddProviderSuccess events to Kademlia, allowing to track whether publishing a record or a provider was successfull. While PutRecordSuccess was present in the previous versions of litep2p, it was actually never emitted. Note that AddProviderSuccess and QueryFailed are also generated during automatic provider refresh, so those may be emitted for QueryIds not known to the client code.
ADD_PROVIDER queries (#432)PUT_VALUE ACKs (#430)PUT_VALUE queries (#427)This release ensures that polling the yamux controller after an error does not lead to unexpected behavior.
This release ensures that polling the yamux controller after an error does not lead to unexpected behavior.
chore: update str0m dependency, update code based on breaking changes
This release adds support for RSA remote network identity keys gated behind rsa feature. It also fixes mDNS initialization in the environment with no multicast addresses available and Bitswap compatibility with kubo IPFS client >= v0.37.0.
This release adds the ability to use system DNS resolver and change Kademlia DNS memory store capacity. It also fixes the Bitswap protocol implementat
This release adds the ability to use system DNS resolver and change Kademlia DNS memory store capacity. It also fixes the Bitswap protocol implementation and correctly handles the dropped notification substreams by unregistering them from the protocol list.
This release primarily focuses on strengthening the stability of the websocket transport. We've resolved an issue where higher-level buffering was cau
This release primarily focuses on strengthening the stability of the websocket transport. We've resolved an issue where higher-level buffering was causing the Noise protocol to fail when decoding messages.
We've also significantly improved connectivity between litep2p and Smoldot (the Substrate-based light client). Empty frames are now handled correctly, preventing handshake timeouts and ensuring smoother communication.
Finally, we've carried out several dependency updates to keep the library current with the latest versions of its underlying components.
This release brings several improvements and fixes to litep2p, advancing its stability and readiness for production use.
This release brings several improvements and fixes to litep2p, advancing its stability and readiness for production use.
This release addresses an issue where notification protocols failed to exit on handle drop, lowering CPU usage in scenarios like minimal-relay-chains from 7% to 0.1%.
Kademlia:
FIND_NODE responses to the replication factor, reducing data stored in the routing table.Identify Codec:
Bitswap:
Fuzzing Harness: Added a fuzzing harness by SRLabs to uncover and resolve potential issues, improving code robustness. Thanks to @R9295 for the contribution!
Testing Enhancements: Improved notification state machine testing. Thanks to Dominique (@Imod7) for the contribution!
Updated all dependencies for stable feature flags (default and "websocket") to their latest versions.
Reorganized dependencies under specific feature flags, shrinking the default feature set and avoiding exposure of outdated dependencies from experimental features.
minimal-relay-chains (#376)This release introduces an API for setting the maximum kademlia message size.
This release introduces an API for setting the maximum kademlia message size.
This release downgrades a spamming log message to debug level and adds tests for the WebSocket stream implementation.
This release downgrades a spamming log message to debug level and adds tests for the WebSocket stream implementation.
Thanks to @dharjeezy for contributing to this release by avoiding to clone the Kademlia peers when yielding the closest nodes!
This release enhances compatibility between litep2p and libp2p by using the latest Yamux upstream version. Additionally, it includes various improveme
This release enhances compatibility between litep2p and libp2p by using the latest Yamux upstream version. Additionally, it includes various improvements and fixes to boost the stability and performance of the WebSocket stream and the multistream-select protocol.
This release provides partial results to speed up GetRecord queries in the Kademlia protocol.
This release provides partial results to speed up GetRecord queries in the Kademlia protocol.
GetRecord queries (#315)This release aims to make the MDNS component more robust by fixing a bug that caused the MDNS service to fail to register opened substreams. Additiona
This release aims to make the MDNS component more robust by fixing a bug that caused the MDNS service to fail to register opened substreams. Additionally, the release includes several improvements to the identify protocol, replacing FuturesUnordered with FuturesStream for better performance.
This release includes two fixes for small memory leaks happening on edge-cases in the notification and request-response protocols.
This release ensures that the provided peer identity is verified at the crypto/noise protocol level, enhancing security and preventing potential misus
This release ensures that the provided peer identity is verified at the crypto/noise protocol level, enhancing security and preventing potential misuses.
The release also includes a fix that caused TransportService component to panic on debug builds.
This release includes key fixes that enhance the stability and performance of the litep2p library, focusing on long-running stability and improvements
This release includes key fixes that enhance the stability and performance of the litep2p library, focusing on long-running stability and improvements to polling mechanisms.
This issue caused long-running nodes to reject all incoming connections, impacting overall stability.
Addressed a bug in the connection limits functionality that incorrectly tracked connections due for rejection. This issue caused an artificial increase in inbound peers, which were not being properly removed from the connection limit count. This fix ensures more accurate tracking and management of peer connections #286.
This release provides multiple fixes to the polling mechanism, improving how connections and events are processed:
poll_next function that prevented immediate polling of newly added futures.poll_next (#287)TransportContext (#283)This release adds support for content provider advertisement and discovery to Kademlia protocol implementation (see libp2p spec). Additionally, the re
This release adds support for content provider advertisement and discovery to Kademlia protocol implementation (see libp2p spec). Additionally, the release includes several improvements and memory leak fixes to enhance the stability and performance of the litep2p library.
Litep2p now supports content provider advertisement and discovery through the Kademlia protocol.
Content providers can publish their records to the network, and other nodes can discover and retrieve these records using the GET_PROVIDERS query.
// Start providing a record to the network.
// This stores the record in the local provider store and starts advertising it to the network.
kad_handle.start_providing(key.clone());
// Wait for some condition to stop providing...
// Stop providing a record to the network.
// The record is removed from the local provider store and stops advertising it to the network.
// Please note that the record will be removed from the network after the TTL expires.
kad_provider.stop_providing(key.clone());
// Retrieve providers for a record from the network.
// This returns a query ID that is later producing the result when polling the `Kademlia` instance.
let query_id = kad_provider.get_providers(key.clone());
libp2p conformance tests (#258)GET_PROVIDERS query (#236)KademliaMessage and use reference for RoutingTable::closest (#233)Breaking Change: The Identify protocol no longer includes public addresses in its configuration. Instead, use the new PublicAddresses API.
This release introduces several new features, improvements, and fixes to the litep2p library. Key updates include enhanced error handling, configurable connection limits, and a new API for managing public addresses.
A new PublicAddresses API has been added, enabling users to manage the node's public addresses. This API allows developers to add, remove, and retrieve public addresses, which are shared with peers through the Identify protocol.
// Public addresses are accessible from the main litep2p instance.
let public_addresses = litep2p.public_addresses();
// Add a new public address to the node.
if let Err(err) = public_addresses.add_address(multiaddr) {
eprintln!("Failed to add public address: {:?}", err);
}
// Remove a public address from the node.
public_addresses.remove_address(&multiaddr);
// Retrieve all public addresses of the node.
for address in public_addresses.get_addresses() {
println!("Public address: {}", address);
}
Breaking Change: The Identify protocol no longer includes public addresses in its configuration. Instead, use the new PublicAddresses API.
Migration Guide:
// Before:
let (identify_config, identify_event_stream) = IdentifyConfig::new(
"/substrate/1.0".to_string(),
Some(user_agent),
config.public_addresses,
);
// After:
let (identify_config, identify_event_stream) =
IdentifyConfig::new("/substrate/1.0".to_string(), Some(user_agent));
// Public addresses must now be added using the `PublicAddresses` API:
for address in config.public_addresses {
if let Err(err) = public_addresses.add_address(address) {
eprintln!("Failed to add public address: {:?}", err);
}
}
The DialFailure event has been enhanced with a new DialError enum for more precise error reporting when a dial attempt fails. Additionally, a ListDialFailures event has been introduced, listing all dialed addresses and their corresponding errors when multiple addresses are involved.
Other litep2p errors, such as ParseError, AddressError, and NegotiationError, have been refactored for improved error propagation.
This new feature paves the way for better error handling in the litep2p library and moves away from the overarching litep2p::error::Error enum.
The newly added ImmediateDialError enum captures errors occurring before a dial request is sent (e.g., missing peer IDs). It also enhances the RejectReason enum for request-response protocols, offering more detailed rejection reasons.
match error {
RequestResponseError::Rejected(reason) => {
match reason {
RejectReason::ConnectionClosed => "connection-closed",
RejectReason::DialFailed(Some(ImmediateDialError::AlreadyConnected)) => "already-connected",
_ => "other",
}
}
_ => "other",
}
Developers can now set limits on the number of inbound and outbound connections to manage resources and optimize performance.
// Configure connection limits for inbound and outbound established connections.
let litep2p_config = Config::default()
.with_connection_limits(ConnectionLimitsConfig::default()
.max_incoming_connections(Some(3))
.max_outgoing_connections(Some(2))
);
The library now supports feature flags to selectively enable or disable transport protocols. By default, only the TCP transport is enabled. Optional transports include:
quic - Enables QUIC transport.websocket - Enables WebSocket transport.webrtc - Enables WebRTC transport.The keep-alive timeout for connections is now configurable, providing more control over connection lifecycles.
// Set keep alive timeout for connections.
let litep2p_config = Config::default()
.with_keep_alive_timeout(Duration::from_secs(30));
Thanks for contributing to this @Ma233!
PublicAddresses (#212)TransportService::local_peer_id() (#224)ADD_PROVIDER & GET_PROVIDERS network requests (#213)DialError error and ListDialFailures event for better error reporting (#206)MemoryStore (#200)websocket feature (#215)reject() (#198)GetRecordSuccess (#190)This is a bug fixing release. Kademlia now correctly sets and forwards publisher & ttl in the DHT records.
This is a bug fixing release. Kademlia now correctly sets and forwards publisher & ttl in the DHT records.
This is a bug fixing and security release. curve255190-dalek has been upgraded to v4.1.3, see dalek-cryptography/curve25519-dalek#659 for details.
This is a bug fixing and security release. curve255190-dalek has been upgraded to v4.1.3, see dalek-cryptography/curve25519-dalek#659 for details.
This release introduces breaking changes into kad module. The API has been extended as following:
This release introduces breaking changes into kad module. The API has been extended as following:
KademliaEvent::IncomingRecord has been added.KademliaHandle::store_record() / KademliaHandle::try_store_record() have been introduced.This allows implementing manual incoming DHT record validation by configuring Kademlia with IncomingRecordValidationMode::Manual.
Also, it is now possible to enable TCP_NODELAY on sockets.
Multiple refactorings to remove the code duplications and improve the implementation robustness have been done.
This is a small release that makes the FindNode command a bit more robust:
This is a small release that makes the FindNode command a bit more robust:
FindNode command now retains the K (replication factor) best results.FindNode command has been updated to handle errors and unexpected states without panicking.This release introduces breaking changes to the litep2p crate, primarily affecting the kad module. Key updates include:
This release introduces breaking changes to the litep2p crate, primarily affecting the kad module. Key updates include:
GetRecord command now exposes all peer records, not just the latest one.RecordType has been introduced to clearly distinguish between locally stored records and those discovered from the network.Significant refactoring has been done to enhance the efficiency and accuracy of the kad module. The updates are as follows:
GetRecord command now exposes all peer records.GetRecord command has been updated to handle errors and unexpected states without panicking.Additionally, we've improved code coverage in the kad module by adding more tests.
GetRecord query and add tests (#97)rustfmt.toml in sync with polkadot-sdk (#71)" (#74)Nothing published for this version
Expose reuse_port option for TCP and WebSocket transports
This is the second release of litep2p, v0.2.0. The quality of the first release was so bad that this release is a complete rewrite of the library.
This is the second release of litep2p, v0.2.0. The quality of the first release was so bad that this release is a complete rewrite of the library.
Support is added for the following features:
Transport protocols:
Protocols:
/ipfs/identify/1.0.0/ipfs/ping/1.0.0/ipfs/kad/1.0.0/ipfs/bitswap/1.2.0This time the architecture has been designed to be extensible and integrating new transport and/or user-level protocols should be easier. Additionally, the test coverage is higher both in terms of unit and integration tests. The project also contains conformance tests which test the behavior of litep2p against, rust-libp2p, go-libp2p and Substrate's sc-network. Currently the Substrate conformance tests are not enabled by default as they require unpublished/unaccepted changes to Substrate.
This is the first release of litep2p, v0.1.0.
This is the first release of litep2p, v0.1.0.
Support is added for the following:
libp2p)/ipfs/identify/1.0.0/ipfs/ping/1.0.0The code quality is atrocious but it works and the second release focuses on providing high test coverage for the library. After that is done and most of the functionality is covered (unit, integration and conformance tests, benchmarks), the focus can be turned to refactoring the code into something clean and efficient.
Your coding agent can read these notes before it upgrades. Set up the MCP server →