Skip to content

Releases: libp2p/go-libp2p

v0.32.0

27 Oct 13:50
4e2a16d
Compare
Choose a tag to compare

🔦 Highlights

WebRTC Direct

This release adds support for WebRTC Direct. WebRTC Direct allows browser nodes to connect to go-libp2p directly, without any configuration (e.g. TLS certificates) needed on the go-libp2p side. This is useful for browser nodes that aren’t able to use Webtransport. Note that WebRTC Direct cannot be used to connect a browser node to a go-libp2p node behind a NAT / firewall. This requires using WebRTC, which is currently being worked on #2009.

Happy Eyeballs for TCP

In the last couple of releases we’ve shipped Smart Dialing and Black hole Detection. This release continues our effort to improve the dial prioritisation logic to avoid spurious dials with the introduction of Happy Eyeballs for TCP addresses. As recommended by RFC 8305, when dialing a peer’s TCP addresses, we now dial the IPv6 address first and only dial the peer’s IPv4 address if we have not established the IPv6 TCP connection within 250ms.

Misc

  • host.NewStream now waits for a hole punched connection to be available rather than returning network.ErrTransientConn immediately.
  • go-libp2p now works on riscv64 architectures.

Changelog

New Contributors

Full Changelog: v0.31.0...v0.32.0

v0.31.0

30 Aug 16:24
87a8d4e
Compare
Choose a tag to compare

🔦 Highlights

libp2p+HTTP

We're introducing a new experimental API in go-libp2p, enabling developers to utilize libp2p with the well-known semantics of HTTP. This isn't a special flavor of HTTP; it's standard HTTP, but enhanced with libp2p. Developers can now benefit from HTTP intermediaries such as CDN caching and layer 7 load balancing. This allows developers to create HTTP applications that operate over NATs and seamlessly tap into libp2p's diverse transport options to boost connectivity. In addition, the HTTP transport now joins the roster of supported transports in libp2p.

The new API is under libp2phttp.Host in the "github.com/libp2p/go-libp2p/p2p/http" package. This is like the stream transport host (host.Host in "github.com/libp2p/go-libp2p/core/host"), but exposes HTTP request/response rather than a stream API. Refer to the godoc for details on the API and examples.

QUIC Generic Segmentation Offload

This release updates quic-go to v0.38.x, which enables GSO (Generic Segmentation Offload) in the send path, drastically increasing the packet send rate. Without GSO, quic-go had to use a single sendmsg syscall for every UDP datagram sent. GSO allows us to pass one giant (up to 64k) datagram to the sendmsg syscall, and have the kernel chop it into MTU sized (~1300 bytes) datagrams before sending them out on the wire. For more details on syscall optimizations, CloudFlare published an excellent blog post about this a while ago. GSO is currently only available on Linux (and with kernels >4.18).

Changelog

Full Changelog: v0.30.0...v0.31.0

v0.30.0

29 Aug 05:55
37319a6
Compare
Choose a tag to compare

This is the first release that is compatible with Go 1.21. It drops compatibility with (the now outdated) Go 1.19.

Deprecation of the database-backed peerstore

The database-backed peerstore, pstoreds, is now deprecated. It will be removed in a future release of go-libp2p.
The main reason for a database-backed peerstore was that it easily allowed persisting peers across reboots of a go-libp2p node. However, this comes with the problem that entries for these peers will never be pruned. It also means significantly higher latencies compared to the in-memory peerstore. A better way of persisting (a subset of) peers for bootstrapping purposes is to regularly query the in-memory peerstore and to explicitly persist those entries.
See #2329 for more motivation and discussion.

Removal of mplex

The ecosystem is in the process of removing support for one of our stream multiplexers, mplex. The only supported stream multiplexer now is yamux. Kubo (a go-libp2p user) removed support for mplex recently. See libp2p/specs#553 for more details.

Note that due to go-libp2p's modular design, it's still possible to use mplex (or any other custom multiplexer) using the libp2p.Muxer configuration option.

Removal of QUIC draft-29

QUIC draft-29 was a somewhat widely deployed draft version of QUIC before publication of RFC 9000. The multiaddr codepoint used /quic (RFC 9000 QUIC uses /quic-v1). go-libp2p has been using /quic-v1 for a long time (since v0.24.0), and is now dropping support for draft-29.

Full Changelog

Contributors

Contributor Commits Lines ± Files Changed
Marco Munizaga 5 +405/-561 36
Marten Seemann 12 +302/-477 92
Sukun 4 +125/-52 6
Jorropo 5 +83/-28 13
Prem Chaitanya Prathi 1 +28/-1 2
GitHub 2 +6/-19 2
Prithvi Shahi 1 +10/-12 1
Christian Stewart 1 +7/-2 2
cce 1 +4/-4 3
downIoads 1 +2/-2 1

New Contributors

Full Changelog: v0.29.0...v0.30.0

v0.29.2

07 Aug 23:39
Compare
Choose a tag to compare

What's Changed

  • Updates quic-go to v0.36.4

Full Changelog: v0.29.1...v0.29.2

v0.28.3

07 Aug 23:38
Compare
Choose a tag to compare

What's Changed

  • Updates quic-go to v0.33.1

Full Changelog: v0.28.2...v0.28.3

v0.27.9

07 Aug 23:38
Compare
Choose a tag to compare

What's Changed

  • Update quic-go to v0.33.1

Full Changelog: v0.27.8...v0.27.9

v0.27.8

04 Aug 00:00
Compare
Choose a tag to compare

This patch release contains backports of:

  • updating the qtls dependencies (qtls is quic-go's fork of crypto/tls). The new versions now contain a backport of the Go standard library fix included in the Go 1.20.7 / 1.19.12 release for quic-go's crypto/tls fork: golang/go@2350afd
  • core/crypto: restrict RSA keys to <= 8192 bits: #2454. The analogous vulnerability in go-libp2p's crypto package.
  • swarm: don't open new streams over transient connections: #2450. This fixes a regression introduced in v0.26.0.

Note that in order to be protected against the DoS attack making use of large RSA keys, it's necessary to update to this patch release AND to use the updated Go compiler (1.20.7 or 1.19.12, respectively).

Full Changelog: v0.27.7...v0.27.8

v0.29.1

03 Aug 21:28
Compare
Choose a tag to compare

This patch release contains backports of:

  • update quic-go to v0.36.3, fixing RSA key size vulnerability: #2455. This in turn is a backport of the Go standard library fix included in the Go 1.20.7 / 1.19.12 release for quic-go's crypto/tls fork: golang/go@2350afd
  • core/crypto: restrict RSA keys to <= 8192 bits: #2454. The analogous vulnerability in go-libp2p's crypto package.
  • swarm: don't open new streams over transient connections: #2450. This fixes a regression introduced in v0.26.0.

Note that in order to be protected against the DoS attack making use of large RSA keys, it's necessary to update to this patch release AND to use the updated Go compiler (1.20.7 or 1.19.12, respectively).

Full Changelog: v0.29.0...v0.29.1

v0.28.2

03 Aug 21:27
Compare
Choose a tag to compare

This patch release contains backports of:

  • updating the qtls dependencies (qtls is quic-go's fork of crypto/tls). The new versions now contain a backport of the Go standard library fix included in the Go 1.20.7 / 1.19.12 release for quic-go's crypto/tls fork: golang/go@2350afd
  • core/crypto: restrict RSA keys to <= 8192 bits: #2454. The analogous vulnerability in go-libp2p's crypto package.
  • swarm: don't open new streams over transient connections: #2450. This fixes a regression introduced in v0.26.0.

Note that in order to be protected against the DoS attack making use of large RSA keys, it's necessary to update to this patch release AND to use the updated Go compiler (1.20.7 or 1.19.12, respectively).

Full Changelog: v0.28.1...v0.28.2

v0.29.0

14 Jul 17:40
636a096
Compare
Choose a tag to compare

⚠️ Warning

Be warned if you run go get -u github.com/libp2p/go-libp2p the Go toolchain will incorrectly update github.com/quic-go/qtls-go1-20 to an incompatible version of v0.3.0 (at v0.* everything may change according to semver). You may have to downgrade github.com/quic-go/qtls-go1-20 to v0.2.2 manually.

It's recommended to do go get github.com/libp2p/go-libp2p instead.

🔦 Highlights

Smart Dialing

In our last release, we shipped Smart Dialing. To reiterate, it’s a clever way to reduce the number of spurious dials. Instead of dialing all addresses in parallel (which is what we did before v0.28), we now carefully rank the addresses and dial them one by one.

However, there were two areas where the logic we introduced could lead to suboptimal results:

  • There are some networks that block UDP. This means that we won’t be able to dial any QUIC or WebTransport connections at all. This is problematic since our smart dialing logic dials a QUIC address first before dialing a TCP address, which would lead to a regression for these users.
  • Similarly, not all ISPs support IPv6 yet. This is problematic as well, since we prefer IPv6 addresses over IPv4.

This is why smart dialing was disabled by default in v0.28.

For this release, we implemented a logic we call Black Hole Detection in this release. We now detect if UDP or IPv6 is completely blocked (blackholed) by observing the outcomes of dial attempts. When a black hole is detected, we skip QUIC / WebTransport and IPv6 addresses, respectively. This significantly reduces the number of unsuccessful dials for users in these environments. To monitor the status of black hole detection, we added two Grafana dashboards to our swarm dashboard, showing the percentage successful / failed dials on UDP and IPv6, and if that leads to our blackhole logic kicking in.

This now allows us to use RFC8305 Happy Eyballs for QUIC: When we dial a peer that has a QUIC IPv6 and IPv4 address, we dial the IPv6 address first, and only start dialing the IPv4 address if we haven’t heard back from the peer within 250ms. Only if we don’t hear back within another 250ms, we start dialing on TCP.

In a future release, we will enable a similar logic for TCP IPv6 and IPv4 addresses, however, this will require us to refactor our code a bit (see #2394 for details).

Preliminary measurements on the IPFS network show that:

  • In ~90% of the cases, we end up with a connection on the first address we dial.
  • Canceled connection attempts are reduced by more than 60% (compared to the v0.27 release).

Smart Dialing is now enabled by default. We don’t expect it to cause any performance regression, but if you find any problems, please open an issue. It can be disabled via a constructor option to libp2p.New:

libp2p.SwarmOpts(swarm.WithDialRanker(swarm.NoDelayDialRanker))

Metrics

  • It's now possible to spin up a local Grafana dashboards - with all libp2p dashboards imported and ready to go - by just running docker-compose up in the dashboards directory: #2383.
  • Resource Manager metrics are now enabled by default: #2370.

Changelog

Read more