Skip to content

v0.8.3

Latest

Choose a tag to compare

@sumanjeet0012 sumanjeet0012 released this 26 Nov 19:16
· 1 commit to main since this release
v0.8.3
6ca18ff

py-libp2p v0.8.3

Patch release with three security fixes, a new host event bus with broader metrics, and memory-retention fixes across transports.

Security

  • Yamux now enforces per-stream receive-window limits. Incoming DATA frames that exceed the window are treated as a protocol error and terminate the session, so a remote peer can no longer grow stream buffers without bound. (GHSA-xx4q-fj82-qjp5)
  • Circuit Relay v2 RESERVE admission is keyed on the authenticated peer. msg.peer values that do not match the connection's peer are rejected, so a connected peer cannot consume reservation slots under unrelated peer IDs. (GHSA-76w5-58f3-9p2g)
  • Inbound pubsub subscription state is bounded per peer. max_subscriptions_per_peer / max_subscriptions_per_rpc and inbound RPC size limits are enforced, per-peer subscription counts are tracked, and empty peer_topics entries are dropped on unsubscribe and disconnect. (GHSA-3p7x-v3jj-qxj7)

Bugfixes

  • Fixed the SECIO key exchange on Windows, which used secp256k1 instead of P-256 and so could not agree on a shared secret with other platforms or implementations. (#1100)
  • Leaving host.run() without calling host.close() now closes the host's connections, listeners and transports. Previously the teardown in Swarm.run() ran in an already-cancelled scope and stopped at its first await. (#1584)
  • Fixed the ping command to give correct complete instructions to run the ping demo, including the WebSocket case. (#1591)
  • Fixed the circuit relay example so a source can reach a destination through the relay: the circuit address now names the relay, the destination keeps its relay services running and makes its reservation as soon as it connects, and a malformed log call no longer raises TypeError. (#1606)
  • tls-client-demo in its default echo mode now gets a reply from tls-demo: the server answers /echo/1.0.0, and the client's echo mode uses it instead of the interactive chat protocol. (#1613)
  • Raise QUICStreamClosedError again when writing to a QUIC stream whose sending side has ended, instead of letting aioquic's StreamStateError through and resetting the stream. (#1619)
  • The WebRTC-Direct listener no longer monkey-patches aioice into a fake local ICE-Lite agent. It uses a full controlled muxed Connection; the dialer still synthesises an a=ice-lite answer so it remains controlling (aiortc/aioice#114). (#1626)
  • AutoConnector.stop() now cancels the running connect cycle, including in-flight dials and on-demand discovery, and returns only once it has unwound, so no auto-connect dial can register a connection after stop() returns. (#1630)
  • Released retained connection, stream, and task state across QUIC, stream multiplexers, WebSocket, pubsub, Bitswap, and Kad-DHT. Bounded peerstore and swarm bookkeeping, reclaimed inbound connection slots after disconnect, and improved auto-connector recovery after peer churn. Persistent peerstores now prune older uncached peers on writes when the datastore exceeds max_stored_peers (defaults to max_records). Kad-DHT preserves existing local provider publications at capacity. (#1632)

Features

  • Added Python 3.14 to the tox test matrix and supported Python classifiers. (#1100)
  • Require aioquic 1.9.1 or later, so QUIC and WebTransport connections use the post-quantum X25519MLKEM768 key exchange whenever the peer supports it, and stop relying on aioquic internals. (#1619)
  • Added a synchronous host event bus for typed observability events and expanded Prometheus coverage across libp2p subsystems. Network lifecycle notifees continue to drive connection, stream, and listener callbacks; existing metrics-channel consumers can receive bus events through a best-effort bridge. (#1631)

Internal Changes

  • Run the example programs themselves in the demos test environment, so a broken example script now fails CI. (#523)
  • Replaced coincurve and fastecdsa with cryptography for secp256k1 and P-256 keys, since coincurve 21.0.0 cannot be installed on Python 3.14 and later. Signatures are unchanged, and installing py-libp2p no longer needs GMP, CMake or pkg-config. (#1100)
  • Moved the iterative Kademlia lookup loop out of PeerRouting.find_closest_peers_network into a reusable Lookup engine in libp2p.kad_dht.lookup, with no change in behaviour. (#1384)
  • Added js-libp2p WebRTC-Direct interop tests (@libp2p/webrtc 7.0.2) for both the v1 and v2 flows. (#1437)
  • Added a test that a QUIC handshake between two py-libp2p peers offers and selects the post-quantum X25519MLKEM768 key exchange. (#1581)
  • Updated the test suite for multiaddr 0.3 and silenced two pyrefly false positives on py-multihash 4.0.0. (#1620)

Install

pip install --upgrade libp2p==0.8.3

Full changelog: v0.8.2...v0.8.3