Skip to content

Releases: libp2p/go-libp2p

Release v0.14.1

31 May 21:13
v0.14.1
f0d89c2
Compare
Choose a tag to compare

This release fixes a spec-breaking change to yamux (libp2p/go-libp2p-yamux#36) that could reliably lead to random stream resets.

The bug was introduced in go-libp2p 0.14.0.

Release v0.14.0

11 May 02:18
v0.14.0
035edd3
Compare
Choose a tag to compare

We're happy to announce go-libp2p 0.14.0. This release introduces a few long awaited features, fixes a few bugs, and includes progress towards NAT hole punching.

Custom DNS Resolvers

You can now pass a custom DNS resolver through the MultiaddrResolver option. This can be used to add support for DoH, custom TLDs (e.g., .eth), etc.

TCP Simultaneous Open

Adds initial support for TCP Simultaneous Open. If two peers open a TCP connection to each other at the same time using the same set of ports, they'll end up with a single TCP connection. Previously, go-libp2p would treat this as an error and disconnect. Now the connection succeeds. In the next libp2p release, this will be used to enable hole-punching for NAT traversal.

Improved Stream Multiplexer (Yamux) Performance

Yamux now uses variable sized receive windows to improve performance on high-latency, high-bandwidth connections.

Optimized Noise Read Throughput

The Noise security transport now buffers reads, reducing syscalls and significantly improving throughput.

Changelog

Read more

v0.13.0

19 Dec 09:27
577e752
Compare
Choose a tag to compare

v0.13.0 introduces a BREAKING interface change: MuxedConn.OpenStream and Conn.NewStream now both take a context.Context. This allows stream multiplexer implementations to unblock OpenStream when requested to do so.

Many stream multiplexers implement some kind of limit on how many streams can be opened at any given moment. This is a useful DoS protection against a peer that would open an unlimited number of streams. That means that opening a new stream might block if it's not possible to open a new stream at that moment.

Upgrade Path

Although breaking, this change is expected to cause little breakage in practice: Host.NewStream already takes a context.Context, which is now passed down to the stream multiplexer's OpenStream method. Only when using Conn.NewStream it will be necessary to add a context to that call.

0.12.0

12 Nov 04:54
v0.12.0
fcf6964
Compare
Choose a tag to compare

Libp2p 0.12.0 introduces a new BasicConnectionGater to filter inbound and outbound connections and makes a significant breaking change to the stream interfaces to remove some surprising behavior.

Connection Gater

The new BasicConnectionGater blocking connections to specific peers, IP addresses, and IP address subnets. These rules can optionally be persisted to a datastore.

To use this connection gater, pass it in to the libp2p constructor with the libp2p.ConnectionGater option.

Stream Interface Changes

BREAKING

This is release includes a significant BREAKING CHANGE to the stream interface.

Previously, Close() closed streams for writing, but left them open for reading. Unfortunately, this meant streams would not be garbage collected until either (a) an EOF had been read on the stream or (b) Reset had been called. While technically documented, this behavior was extraordinarily surprising and most libp2p applications end up misusing and leaking streams (leading to memory leaks).

In this release, Close now closes the stream for both reading and writing. Close will not wait for any form of acknowledgment. If acknowledgment is required, the caller must call CloseWrite (described below), then wait on the stream for a response (or an EOF), then call Close() to free the stream object.

To close the stream for writing only, the user should call CloseWrite(). Close write flushes any in-progress writes, then sends an EOF.

The user may now call CloseRead() to close the stream for reading only. CloseRead() will interrupt any in-progress reads with an error and prevent further reads from succeeding. At the protocol level, the behavior of CloseRead() is implementation defined.

  • Yamux and Mplex will throw away incoming data on a closed stream.
  • QUIC will return an error to the sender.

When done with a stream, the user must call either Close() or Reset() to discard the stream, even after calling CloseRead() and/or CloseWrite().

Upgrade Path

If you were using Close() as you would TCPConn.Close() or File.Close(), nothing needs to change. Previously this would have leaked resources but it will now work correctly.

If you were calling Close() intending to close the stream for writing but not for reading, call CloseWrite() instead.

If you were previously calling FullClose(stream), you should call stream.Close(). However, unlike FullClose(stream), stream.Close() will not wait for an EOF from the remote side.

If you need to close and wait to receive an EOF to confirm that all data was received, call stream.CloseWrite(), then call Read to wait for an EOF, then call stream.Close() to free the stream.

Removal of Stream Helpers

BREAKING

Previously, go-libp2p-core provided AwaitEOF and FullClose helpers to help work around the funky stream interfaces. These helper functions have been removed as any code using these helpers will likely need to be modified to work correctly with the new stream interfaces. Please see the upgrade path above for the stream interface changes.

Merged go-multiaddr and go-multiaddr-net

The github.com/multiformats/go-multiaddr-net package has been moved to github.com/multiformats/go-multiaddr/net. While we recommend updating imports, the types in go-multiaddr-net have been changed to type aliases to go-multiaddr/net so no user intervention is required.

v0.11.0

25 Aug 20:21
Compare
Choose a tag to compare

SECIO no longer supported by default

SECIO has been dropped as the default security transport #972. The default security transports support are now Noise and TLS, with Noise being preferred by default over TLS. Users can still choose to re-enable SECIO by passing libp2p.Security(secio.ID, secio.New) to the constructor.

If your network has peers that only support SECIO then those peers will be unable to talk to default constructed go-libp2p nodes.

Dependency updates

  • Support for parsing string multiaddrs that contain peerIDs represented as CIDs (e.g /p2p/k51abc... instead of only /p2p/Qmxyz...) #998
  • Better support for Plan9 #994

Fixes

  • Added parsing of IPv6 addresses for incoming mDNS requests #990

v0.10.3

04 Aug 09:26
Compare
Choose a tag to compare

bug fix release:

  • fix a function call loop between AutoNAT and the basic host (#989)

v0.10.2

30 Jul 12:04
aae9c77
Compare
Choose a tag to compare
  • upgrade go-libp2p-circuit to v0.3.1.

v0.10.1

30 Jul 11:46
a5786f0
Compare
Choose a tag to compare

This is a maintenance and bugfix release.

  • fix: avoid a close deadlock in the natmanager.
  • fix: address advertisement bugs.
  • fix: autonat public address advertisement.
  • fix: interoperable uvarint delimited writer/reader.
  • upgrade deps.

v0.10.0

16 Jun 18:47
985120b
Compare
Choose a tag to compare

This release bumps the versions of go-libp2p-core to v0.6.0 and go-libp2p-swarm to v0.2.7.

Conns and Streams now have a new ID() string method required by the upcoming introspection subsystem for go-libp2p.

v0.9.6

09 Jun 23:13
14f4ff5
Compare
Choose a tag to compare
  • Fixed basic host to use the correct addresses when nat port mapping
  • Updates yamux to reduce lock contention
  • Updates the peerstore to remove an issue where we'd forget our peer's addresses instead of extending the TTL