Skip to content

Releases: libp2p/go-libp2p

v0.43.0

07 Aug 15:32
b75e678
Compare
Choose a tag to compare

Highlights

This is a small release to allow users to upgrade to the latest quic-go version as the quic-go API was changed heavily in quic-go v0.53

What's Changed

Full Changelog: v0.42.0...v0.43.0

v0.42.1

30 Jul 14:55
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.41.0...v0.42.1

v0.42.0

18 Jun 16:18
000582c
Compare
Choose a tag to compare

⚠ Breaking Changes

Added a new method, VerifySourceAddress(net.Addr) bool, to the Resource Manager interface.
For more details see the Source Address Verification section.

For custom implementation which want to opt out of Source Address Verification and keep the existing behavior, return false from the method.

🔦 Highlights

Per Address Reachability via AutoNAT v2

libp2p hosts can now determine reachability for individual addresses using AutoNATV2. To opt in to reachability checking use the EnableAutoNATV2 libp2p option. Using this nodes can now determine their IPv4, IPv6, and browser address reachability separately. In a future release, AutoRelay will use this information and make appropriate relay reservations accordingly. https://pkg.go.dev/github.com/libp2p/go-libp2p#EnableAutoNATv2

To query addresses by their reachability, ConfirmedAddrs() (reachable, unreachable, unknown []ma.Multiaddr) that provides Reachability information per host address. https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/host/basic#BasicHost.ConfirmedAddrs
For notifications, Subscribe to the event event.EvtHostReachableAddrsChanged https://pkg.go.dev/github.com/libp2p/go-libp2p/core/event#EvtHostReachableAddrsChanged

Rate Limiting

We've introduced the package github.com/libp2p/go-libp2p/x/rate for rate limiting. The struct rate.Limiter provides Global, Network Specific, and Subnet Specific rate limiting. The Subnet specific rate limits allows for better DoS Protection by rate limiting malicious IPs. https://pkg.go.dev/github.com/libp2p/go-libp2p/x/rate

Use Limit(f func(s network.Stream)) func(s network.Stream) on Limiter to limit specific stream handlers. For example, within libp2p, the Identify Service uses this as
ids.Host.SetStreamHandler(IDPush, ids.rateLimiter.Limit(ids.handlePush)) to rate limit the number of times peers can perform identify push.

For non Stream use cases use the Allow(ip) method on the limiter.

Connection Rate Limiting

New connection requests are now rate limited per IP. By default we allow 1 connection every 5 seconds from an IP address with a burst of 16 connections per IP. The burst is high enough that this should only block malicious peers.

To configure the connection rate limits, use the WithConnRateLimiters option on the Resource Manager. https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/host/resource-manager#WithConnRateLimiters

Source Address Verification for QUIC

This release introduces Source Address Verification for QUIC, preventing DoS attacks by spoofing IP addresses. See: https://www.rfc-editor.org/rfc/rfc9000.html#section-8 for details.

We are now gating incoming QUIC connections before the handshake is started. This further improves DoS protection by not wasting CPU on handshaking QUIC connections which would have been dropped by the Resource Manager.

Other changes

  • WebRTC Direct peers can now send messages of up to 256 kB (see spec: libp2p/specs#628)
  • Refactored the addressing code within BasicHost and moved it into Address Manager. In a future release, this will be exposed to users with an improved Address API for the libp2p Host.

What's Changed

New Contributors

Full Changelog: v0.41.0...v0.42.0

v0.41.1

24 Mar 18:51
Compare
Choose a tag to compare

What's Changed

7059eb5 conngater: fix incorrect err return value (#3219)
74c6860 fix(libp2phttp): bound NewStream timeout (#3225)
ccc4849 webrtc: fix memory leak with udpmux.muxedConnection context (#3243)
99a511f connmgr: fix transport association bug (#3221)
eb3ff9f autonatv2: fix server dial data request policy (#3247)
8ce45df Release v0.41.1

Full Changelog: v0.41.0...v0.41.1

v0.41.0

25 Feb 19:19
578af0c
Compare
Choose a tag to compare

⚠︎ Breaking Changes

🔦 Highlights

Overall this is a fairly minor release focused on supporting the go-multiaddr v0.15.0.

  • Update to go-multiaddr v0.15. This is a pretty big release for go-multiaddr that should make it harder to misuse. See the v0.15.0 release notes for breaking changes: https://github.com/multiformats/go-multiaddr/releases/tag/v0.15.0
  • Uniform HTTP Peer ID Auth over native HTTP transport and HTTP over libp2p streams. See the http.Host Autthenticated HTTP example in the Go doc for an example of usage.
  • Some upnp fixes that should make upnp/nat-pmp more reliable and easier to debug. This fixes an issue with FRITZ!Box routers.

What's Changed

Full Changelog: v0.40.0...v0.41.0

v0.40.0

17 Feb 20:25
ce33562
Compare
Choose a tag to compare

⚠ Breaking Change!

Introducing error codes mandated changing the error types returned by stream resets. All checks that depended on checking the error string or comparing equality with network.ErrReset, now need to use errors.Is(err, network.ErrReset). More details below in the error codes section.

🔦 Highlights

Error Codes

This releases introduces error codes for Stream Reset and Connection Close. This allows sending for more information to the peer about the error condition causing the abort. go-libp2p has already defined some error codes which are useful for many different use cases. You can find them in:
https://pkg.go.dev/github.com/libp2p/go-libp2p@v0.40.0/core/network#StreamErrorCode
and: https://pkg.go.dev/github.com/libp2p/go-libp2p@v0.40.0/core/network#ConnErrorCode

On streams, you can signal an error on reset by using:

str.ResetWithError(errCode)

On connections, you can signal an error on close by using:

conn.ResetWithError(errCode)

Not all transports support error codes. Most notably, WebTransport has no support for sending error codes at the moment. See the spec: libp2p/specs#623 for more details.

If you want to define custom error codes for your application protocol, you can reserve a block for your application by opening a PR in the specs repo. The above mentioned spec has details on reserving error codes for applications. Until the spec is merged, you must open a PR targeting the spec's branch.

Breaking Change!

This introduces a breaking change for users who checked stream reset errors by testing for equality with network.ErrReset as err == network.ErrReset. These tests now need to use the errors.Is(err, network.ErrReset) test. Stream Resets now return either *network.StreamError if the stream was reset by remote, or *network.ConnError if the connection was closed by remote.

What's Changed

New Contributors

Full Changelog: v0.39.0...v0.40.0

v0.39.1

12 Feb 17:11
0f540bb
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.38.1...v0.39.1

v0.38.3

12 Feb 17:03
cf3d309
Compare
Choose a tag to compare

What's Changed

  • fix(autorelay): Move relayFinder peer disconnect cleanup to separate goroutine by @MarcoPolo in #3105
  • ci: Install specific protoc version when generating protobufs by @MarcoPolo in #3112
  • fix(httpauth): Correctly handle concurrent requests on server by @MarcoPolo in #3111
  • Release v0382 by @sukunrt in #3147

Full Changelog: v0.38.0...v0.38.3

v0.39.0

06 Feb 17:25
f38ab36
Compare
Choose a tag to compare

🔦 Highlights

This is a small release. The main thing is updating quic-go to v0.49.0 and enabling specific environments with the new WithDialerForAddr option.

Changelog

  • Update quic-go to v0.49.0 #3153
  • Support application provided quic.Transports @marten-seemann in #3122
  • Support SOCKS proxy with ws(s) #3137
  • Support WithDialerForAddr for running TCP over arbitrary user-defined proxies. #3166

Full Changelog: v0.38.1...v0.39.0

v0.38.2

21 Jan 14:26
6d93e73
Compare
Choose a tag to compare

What's Changed

a4433e7 Release v0.38.2
9e08a02 tcpreuse: fix rcmgr accounting when tcp metrics are enabled (#3142)
6735dd5 fix(net/nat): data race problem of extAddr (#3140)
1ebb404 test: fix failing test (#3141)
8f09a3e nat: ignore mapping if external port is 0 (#3094)
1529945 tcpreuse: error on using tcpreuse with pnet (#3129)
7397e65 chore: Update contribution guidelines (#3134)
05b4afe tcp: fix metrics test build directive (#3052)
1a2387c ci: get back on the main release track of release checker (#3117)
051fe11 webtransport: fix docstring comment for getCurrentBucketStartTime

Full Changelog: v0.38.1...v0.38.2