Releases: libp2p/go-libp2p
v0.27.2
What's Changed
quic: fix race condition when generating random holepunch packet (#2263)
webtransport: initialize the certmanager when creating the transport (#2268)
Full Changelog: v0.27.1...v0.27.2
v0.27.1
This patch release fixes a couple of bugs. Most importantly, go-libp2p now infers WebTransport listen addresses from the observation (via Identify) of QUIC addresses, if QUIC and WebTransport are run on the same IP and port.
What's Changed
- swarm: fix multiaddr comparison in ListenClose by @marten-seemann in #2247
- basichost: remove stray print statement in test by @marten-seemann in #2249
- autonat: fix flaky TestAutoNATDialRefused by @sukunrt in #2245
- identify: fix normalization of interface listen addresses by @MarcoPolo in #2250
- basichost: don't allocate when deduplicating multiaddrs by @marten-seemann in #2206
- Infer public webtransport addrs from quic-v1 addrs. by @MarcoPolo in #2251
Full Changelog: v0.27.0...v0.27.1
v0.27.0
Breaking Changes
- The
LocalPrivateKey
method was removed from thenetwork.Conn
interface. #2144
🔦 Highlights
Additional metrics
Since the last release, we've added metrics for:
- Relay Service: RequestStatus, RequestCounts, RejectionReasons for Reservation and Connection Requests,
ConnectionDuration, BytesTransferred, Relay Service Status. - Autorelay: relay finder status, reservation request outcomes, current reservations, candidate circuit v2 support, current candidates, relay addresses updated, num relay address, and scheduled work times
🐞 Bugfixes
- autonat: don't change status on dial request refused 2225
- relaysvc: fix flaky TestReachabilityChangeEvent 2215
- basichost: prevent duplicate dials 2196
- websocket: don't set a WSS multiaddr for accepted unencrypted conns 2199
- identify: Fix IdentifyWait when Connected events happen out of order 2173
- circuitv2: cleanup relay service properly 2164
Changelog
- github.com/libp2p/go-libp2p:
- release v0.27.0
- chore: update all deps (#2240) (libp2p/go-libp2p#2240)
- add a security policy (#2238) (libp2p/go-libp2p#2238)
- chore: 0.27.0 changelog entries (#2241) (libp2p/go-libp2p#2241)
- correctly handle WebTransport addresses without certhashes (#2239) (libp2p/go-libp2p#2239)
- autorelay: add metrics (#2185) (libp2p/go-libp2p#2185)
- autonat: don't change status on dial request refused (#2225) (libp2p/go-libp2p#2225)
- autonat: fix closing of listeners in dialPolicy tests (#2226) (libp2p/go-libp2p#2226)
- discovery (backoff): fix typo in comment (#2214) (libp2p/go-libp2p#2214)
- relaysvc: flaky TestReachabilityChangeEvent (#2215) (libp2p/go-libp2p#2215)
- Add wss transport to interop tester impl (#2178) (libp2p/go-libp2p#2178)
- tests: add a stream read deadline transport test (#2210) (libp2p/go-libp2p#2210)
- autorelay: fix busy loop bug and flaky tests in relay finder (#2208) (libp2p/go-libp2p#2208)
- tests: test mplex and Yamux, Noise and TLS in transport tests (#2209) (libp2p/go-libp2p#2209)
- tests: add some basic transport integration tests (#2207) (libp2p/go-libp2p#2207)
- autorelay: remove unused semaphore (#2184) (libp2p/go-libp2p#2184)
- basichost: prevent duplicate dials (#2196) (libp2p/go-libp2p#2196)
- websocket: don't set a WSS multiaddr for accepted unencrypted conns (#2199) (libp2p/go-libp2p#2199)
- websocket: Don't limit message sizes in the websocket reader (#2193) (libp2p/go-libp2p#2193)
- identify: fix stale comment (#2179) (libp2p/go-libp2p#2179)
- relay service: add metrics (#2154) (libp2p/go-libp2p#2154)
- identify: Fix IdentifyWait when Connected events happen out of order (#2173) (libp2p/go-libp2p#2173)
- chore: fix ressource manager's README (#2168) (libp2p/go-libp2p#2168)
- relay: fix deadlock when closing (#2171) (libp2p/go-libp2p#2171)
- core: remove LocalPrivateKey method from network.Conn interface (#2144) (libp2p/go-libp2p#2144)
- routed host: return connection error instead of routing error (#2169) (libp2p/go-libp2p#2169)
- connmgr: reduce log level for closing connections (#2165) (libp2p/go-libp2p#2165)
- circuitv2: cleanup relay service properly (#2164) (libp2p/go-libp2p#2164)
- chore: add patch release to changelog (#2151) (libp2p/go-libp2p#2151)
- chore: remove superfluous testing section from README (#2150) (libp2p/go-libp2p#2150)
- autonat: don't use autonat for address discovery (#2148) (libp2p/go-libp2p#2148)
- chore: update webtransport-go to v0.5.2 (#2149) (libp2p/go-libp2p#2149)
- swarm metrics: fix connection direction (#2147) (libp2p/go-libp2p#2147)
- connmgr: Use eventually equal helper in connmgr tests (#2128) (libp2p/go-libp2p#2128)
- swarm: emit PeerConnectedness event from swarm instead of from hosts (#1574) (libp2p/go-libp2p#1574)
- relay: initialize the ASN util when starting the service (#2143) (libp2p/go-libp2p#2143)
- Fix flaky TestMetricsNoAllocNoCover test (#2142) (libp2p/go-libp2p#2142)
- identify: Bump timeouts/sleep in tests (#2135) (libp2p/go-libp2p#2135)
- Add sleep to fix flaky test (#2129) (libp2p/go-libp2p#2129)
- basic_host: Fix flaky tests (#2136) (libp2p/go-libp2p#2136)
- swarm: Check context once more before dialing (#2139) (libp2p/go-libp2p#2139)
- chore: update examples to v0.26.0 (#2134) (libp2p/go-libp2p#2134)
- github.com/ipfs/go-cid (v0.3.2 -> v0.4.1):
- v0.4.1
- Add unit test for unexpected eof
- Update cid.go
- CidFromReader should not wrap valid EOF return.
- chore: version 0.4.0
- feat: wrap parsing errors into ErrInvalidCid
- build(deps): bump golang.org/x/crypto
- build(deps): bump golang.org/x/sys
- fix: use crypto/rand.Read
- update .github/workflows/release-check.yml
- update .github/workflows/go-check.yml
- update .github/workflows/go-test.yml
- bump go.mod to Go 1.19 and run go fix
- Fix README.md example error (#146) (ipfs/go-cid#146)
- github.com/libp2p/go-libp2p-asn-util (v0.2.0 -> v0.3.0):
- release v0.3.0 (#26) (libp2p/go-libp2p-asn-util#26)
- initialize the store lazily (#25) (libp2p/go-libp2p-asn-util#25)
- chore: Update .github/workflows/stale.yml [skip ci]
- github.com/multiformats/go-multiaddr (v0.8.0 -> v0.9.0):
- Release v0.9.0 (multiformats/go-multiaddr#196)
- Update webrtc protocols after rename (multiformats/go-multiaddr#195)
- Bump golang.org/x/crypto from 0.0.0-20190611184440-5c40567a22f8 to 0.1.0 (#191) (multiformats/go-multiaddr#191)
- github.com/multiformats/go-multicodec (v0.7.0 -> v0.8.1):
- Bump version to release
ipns-record
code - chore: update submodules and go generate
- deps: upgrade stringer to compatible version
- update .github/workflows/release-check.yml
- update .github/workflows/go-check.yml
- update .github/workflows/go-test.yml
- bump go.mod to Go 1.19 and run go fix
- v0.8.0
- chore: update submodules and go generate
- fix: make go-generate workflow pull latest remote (multiformats/go-multicodec#73)
- ci: create Go Generate workflow (multiformats/go-multicodec#72)
- Bump version to release
Contributors
Contributor | Commits | Lines ± | Files Changed |
---|---|---|---|
Sukun | 11 | +3526/-262 | 33 |
Marten Seemann | 15 | +615/-1396 | 75 |
galargh | 2 | +876/-804 | 6 |
Marco Munizaga | 14 | +1173/-134 | 44 |
Henrique Dias | 2 | +185/-40 | 3 |
Prithvi Shahi | 2 | +55/-14 | 2 |
gammazero | 2 | +31/-0 | 4 |
libp2p-mgmt-read-write[bot] | 1 | +26/-0 | 1 |
Piotr Galar | 1 | +25/-0 | 1 |
dependabot[bot] | 3 | +12/-9 | 6 |
Rod Vagg | 5 | +6/-6 | 5 |
Laurent Senta | 1 | +2/-2 | 1 |
Hlib Kanunnikov | 1 | +2/-1 | 1 |
Andrew Gillis | 1 | +2/-1 | 1 |
RichΛrd | 1 | +1/-1 | 1 |
Nikhilesh Susarla | 1 | +1/-1 | 1 |
Masih H. Derkani | 1 | +1/-1 | 1 |
Bryan White | 1 | +1/-1 | 1 |
Full Changelog: v0.26.4...v0.27.0
v0.26.4
v0.26.3
What's Changed
- release v0.26.1 by @marten-seemann in #2146
- rcmgr: fix JSON marshalling of ResourceManagerStat peer map by @MarcoPolo in #2156
- retract v0.26.1, release v0.26.2 by @marten-seemann in #2153
- websocket: Don't limit message sizes in the websocket reader by @MarcoPolo in #2193
Full Changelog: v0.26.0...v0.26.3
v0.26.2
v0.26.1
Retracted
This release included some changes not intended for a patch release. The issue came from a bug in our release automation tooling. More details here: #2153.
New release coming soon.
What's Changed
- chore: update examples to v0.26.0 by @marten-seemann in #2134
- swarm: Check context once more before dialing by @MarcoPolo in #2139
- basic_host: Fix flaky tests by @MarcoPolo in #2136
- examples: Add sleep to fix flaky test by @MarcoPolo in #2129
- identify: Bump timeouts/sleep in tests by @MarcoPolo in #2135
- identify: Fix flaky TestMetricsNoAllocNoCover test by @MarcoPolo in #2142
- relay: initialize the ASN util when starting the service by @marten-seemann in #2143
- swarm: emit PeerConnectedness event from swarm instead of from hosts by @marten-seemann in #1574
- connmgr: Use eventually equal helper in connmgr tests by @MarcoPolo in #2128
- swarm metrics: fix connection direction by @sukunrt in #2147
- chore: update webtransport-go to v0.5.2 by @marten-seemann in #2149
- autonat: don't use autonat for address discovery by @sukunrt in #2148
Full Changelog: v0.26.0...v0.26.1
v0.26.0
🔦 Highlights
Circuit Relay Changes
Removed Circuit Relay v1
We've decided to remove support for Circuit Relay v1 in this release. v1 Relays have been retired a few months ago. Notably, running the Relay v1 protocol was expensive and resulted in only a small number of nodes in the network. Users had to either manually configure these nodes as static relays, or discover them from the DHT.
Furthermore, rust-libp2p has dropped support and js-libp2p is dropping support for Relay v1.
Support for Relay v2 was first added in late 2021 in v0.16.0. With Circuit Relay v2 it became cheap to run (limited) relays. Public nodes also started the relay service by default. There's now a massive number of Relay v2 nodes on the IPFS network, and they don't advertise their service to the DHT any more. Because there's now so many of these nodes, connecting to just a small number of nodes (e.g. by joining the DHT), a node is statistically guaranteed to connect to some relays.
Unlimited Relay v2
In conjunction with removing relay v1, we also added an option to Circuit Relay v2 to disable limits.
This done by enabling WithInfiniteLimits
. When enabled this allows for users to have a drop in replacement for Relay v1 with Relay v2.
Additional metrics
Since the last release, we've added additional metrics to different components.
Metrics were added to:
- AutoNat: Current Reachability Status and Confidence, Client and Server DialResponses, Server DialRejections. The dashboard is available here.
- Swarm:
- Early Muxer Selection: Added early_muxer label indicating whether a connection was established using early muxer selection.
- IP Version: Added ip_version label to connection metrics
- Identify:
We also migrated the metric dashboards to a top-level dashboards directory.
Changelog
- github.com/libp2p/go-libp2p:
- identify: add more detailed metrics (#2126) (libp2p/go-libp2p#2126)
- autorelay: refactor relay finder and start autorelay after identify (#2120) (libp2p/go-libp2p#2120)
- don't use the time value from the time.Ticker channel (#2127) (libp2p/go-libp2p#2127)
- Wrap conn with metrics (#2131) (libp2p/go-libp2p#2131)
- chore: update changelog for 0.26.0 (#2132) (libp2p/go-libp2p#2132)
- chore: update quic-go to v0.33.0 (#2124) (libp2p/go-libp2p#2124)
- circuitv2: Update proto files to proto3 (#2121) (libp2p/go-libp2p#2121)
- swarm: remove parallel tests from swarm tests (#2130) (libp2p/go-libp2p#2130)
- circuitv2: add a relay option to disable limits (#2125) (libp2p/go-libp2p#2125)
- quic: fix stalled virtual listener (#2122) (libp2p/go-libp2p#2122)
- swarm: add early muxer selection to swarm metrics (#2119) (libp2p/go-libp2p#2119)
- metrics: add options to disable metrics and to set Prometheus registerer (#2116) (libp2p/go-libp2p#2116)
- swarm: add ip_version to metrics (#2114) (libp2p/go-libp2p#2114)
- Revert mistaken "Bump timeout"
- Bump timeout
- remove all circuit v1 related code (#2107) (libp2p/go-libp2p#2107)
- quic: don't send detailed error messages when closing connections (#2112) (libp2p/go-libp2p#2112)
- metrics: add no alloc metrics for eventbus, swarm, identify (#2108) (libp2p/go-libp2p#2108)
- chore: fix typo in Changelog (#2111) (libp2p/go-libp2p#2111)
- chore: update changelog (#2109) (libp2p/go-libp2p#2109)
- chore: unify dashboard location (#2110) (libp2p/go-libp2p#2110)
- autonat: add metrics (#2086) (libp2p/go-libp2p#2086)
- relaymanager: do not start new relay if one already exists (#2093) (libp2p/go-libp2p#2093)
- autonat: don't emit reachability changed events on address change (#2092) (libp2p/go-libp2p#2092)
- chore: update release.md (#2090) (libp2p/go-libp2p#2090)
- chore: modify changelog entries (#2101) (libp2p/go-libp2p#2101)
- Introduce a changelog (#2084) (libp2p/go-libp2p#2084)
- use atomic.Int32 and atomic.Int64 (#2096) (libp2p/go-libp2p#2096)
- change atomic.Value to atomic.Pointer (#2088) (libp2p/go-libp2p#2088)
- interop-tests: use new action with s3 caching (#2076) (libp2p/go-libp2p#2076)
- use atomic.Bool instead of int32 operations (#2089) (libp2p/go-libp2p#2089)
- chore: update examples to v0.25.1 (#2080) (libp2p/go-libp2p#2080)
Contributors
Contributor | Commits | Lines ± | Files Changed |
---|---|---|---|
Sukun | 11 | +2979/-696 | 76 |
Marten Seemann | 5 | +52/-3619 | 33 |
Marco Munizaga | 11 | +865/-520 | 35 |
Prithvi Shahi | 5 | +66/-21 | 10 |
Full Changelog: v0.25.1...v0.26.0
v0.25.1
What's Changed
Patch update to fix some test-utils used by https://github.com/libp2p/go-libp2p-kad-dht
See the release notes for v0.25.0 for more details on this release.
- mocknet: Start host in mocknet by @MarcoPolo in #2078
- chore: update go-multistream by @MarcoPolo in #2081
Full Changelog: v0.25.0...v0.25.1
v0.25.0
🔦 Highlights
Metrics
We've started instrumenting the entire stack. In this release, we're adding metrics for:
- the swarm: tracking incoming and outgoing connections, transports, security protocols and stream multiplexers in sue: (https://github.com/libp2p/go-libp2p/blob/master/p2p/net/swarm/grafana-dashboards/swarm.json)
- the event bus: tracking how different events are propagated through the stack and to external consumers (https://github.com/libp2p/go-libp2p/blob/master/p2p/host/eventbus/grafana-dashboards/eventbus.json)
Our metrics effort is still ongoing, see #1356 for progress. We'll add metrics and dashboards for more libp2p components in a future release.
Switching to Google's official Protobuf compiler
So far, we were using GoGo Protobuf to compile our Protobuf definitions to Go code. However, this library was deprecated in October last year: https://twitter.com/awalterschulze/status/1584553056100057088. We benchmarked serialization and deserialization, and found that it's (only) 20% slower than GoGo. Since the vast majority of go-libp2p's CPU time is spent in code paths other than Protobuf handling, switching to the official compiler seemed like a worthwhile tradeoff.
Removal of OpenSSL
Before this release, go-libp2p had an option to use OpenSSL bindings for certain cryptographic primitives, mostly to speed up the generation of signatures and their verification. When building go-libp2p using go build
, we'd use the standard library crypto packages. OpenSSL was only used when passing in a build tag: go build -tags openssl
.
Maintaining our own fork of the long unmaintained go-openssl package has proven to place a larger than expected maintenance burden on the libp2p stewards, and when we recently discovered a range of new bugs (this and this and this), we decided to re-evaluate if this code path is really worth it. The results surprised us, it turns out that:
- The Go standard library is faster than OpenSSL for all key types that are not RSA.
- Verifying RSA signatures is as fast as Ed25519 signatures using the Go standard library, and even faster in OpenSSL.
- Generating RSA signatures is painfully slow, both using Go standard library crypto and using OpenSSL (but even slower using Go standard library).
Now the good news is, that if your node is not using an RSA key, it will never create any RSA signatures (it might need to verify them though, when it connects to a node that uses RSA keys). If you're concerned about CPU performance, it's a good idea to avoid RSA keys (the same applies to bandwidth, RSA keys are huge!). Even for nodes using RSA keys, it turns out that generating the signatures is not a significant part of their CPU load, as verified by profiling one of Kubo's bootstrap nodes.
We therefore concluded that it's safe to drop this code path altogether, and thereby reduce our maintenance burden.
New Resource Manager types
- Introduces a new type
LimitVal
which can explicitly specify "use default", "unlimited", "block all", as well as any positive number. The zero value ofLimitVal
(the value when you create the object in Go) is "Use default".- The JSON marshalling of this is straightforward.
- Introduces a new
ResourceLimits
type which usesLimitVal
instead of ints so it can encode the above for the resources. - Changes
LimitConfig
toPartialLimitConfig
and usesResourceLimits
. This along with the marshalling changes means you can now marshal the fact that some resource limit is set to block all.- Because the default is to use the defaults, this avoids the footgun of initializing the resource manager with 0 limits (that would block everything).
In general, you can go from a resource config with defaults to a concrete one with .Build()
. e.g. ResourceLimits.Build() => BaseLimit
, PartialLimitConfig.Build() => ConcreteLimitConfig
, LimitVal.Build() => int
. See PR #2000 for more details.
If you're using the defaults for the resource manager, there should be no changes needed.
Resource Manager optimized metrics
We moved away from OpenCensus to the prometheus SDK. Metrics hot path now has no allocations and a test to ensure this behavior in the future. See #1955 for more details.
Websockets: change underlying library
From the unmantained https://github.com/gorilla/websocket to https://github.com/nhooyr/websocket. More details here: #1982.
Other Breaking Changes
We've cleaned up our API to consistently use protocol.ID
for libp2p and application protocols. Specifically, this means that the peer store now uses protocol.ID
s, and the host's SetStreamHandler
as well.
What's Changed
- chore: use generic LRU cache by @muXxer in #1980
- core/crypto: drop all OpenSSL code paths by @marten-seemann in #1953
- add WebTransport to the list of default transports by @marten-seemann in #1915
- identify: remove old code targeting Go 1.17 by @marten-seemann in #1964
- core: remove introspection package by @marten-seemann in #1978
- identify: remove support for Identify Delta by @marten-seemann in #1975
- roadmap: remove optimizations of the TCP-based handshake by @marten-seemann in #1959
- circuitv2: correctly set the transport in the ConnectionState by @marten-seemann in #1972
- switch to Google's Protobuf library, make protobufs compile with go generate by @marten-seemann in #1979
- ci: run go generate as part of the go-check workflow by @marten-seemann in #1986
- ci: use GitHub token to install protoc by @marten-seemann in #1996
- feat: add some users to the readme by @p-shahi in #1981
- CI: Fast multidimensional Interop tests by @MarcoPolo in #1991
- Fix: Ignore zero values when marshalling Limits. by @ajnavarro in #1998
- feat: add ci flakiness score to readme by @MarcoPolo in #2002
- peerstore: make it possible to use an empty peer ID by @marten-seemann in #2006
- feat: rcmgr: Export resource manager errors by @MarcoPolo in #2008
- feat: ci test-plans: Parse test timeout parameter for interop test by @MarcoPolo in #2014
- Clean addresses with peer id before adding to addrbook by @sukunrt in #2007
- Expose muxer ids by @aschmahmann in #2012
- swarm: add a basic metrics tracer by @marten-seemann in #1973
- consistently use protocol.ID instead of strings by @sukunrt in #2004
- swarm metrics: fix datasource for dashboard by @MarcoPolo in #2024
- chore: remove textual roadmap in favor for Starmap by @p-shahi in #2036
- rcmgr: *: Always close connscope by @MarcoPolo in #2037
- chore: remove license files from the eventbus package by @marten-seemann in #2042
- Migrate to test-plan composite action by @thomaseizinger in #2039
- use quic-go and webtransport-go from quic-go organization by @marten-seemann in #2040
- holepunch: fix flaky test by not removing holepunch protocol handler by @marten-seemann in #1948
- quic / webtransport: extend test to test dialing a draft-29 and a v1 by @marten-seemann in #1957
- p2p/test: add test for EvtLocalAddressesUpdated event by @marten-seemann in #2016
- quic, tcp: only register Prometheus counters when metrics are enabled by @marten-seemann in #1971
- p2p/test: fix flaky notification test by @marten-seemann in #2051
- quic: disable sending of Version Negotiation packets by @marten-seemann in #2015
- eventbus: add metrics by @sukunrt in #2038
- metrics: use a single slice pool for all metrics tracer by @marten-seemann in #2054
- webtransport: tidy up some test output by @MarcoPolo in #2053
- set names for eventbus event subscriptions by @marten-seemann in #2057
- autorelay: Split libp2p.EnableAutoRelay into 2 functions by @sukunrt in #2022
- rcmgr: Use prometheus SDK for rcmgr metrics by @MarcoPolo in #2044
- websocket: Replace gorilla websocket transport with nhooyr websocket transport by @MarcoPolo in #1982
- rcmgr: add libp2p prefix to all metrics by @marten-seemann in https://github.com/libp2p/go-libp...