Skip to content

Commit eac0d79

Browse files
committed
Compile release notes for v0.5.0
1 parent 2491f94 commit eac0d79

25 files changed

+128
-110
lines changed

docs/release_notes.rst

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,134 @@ Release Notes
33

44
.. towncrier release notes start
55
6+
py-libp2p v0.5.0 (2025-12-21)
7+
-----------------------------
8+
9+
Bugfixes
10+
~~~~~~~~
11+
12+
- Fixed pubsub service crashes when protocol negotiation fails by adding proper exception handling. (`#910 <https://github.com/libp2p/py-libp2p/issues/910>`__)
13+
- Fixed Yamux.accept_stream() hanging indefinitely when connection is closed. (`#930 <https://github.com/libp2p/py-libp2p/issues/930>`__)
14+
- Handle FLAG_FIN & FLAG_RST in TYPE_WINDOW_UPDATE frames (`#931 <https://github.com/libp2p/py-libp2p/issues/931>`__)
15+
- Added peer ID validation in identify_push protocol to prevent forged peer records.
16+
17+
This security enhancement ensures that the peer ID in signed peer records matches
18+
the sender's peer ID, preventing peer ID spoofing attacks. This addresses
19+
CVE-2023-40583 equivalent vulnerability. (`#958 <https://github.com/libp2p/py-libp2p/issues/958>`__)
20+
- Fixed resource scope cleanup in SwarmConn close method to properly release connection resources when connections are closed. (`#1020 <https://github.com/libp2p/py-libp2p/issues/1020>`__)
21+
- Fixed interoperability with rust-libp2p by switching default key generation to Ed25519 and enhancing Yamux to handle data with SYN/ACK frames. (`#1034 <https://github.com/libp2p/py-libp2p/issues/1034>`__)
22+
- Fixed Mplex connection cleanup to properly handle connection closure callbacks, resolving interop test failures with chromium-rust-v0.53. (`#1037 <https://github.com/libp2p/py-libp2p/issues/1037>`__)
23+
- Fixed QUIC interop issue where Go-to-Python ping would fail after identify stream closes. The listener now properly tracks new Connection IDs issued after connection establishment, enabling correct packet routing for subsequent streams. (`#1044 <https://github.com/libp2p/py-libp2p/issues/1044>`__)
24+
- Kademlia DHT API now accepts string keys instead of bytes (``put_value(key: str, ...)``). Fixes UnicodeDecodeError with binary multihash keys. (`#1059 <https://github.com/libp2p/py-libp2p/issues/1059>`__)
25+
- Fixed BasicHost.run() to accept task_status keyword argument for compatibility with modern pytest-trio (>=0.8.0) and trio (>=0.26.0). (`#1071 <https://github.com/libp2p/py-libp2p/issues/1071>`__)
26+
- Fixed QUIC stream direction misclassification that caused server-side errors when handling client-initiated streams. (`#1081 <https://github.com/libp2p/py-libp2p/issues/1081>`__)
27+
28+
29+
Features
30+
~~~~~~~~
31+
32+
- Noise protocol now uses spec-compliant X25519 keys for DH exchange while maintaining Ed25519 keys for libp2p identity signatures. This fixes signature verification failures and ensures compatibility with other libp2p implementations. Updated ``tests/utils/factories.py`` to use separate X25519 keys for Noise static keys and ``libp2p/security/noise/patterns.py`` to properly handle key separation during handshake.
33+
34+
Full Specification Compliance Achieved:
35+
Stream Muxers: Added stream_muxers field to NoiseExtensions (spec requirement)
36+
Legacy Cleanup: Removed non-spec data field from NoiseHandshakePayload
37+
Protobuf Schema: Updated to match official libp2p/specs/noise
38+
WebTransport Support: Certificate hash exchange fully implemented
39+
40+
Beyond Specification - Advanced Features:
41+
Early Data (0-RTT): Full implementation with handlers and callbacks
42+
Advanced Rekeying: Configurable policies and statistics
43+
Static Key Caching: Performance optimizations
44+
Comprehensive Management: Full handler system for early data (`#591 <https://github.com/libp2p/py-libp2p/issues/591>`__)
45+
- Added fallback mechanism in Kademlia DHT to use connected peers and peerstore when routing table has insufficient peers. (`#905 <https://github.com/libp2p/py-libp2p/issues/905>`__)
46+
- Enhanced WebSocket transport with advanced features including SOCKS proxy support,
47+
AutoTLS for browser integration, connection management, and comprehensive configuration
48+
options. The implementation adds production-ready features like connection pooling,
49+
statistics tracking, and advanced TLS configuration for improved reliability and
50+
monitoring capabilities. (`#938 <https://github.com/libp2p/py-libp2p/issues/938>`__)
51+
- Added persistent peer storage system with datastore-agnostic backend support.
52+
53+
The new PersistentPeerStore implementation provides persistent storage for peer data
54+
(addresses, keys, metadata, protocols, latency metrics) across application restarts.
55+
This addresses the limitation of the in-memory peerstore that loses all peer information
56+
when the process restarts.
57+
58+
Key features:
59+
- Datastore-agnostic interface supporting multiple backends (SQLite, LevelDB, RocksDB, Memory)
60+
- Full compatibility with existing IPeerStore interface
61+
- Automatic persistence of all PeerData fields including last_identified, ttl, and latmap
62+
- Factory functions for easy creation with different backends
63+
- Comprehensive test suite and usage examples
64+
65+
The implementation follows the same architectural pattern as go-libp2p's pstoreds package,
66+
providing a robust foundation for long-running libp2p applications that need to maintain
67+
peer information across restarts. (`#946 <https://github.com/libp2p/py-libp2p/issues/946>`__)
68+
- Enhances the `libp2p`` stack with improved peer connection, relay routing, and discovery for resilient networking.
69+
70+
**Voucher and Signature Verification**
71+
- Implements voucher and signature verification in ``resources.py``
72+
- Validates incoming relay vouchers and signatures to ensure proper authorization
73+
- Prevents misuse of relay resources through secure validation
74+
75+
**Relay Selection Logic**
76+
- Implements initial relay selection logic in ``transport.py``
77+
- Uses basic selection strategies (first-available or round-robin) for relay dialing
78+
- Introduces sophisticated relay selection with scoring, latency-based metrics, and retry strategies
79+
80+
**DHT-based Peer Discovery**
81+
- Implements DHT-based peer discovery using the libp2p DHT
82+
- Enables dynamic location and connection to peers across the network
83+
84+
**Relay Reservation and Maintenance**
85+
- Implements reservation storage and refresh mechanism
86+
- Tracks active relay reservations and refreshes them before expiry
87+
- Supports long-lived relayed connections
88+
89+
**Relay Multiaddr Handling**
90+
- Adds ``/p2p-circuit/...`` addresses to peerstore for reconnects and discovery
91+
- Implements proper parsing and handling of relayed multiaddrs
92+
- Ensures correct validation and usage of ``/p2p-circuit/p2p/...`` paths during dialing
93+
94+
**CircuitV2Listener Implementation**
95+
- Implements ``run()`` method in ``CircuitV2Listener``
96+
- Finalizes listener logic to support incoming relayed connections
97+
98+
**Testing and Quality**
99+
- Adds dedicated tests for voucher and signature verification
100+
- Includes tests for initial and advanced relay selection logic
101+
- Covers DHT-based peer discovery functionality
102+
- Tests reservation storage and refresh mechanisms
103+
- Validates relay multiaddr handling and parsing
104+
- Tests ``CircuitV2Listener`` functionality
105+
- Maintains 100% test coverage across all new features
106+
- Resolves all linting issues and adheres to code quality standards
107+
- Ensures no regressions in existing functionality (`#996 <https://github.com/libp2p/py-libp2p/issues/996>`__)
108+
- Introduced ``get_transport_addrs()`` method to ``BasicHost`` for retrieving raw transport addresses without the peer ID suffix.
109+
Refactored ``get_addrs()`` to utilize this new method, maintaining backward compatibility. (`#1073 <https://github.com/libp2p/py-libp2p/issues/1073>`__)
110+
- Adds custom validator support and quorum-based value retrieval to the Kademlia DHT. (`#1095 <https://github.com/libp2p/py-libp2p/issues/1095>`__)
111+
112+
113+
Internal Changes - for py-libp2p Contributors
114+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115+
116+
- Enhanced QUIC Connection ID management with quinn-inspired improvements:
117+
- Added sequence number tracking for proper CID retirement ordering
118+
- Separated initial vs. established CID lookups for better packet routing
119+
- Improved fallback routing from O(n) to O(1) using reverse address mapping
120+
- Refactored Connection ID management into a dedicated ConnectionIDRegistry class
121+
122+
These changes improve robustness, performance, and alignment with proven QUIC implementations. (`#1044 <https://github.com/libp2p/py-libp2p/issues/1044>`__)
123+
- Refactored QUIC Connection ID management into a dedicated ConnectionIDRegistry class, improving code organization and maintainability of the QUIC listener. (`#1046 <https://github.com/libp2p/py-libp2p/issues/1046>`__)
124+
- Upgraded py-libp2p transport ping test to the latest standard. (`#1086 <https://github.com/libp2p/py-libp2p/issues/1086>`__)
125+
- Updated py-multihash dependency from git repository to PyPI version 3.0.0. (`#1102 <https://github.com/libp2p/py-libp2p/issues/1102>`__)
126+
127+
128+
Miscellaneous Changes
129+
~~~~~~~~~~~~~~~~~~~~~
130+
131+
- `#926 <https://github.com/libp2p/py-libp2p/issues/926>`__, `#1039 <https://github.com/libp2p/py-libp2p/issues/1039>`__
132+
133+
6134
py-libp2p v0.4.0 (2025-11-05)
7135
-----------------------------
8136

newsfragments/1020.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1034.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1037.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1039.misc.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1044.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1044.internal.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

newsfragments/1046.internal.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1059.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/1071.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)