v0.24.0
Breaking Changes
Constructor options
- removed the deprecated
libp2p.DefaultStaticRelays
andlibp2p.StaticRelays
options. Static relays can be configured as an option tolibp2p.EnableAutoRelay
libp2p.Security
now requires passing in a constructor (previously, it also allowed passing in a fully constructed security transport)libp2p.Muxer
now requires passing in a fully constructed muxer (previously, it also allowed passing in a muxer constructor)- Removed
libp2pquic.DisableReuseport
andlibp2pquic.WithMetrics
. These options are now available in thequicreuse
package (quicreuse.DisableReuseport
andquicreuse.WithMetrics
), and can be enabled by using thelibp2p.QUICReuse
option (example:libp2p.QUICReuse(quicreuse.NewConnManager, quicreuse.DisableReuseport, quicreuse.WithMetrics)
).
Under the hood, we now use fx in the construction of the host, which lead to a great simplification of our setup logic (see #1858 for details).
QUIC Versions
When we first rolled out QUIC support in 2020, QUIC wasn't an RFC yet (in fact, we were involved in the standardization process at the IETF!). Back then, we rolled out support for QUIC draft-29. This version is almost identical to RFC 9000, so there was never a good reason to force an update.
Now that rust-libp2p is shipping QUIC support, we decided to finally initiate the update. We do so by introducing a new multiaddress component: /ip4/1.2.3.4/udp/4001/quic
now denotes a multiaddr that uses QUIC draft-29 (as it has before, we're just making it explicit now). QUIC v1 would use /ip4/1.2.3.4/udp/4001/quic-v1
.
We intend to keep support for QUIC draft-29 for roughly half a year, and disable listening on draft-29 addresses after that.
Depending on how you configure your node, you might need to update the addresses you're listening on (i.e. change quic => quic-v1
in the addresses, or duplicate the QUIC addresses).
🔦 Highlights
WebTransport
We added experimental WebTransport support in our last release. Since then, we're using some magic to allow running QUIC and WebTransport on the same port. This means that users who've already configured port forwarding / firewall rules for QUIC don't need to do anything to allow WebTransport connections to their node.
Optimized Stream Multiplexer Selection
When dialing a TCP connection to another libp2p node, we perform the following steps:
- TCP 3-way handshake: 1 RTT
- multistream-select to negotiate the security protocol (TLS 1.3 or Noise): 1 RTT
- security handshake: 1 RTT
- multistream-select to negotiate the stream multiplexer (yamux or mplex)
In total, this handshakes takes 4 RTTs. In this release, we optimize this handshake by inlining the stream multiplexer negotiation into the security handshake. On the wire, this looks very different for TLS 1.3 and for Noise, but the result is the same: we know which stream multiplexer to use when the handshake finishes, and can therefore save one roundtrip on every handshake. Head to the specification to learn how this works in detail.
🐞 Bugfixes since v0.23.4
Changelog
- github.com/libp2p/go-libp2p:
- release v0.24.0 (#1934) (libp2p/go-libp2p#1934)
- chore: update deps (#1932) (libp2p/go-libp2p#1932)
- ci: fix path to interop test plan composition file (#1933) (libp2p/go-libp2p#1933)
- Disable support for signed/static TLS certificates in WebTransport (#1927) (libp2p/go-libp2p#1927)
- webtransport: add PSK to constructor, and fail if it is used (#1929) (libp2p/go-libp2p#1929)
- use a different set of default transports when PSK is enabled (#1921) (libp2p/go-libp2p#1921)
- transport.Listener,quic: Support multiple QUIC versions with the same Listener. Only return a single multiaddr per listener. (#1923) (libp2p/go-libp2p#1923)
- chore: update webtransport-go to get fix (#1924) (libp2p/go-libp2p#1924)
- quic / webtransport: make it possible to listen on the same address / port (#1905) (libp2p/go-libp2p#1905)
- autorelay: fix flaky TestReconnectToStaticRelays (#1903) (libp2p/go-libp2p#1903)
- swarm / rcmgr: synchronize the concurrent outbound dials with limits (#1898) (libp2p/go-libp2p#1898)
- add QUIC v1 addresses to the default listen addresses (#1914) (libp2p/go-libp2p#1914)
- webtransport: update webtransport-go to v0.3.0 (#1895) (libp2p/go-libp2p#1895)
- tls: fix flaky TestHandshakeConnectionCancellations test (#1896) (libp2p/go-libp2p#1896)
- holepunch: disable the resource manager in tests (#1897) (libp2p/go-libp2p#1897)
- transports: expose the name of the transport in the ConnectionState (#1911) (libp2p/go-libp2p#1911)
- respect the user's security protocol preference order (libp2p/go-libp2p#1912)
- circuitv2: disable the resource manager in tests (#1899) (libp2p/go-libp2p#1899)
- expose the security protocol on the ConnectionState (libp2p/go-libp2p#1907)
- Update go-netroute so that we get the correct priority of routes (#1902) (libp2p/go-libp2p#1902)
- fix: autorelay: treat static relays as just another peer source (#1875) (libp2p/go-libp2p#1875)
- feat: quic,webtransport: enable both quic-draft29 and quic-v1 addrs on quic. only quic-v1 on webtransport (#1881) (libp2p/go-libp2p#1881)
- holepunch: add multiaddress filter (#1839) (libp2p/go-libp2p#1839)
- README: remove broken links from table of contents (#1893) (libp2p/go-libp2p#1893)
- quic: update quic-go to v0.31.0 (#1882) (libp2p/go-libp2p#1882)
- add an integration test for muxer selection (libp2p/go-libp2p#1887)
- core/network: fix typo
- tls / noise: prefer the client's muxer preferences (libp2p/go-libp2p#1888)
- upgrader: absorb the muxer_multistream.Transport into the upgrader (#1885) (libp2p/go-libp2p#1885)
- Apply service peer default (#1878) (libp2p/go-libp2p#1878)
- webtransport: use deterministic TLS certificates (#1833) (libp2p/go-libp2p#1833)
- remove deprecated StaticRelays option (#1868) (libp2p/go-libp2p#1868)
- autorelay: remove the default static relay option (#1867) (libp2p/go-libp2p#1867)
- core/protocol: remove deprecated Negotiator.NegotiateLazy (#1869) (libp2p/go-libp2p#1869)
- config: use fx dependency injection to construct transports (libp2p/go-libp2p#1858)
- noise: add an option to allow unknown peer ID in SecureOutbound (#1823) (libp2p/go-libp2p#1823)
- Add some guard rails and docs (#1863) (libp2p/go-libp2p#1863)
- Fix concurrent map access in connmgr (#1860) (libp2p/go-libp2p#1860)
- fix: return filtered addrs (#1855) (libp2p/go-libp2p#1855)
- chore: preallocate slices (#1842) (libp2p/go-libp2p#1842)
- Close ping stream when we exit the loop (#1853) (libp2p/go-libp2p#1853)
- tls: don't set the deprecated tls.Config.PreferServerCipherSuites field (#1845) (libp2p/go-libp2p#1845)
- routed host: search for new multi addresses upon connect failure (#1835) (libp2p/go-libp2p#1835)
- core/peerstore: removed unused provider addr ttl constant (#1848) (libp2p/go-libp2p#1848)
- basichost: improve protocol negotiation debug message (#1846) (libp2p/go-libp2p#1846)
- noise: use Noise Extension to negotiate the muxer during the handshake (#1813) (libp2p/go-libp2p#1813)
- webtransport: use the rcmgr to control flow control window increases (libp2p/go-libp2p#1832)
- chore: update quic-go to v0.30.0 (#1838) (libp2p/go-libp2p#1838)
- roadmap: reorder priority, reorganize sections (#1831) (libp2p/go-libp2p#1831)
- websocket: set the HTTP host header in WSS(#1834) (libp2p/go-libp2p#1834)
- webtransport: make it possible to record qlogs (controlled by QLOGDIR env) (libp2p/go-libp2p#1828)
- ipfs /api/v0/id is post (#1819) (libp2p/go-libp2p#1819)
- examples: connect to all peers in example mdns chat app (#1798) (libp2p/go-libp2p#1798)
- roadmap: fix header level on "Mid Q4" (#1818) (libp2p/go-libp2p#1818)
- examples: use circuitv2 in relay example (#1795) (libp2p/go-libp2p#1795)
- add a roadmap for the next 6 months (#1784) (libp2p/go-libp2p#1784)
- tls: use ALPN to negotiate the stream multiplexer (#1772) (libp2p/go-libp2p#1772)
- tls: add tests for test vector from the spec (#1788) (libp2p/go-libp2p#1788)
- examples: update go-libp2p to v0.23.x (#1803) (libp2p/go-libp2p#1803)
- Try increasing timeouts if we're in CI for this test (#1796) (libp2p/go-libp2p#1796)
- Don't use rcmgr in this test (#1799) (libp2p/go-libp2p#1799)
- Bump timeout in CI for flaky test (#1800) (libp2p/go-libp2p#1800)
- Bump timeout in CI for flaky test (#1801) (libp2p/go-libp2p#1801)
- Fix comment in webtransport client auth handshake (#1793) (libp2p/go-libp2p#1793)
- examples: add basic pubsub-with-rendezvous example (#1738) (libp2p/go-libp2p#1738)
- quic: speed up the stateless reset test case (#1778) (libp2p/go-libp2p#1778)
- tls: fix flaky handshake cancellation test (#1779) (libp2p/go-libp2p#1779)
- release v0.23.2 (#1781) (libp2p/go-libp2p#1781)
- chore: update webtransport-go to v0.1.1 (#1776) (libp2p/go-libp2p#1776)
- webtransport: return error before wrapping opened / accepted streams (#1775) (libp2p/go-libp2p#1775)
- release v0.23.1 (#1773) (libp2p/go-libp2p#1773)
- websocket: fix nil pointer in tlsClientConf (#1770) (libp2p/go-libp2p#1770)
- github.com/libp2p/go-netroute (v0.2.0 -> v0.2.1):
- v0.2.1 (libp2p/go-netroute#27)
- fix(phys-addr-length): fix physical address length mismatch (libp2p/go-netroute#29)
- compare priority if route rule's dst mask is same size
- compare priority if route rule's dst mask is same size
- chore: Update .github/workflows/stale.yml [skip ci]
- github.com/lucas-clemente/quic-go (v0.29.0 -> v0.31.0):
- introduce a type for the stateless reset key (#3621) (lucas-clemente/quic-go#3621)
- limit the exponential PTO backoff to 60s (#3595) (lucas-clemente/quic-go#3595)
- expose the QUIC version of a connection (#3620) (lucas-clemente/quic-go#3620)
- expose function to convert byte slice to a connection ID (#3614) (lucas-clemente/quic-go#3614)
- use
go run
for mockgen, goimports and ginkgo (#3616) (lucas-clemente/quic-go#3616) - fix client SNI handling (#3613) (lucas-clemente/quic-go#3613)
- chore: fix multiple typos in comments (#3612) (lucas-clemente/quic-go#3612)
- use the new zero-allocation control message parsing function from x/sys (#3609) (lucas-clemente/quic-go#3609)
- http3: add support for parsing and writing HTTP/3 capsules (#3607) (lucas-clemente/quic-go#3607)
- http3: add request to response (#3608) (lucas-clemente/quic-go#3608)
- fix availability signaling of the send queue (#3597) (lucas-clemente/quic-go#3597)
- http3: add a ConnectionState method to the StreamCreator interface (#3600) (lucas-clemente/quic-go#3600)
- http3: add a Context method to the StreamCreator interface (#3601) (lucas-clemente/quic-go#3601)
- rename the variable in quic.Config.AllowConnectionWindowIncrease (#3602) (lucas-clemente/quic-go#3602)
- fix usage of deprecated Ginkgo flag
- update qpack to v0.3.0 (#3593) (lucas-clemente/quic-go#3593)
- fix version of Ginkgo installed on CI (#3591) (lucas-clemente/quic-go#3591)
- migrate to Ginkgo v2, remove benchmark test (lucas-clemente/quic-go#3589)
- don't drop more than 10 consecutive packets in drop test (#3584) (lucas-clemente/quic-go#3584)
- use a monotonous timer for the connection (#3570) (lucas-clemente/quic-go#3570)
- http3: add http3.Server.ServeQUICConn to serve a single QUIC connection (#3587) (lucas-clemente/quic-go#3587)
- http3: expose ALPN values (#3580) (lucas-clemente/quic-go#3580)
- log the size of buffered packets (#3571) (lucas-clemente/quic-go#3571)
- ackhandler: reject duplicate packets in ReceivedPacket (#3568) (lucas-clemente/quic-go#3568)
- update qtls to versions that include the ec_point_formats fix (#3583) (lucas-clemente/quic-go#3583)
- reduce max DATAGRAM frame size, so that DATAGRAMs fit in IPv6 packets (#3581) (lucas-clemente/quic-go#3581)
- use a Peek / Pop API for the datagram queue (#3582) (lucas-clemente/quic-go#3582)
- http3: handle ErrAbortHandler when the handler panics (#3575) (lucas-clemente/quic-go#3575)
- http3: fix double close of chan when using DontCloseRequestStream (#3561) (lucas-clemente/quic-go#3561)
- qlog: rename key_retired to key_discarded (#3463) (lucas-clemente/quic-go#3463)
- simplify packing of ACK-only packets (lucas-clemente/quic-go#3545)
- use a sync.Pool for ACK frames (lucas-clemente/quic-go#3547)
- prioritize sending ACKs over sending new DATAGRAM frames (#3544) (lucas-clemente/quic-go#3544)
- http3: reduce usage of bytes.Buffer (#3539) (lucas-clemente/quic-go#3539)
- use a single bytes.Reader for frame parsing (#3536) (lucas-clemente/quic-go#3536)
- split code paths for packing 0-RTT and 1-RTT packets in packet packer (#3540) (lucas-clemente/quic-go#3540)
- remove the wire.ShortHeader in favor of more return values (#3535) (lucas-clemente/quic-go#3535)
- preallocate the message buffers of the ipv4.Message passed to ReadBatch (#3541) (lucas-clemente/quic-go#3541)
- introduce a separate code paths for Short Header packet handling (lucas-clemente/quic-go#3534)
- fix usage of ackhandler.Packet pool for non-ack-eliciting packets (#3538) (lucas-clemente/quic-go#3538)
- return an error when parsing a too long connection ID from a header (#3533) (lucas-clemente/quic-go#3533)
- speed up marshaling of transport parameters (#3531) (lucas-clemente/quic-go#3531)
- use a struct containing an array to represent Connection IDs (lucas-clemente/quic-go#3529)
- reduce allocations of ackhandler.Packet (lucas-clemente/quic-go#3525)
- serialize frames by appending to a byte slice, not to a bytes.Buffer (lucas-clemente/quic-go#3530)
- fix datagram RFC number in documentation for quic.Config (#3523) (lucas-clemente/quic-go#3523)
- add DPLPMTUD (RFC 8899) to list of supported RFCs in README (#3520) (lucas-clemente/quic-go#3520)
- use the null tracers in the tracer integration tests (#3528) (lucas-clemente/quic-go#3528)
- github.com/marten-seemann/qpack (v0.2.1 -> v0.3.0):
- update to Ginkgo v2 (#30) (marten-seemann/qpack#30)
- return write error when encoding header fields (#28) (marten-seemann/qpack#28)
- update Go versions (#29) (marten-seemann/qpack#29)
- remove CircleCI build status from README
- add link to QPACK RFC to README
- update Go versions on GitHub Actions (#26) (marten-seemann/qpack#26)
- remove build constraint from fuzzer (marten-seemann/qpack#24)
- update golangci-lint to v1.36 (marten-seemann/qpack#25)
- github.com/marten-seemann/webtransport-go (v0.1.0 -> v0.4.1):
- release v0.4.1 (#52) (marten-seemann/webtransport-go#52)
- release session mutex when an error occurs when closing (#51) (marten-seemann/webtransport-go#51)
- release v0.4.0 (#48) (marten-seemann/webtransport-go#48)
- add a Server.ServeQUICConn method (#47) (marten-seemann/webtransport-go#47)
- release v0.3.0 (#46) (marten-seemann/webtransport-go#46)
- read and write CLOSE_WEBTRANSPORT_SESSION capsules (marten-seemann/webtransport-go#40)
- implement the SetDeadline method on the stream (#44) (marten-seemann/webtransport-go#44)
- expose the QUIC stream ID on the stream interfaces (#43) (marten-seemann/webtransport-go#43)
- release v0.2.0 (#38) (marten-seemann/webtransport-go#38)
- expose quic-go's connection tracing ID on the Session.Context (#35) (marten-seemann/webtransport-go#35)
- add a ConnectionState method to the Session (#33) (marten-seemann/webtransport-go#33)
- chore: update quic-go to v0.30.0 (#36) (marten-seemann/webtransport-go#36)
- fix interop build (#37) (marten-seemann/webtransport-go#37)
- rename session receiver variable (#34) (marten-seemann/webtransport-go#34)
- fix double close of chan when using DontCloseRequestStream (#30) (marten-seemann/webtransport-go#30)
- add a simple integration test using Selenium and a headless Chrome (#28) (marten-seemann/webtransport-go#28)
- use a generic accept queue for uni- and bidirectional streams (#26) (marten-seemann/webtransport-go#26)
- github.com/multiformats/go-base36 (v0.1.0 -> v0.2.0):
- v0.2.0
- fix link to documentation (#9) (multiformats/go-base36#9)
- Address
staticcheck
issue (multiformats/go-base36#5) - Feat/fasterer (multiformats/go-base36#4)
- github.com/multiformats/go-multiaddr (v0.7.0 -> v0.8.0):
- release v0.8.0 (multiformats/go-multiaddr#187)
- Add quic-v1 component (multiformats/go-multiaddr#186)
- github.com/multiformats/go-multicodec (v0.6.0 -> v0.7.0):
- feat: update ./multicodec/table.csv (multiformats/go-multicodec#71)
- github.com/multiformats/go-varint (v0.0.6 -> v0.0.7):
- v0.0.7 (multiformats/go-varint#18)
- feat: optimize decoding (#15) (multiformats/go-varint#15)
- fix staticcheck (multiformats/go-varint#9)
- tests for unbounded uvarint streams. (multiformats/go-varint#7)
Contributors
Contributor | Commits | Lines ± | Files Changed |
---|---|---|---|
Marten Seemann | 234 | +89579/-22390 | 1676 |
Marco Munizaga | 23 | +1896/-702 | 96 |
Scott Martin | 1 | +1681/-0 | 5 |
Marcin Rataj | 2 | +708/-505 | 5 |
julian88110 | 2 | +435/-66 | 28 |
Dennis Trautwein | 3 | +230/-21 | 7 |
Prithvi Shahi | 1 | +116/-77 | 1 |
Daniel Vernall | 1 | +92/-45 | 2 |
Peter Rabbitson | 4 | +59/-65 | 5 |
Christian Stewart | 2 | +74/-46 | 10 |
Chinmay Kousik | 1 | +64/-14 | 6 |
kixelated | 1 | +31/-44 | 8 |
snyh | 2 | +36/-18 | 2 |
Karthik Nallabolu | 1 | +17/-17 | 1 |
Steven Allen | 1 | +28/-4 | 2 |
cliffc-spirent | 1 | +25/-5 | 2 |
Raúl Kripalani | 1 | +29/-0 | 1 |
Ondrej Kokes | 1 | +25/-4 | 2 |
Håvard Anda Estensen | 1 | +9/-19 | 6 |
libp2p-mgmt-read-write[bot] | 1 | +26/-0 | 1 |
shade34321 | 1 | +21/-1 | 2 |
Toby | 2 | +9/-13 | 6 |
Will Scott | 1 | +7/-12 | 3 |
Oleg | 1 | +14/-1 | 1 |
maxos | 1 | +8/-1 | 2 |
Stojan Dimitrovski | 1 | +6/-0 | 1 |
Rod Vagg | 2 | +2/-2 | 2 |
Michele Mastrogiovanni | 1 | +2/-2 | 1 |
Max Inden | 1 | +1/-1 | 1 |
Masih H. Derkani | 1 | +0/-2 | 1 |
Jc0803kevin | 1 | +1/-1 | 1 |
David Brouwer | 1 | +2/-0 | 2 |
Will | 1 | +0/-1 | 1 |
Neel Virdy | 1 | +1/-0 | 1 |