Go-Libp2p 0.6.0

Go-Libp2p 0.6.0

This release includes several important changes you should be aware of.

PrivateNetwork Option [BREAKING]

The PrivateNetwork option has changed to directly take a pre-shared key. This option used to take an object implementing the protector interface. Unfortunately, the protector interface assumes stream transports and doesn’t extend well to packet-based transports like QUIC.

When you upgrade, you’ll need to use github.com/libp2p/go-libp2p-core/pnet.DecodeV1PSK to decode your pre-shared key, then pass this key into libp2p using the libp2p.PrivateNetwork option.

Write Coalescing

In this release, stream multiplexers now coalesce multiple writes from multiple streams into a single write to the underlying transport. This slightly increases packet latency but significantly reduces the number of packets libp2p sends which should improve performance and reduce bandwidth overall.

Unfortunately, this optimization that will crash peers running go-libp2p versions prior to v0.0.20 (April 2019) and go-ipfs versions prior to 0.4.21 (May 2019).

Address Advertisements

Libp2p no longer advertises localhost addresses to peers not running on localhost. This could, in theory, make it harder to dial a peer on the same host. However, this should never be an issue in real-world scenarios.

Zap Logging

Libp2p has switched to the zap logging backend by default. To get JSON-encoded Zap logging output, set the GOLOG_LOG_FMT=json environment variable.

QUIC

The libp2p QUIC transport (not enabled by default) now implements QUIC draft 27. We expect this to be the final draft before we stabilize and enable this transport by default.

2 Likes