Releases: libp2p/go-libp2p
Release v0.14.1
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
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
- github.com/libp2p/go-libp2p:
- doc: add a basic release process (libp2p/go-libp2p#1080)
- fix: re-expose AutoNAT service on BasicHost (libp2p/go-libp2p#1088)
- test: deflake TestProtoDowngrade (libp2p/go-libp2p#1084)
- fix go vet (libp2p/go-libp2p#1075)
- option for custom dns resolver (libp2p/go-libp2p#1073)
- fix autonat race (libp2p/go-libp2p#1062)
- use transient connections in identify streams (libp2p/go-libp2p#1061)
- Emit event for User's NAT Type i.e. Hard NAT or Easy NAT (#1042) (libp2p/go-libp2p#1042)
- Finish and Test the simultaneous connect problem in libp2p peers (#1041) (libp2p/go-libp2p#1041)
- Close peerstore and document Host Close (#1037) (libp2p/go-libp2p#1037)
- Timeout all Identify stream reads (#1032) (libp2p/go-libp2p#1032)
- github.com/ipfs/go-datastore (v0.4.4 -> v0.4.5):
- Add test to ensure that Delete returns no error for missing keys (ipfs/go-datastore#162)
- Fix typo in sync/sync.go (ipfs/go-datastore#159)
- Add the generated flatfs stub, since it cannot be auto-generated (ipfs/go-datastore#158)
- support flatfs fuzzing (ipfs/go-datastore#157)
- Add standard issue template
- fuzzing harness (#153) (ipfs/go-datastore#153)
- feat(mount): don't give up on error (ipfs/go-datastore#146)
- /test: fix bad ElemCount/10 lenght (should not be divided) (ipfs/go-datastore#152)
- github.com/ipfs/go-log/v2 (v2.1.1 -> v2.1.3):
- feat: add ability to specify labels for all loggers (ipfs/go-log#105)
- Add an option to pass URL to zap (ipfs/go-log#101)
- enable configuring several log outputs (ipfs/go-log#98)
- Fix caller not being added (ipfs/go-log#96)
- github.com/libp2p/go-conn-security-multistream (v0.2.0 -> v0.2.1):
- update core version (#32) (libp2p/go-conn-security-multistream#32)
- Implement support for simultaneous open (#14) (libp2p/go-conn-security-multistream#14)
- github.com/libp2p/go-libp2p-autonat (v0.4.0 -> v0.4.2):
- Fix: Stream read timeout (libp2p/go-libp2p-autonat#99)
- fix: simplify address replacement (libp2p/go-libp2p-autonat#102)
- replace the port number for double NAT mapping (libp2p/go-libp2p-autonat#101)
- github.com/libp2p/go-libp2p-core (v0.8.0 -> v0.8.5):
- Event for user's NAT Device Type: Tell user if the node is behind an Easy or Hard NAT (#173) (libp2p/go-libp2p-core#173)
- more docs for stream fncs (#183) (libp2p/go-libp2p-core#183)
- refactor: use a helper type to decode AddrInfo from JSON (#178) (libp2p/go-libp2p-core#178)
- fix stream docs (#182) (libp2p/go-libp2p-core#182)
- context to force direct dial (#181) (libp2p/go-libp2p-core#181)
- Secure Muxer Interface (#180) (libp2p/go-libp2p-core#180)
- github.com/libp2p/go-libp2p-noise (v0.1.1 -> v0.2.0):
- Update github.com/flynn/noise to address nonce handling security issues (libp2p/go-libp2p-noise#95)
- optimize: reduce syscalls using a buffered reader.
- github.com/libp2p/go-libp2p-peerstore (v0.2.6 -> v0.2.7):
- fix: delete addrs when "updating" them to zero (libp2p/go-libp2p-peerstore#157)
- github.com/libp2p/go-libp2p-swarm (v0.4.0 -> v0.5.0):
- run connection gating tests on both TCP and QUIC (libp2p/go-libp2p-swarm#258)
- fix: avoid returning typed nils (libp2p/go-libp2p-swarm#257)
- New Dialer (libp2p/go-libp2p-swarm#243)
- fix: use 64bit stream/conn IDs (libp2p/go-libp2p-swarm#247)
- feat: close transports that implement io.Closer (libp2p/go-libp2p-swarm#227)
- fix swarm transient conn (#241) (libp2p/go-libp2p-swarm#241)
- Support for Hole punching (#233) (libp2p/go-libp2p-swarm#233)
- Treat transient connections as opt-in when opening new streams (libp2p/go-libp2p-swarm#236)
- avoid assigning a function to a variable (libp2p/go-libp2p-swarm#239)
- only listen on localhost in tests (libp2p/go-libp2p-swarm#238)
- prevent dialing addresses that we're listening on (libp2p/go-libp2p-swarm#237)
- Enable QUIC in Test Swarm (#235) (libp2p/go-libp2p-swarm#235)
- github.com/libp2p/go-libp2p-transport-upgrader (v0.4.0 -> v0.4.2):
- Expose underlying transport connection stat where available (libp2p/go-libp2p-transport-upgrader#71)
- Implement support for simultaneous open (#25) (libp2p/go-libp2p-transport-upgrader#25)
- github.com/libp2p/go-libp2p-yamux (v0.5.1 -> v0.5.3):
- chore: update yamux (libp2p/go-libp2p-yamux#34)
- chore: update yamux (libp2p/go-libp2p-yamux#33)
- github.com/libp2p/go-netroute (v0.1.3 -> v0.1.6):
- add js stub impl
- github.com/libp2p/go-sockaddr (v0.0.2 -> v0.1.1):
- fix: allocate "any" socket type then cast (libp2p/go-sockaddr#20)
- fix: remove CGO functions (libp2p/go-sockaddr#18)
- github.com/libp2p/go-yamux/v2 (v2.0.0 -> v2.1.1):
- fix: don't change the receive window if we're forcing an update (libp2p/go-yamux#56)
- increase the receive window size if we're sending updates to frequently (libp2p/go-yamux#54)
- remove unused Stream.Shrink() method (libp2p/go-yamux#52)
- remove misleading comment about the MaxMessageSize (libp2p/go-yamux#50)
- clean up the receive window check (libp2p/go-yamux#49)
- don't reslice byte slices taking from the buffer (libp2p/go-yamux#48)
- don't reimplement io.ReadFull (libp2p/go-yamux#38)
- remove the recvLock in the stream (libp2p/go-yamux#42)
- remove the sendLock in the stream (libp2p/go-yamux#41)
- remove misleading statement about NAT traversal (libp2p/go-yamux#45)
- reduce usage of goto (libp2p/go-yamux#40)
- remove unused error return value in Stream.processFlags ([libp2p/go-yamux#39](https://github.co...
v0.13.0
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
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
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
v0.10.2
v0.10.1
v0.10.0
v0.9.6
- 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