Skip to content

Releases: libp2p/go-libp2p

v0.9.5

05 Jun 20:39
ed4bd39
Compare
Choose a tag to compare
  • Update go-libp2p-circuit to rebalance tags in the connection manager.
  • Fix a performance regression in the identify service (CPU usage).
  • Fix a rare race condition (panic) in the identify service.

v0.9.4

03 Jun 23:17
67eb8b1
Compare
Choose a tag to compare

This is a bug fix release to chunk identify responses if they exceed the size limit.

Unfortunately, since time immortal, go-libp2p has had a default identify message limit of 2048 bytes. When we added signed peer records, we ended up exceeding this limit for 4096 bit RSA keys. In this release, we:

  1. Have bumped the limit to 8192 bytes.
  2. Allow sending the identify message in multiple chunks.
  3. Read all chunks off the stream and merge them.

The second two parts are, admittedly, hacks that we'll hopefully be able to remove eventually, once enough peers support the raised message size limit. See #954 for details.

Note: this is considered a backwards compatible bug fix because it only applies when the identify message was too big to send anyways.

v0.9.3

03 Jun 20:30
0d11b09
Compare
Choose a tag to compare

This is a maintenance release.

Changelog:

  • Update dependencies for go-libp2p-core, go-event-bus, and add an indirect dependency on go-libp2p-connmgr; see #959
  • Fix a flaky test; see #952
  • Remove old address in identify immediately; see #953
  • Filter interface addresses; see #936
  • Fix a compilation error due to net.Notify; see #956

v0.9.2

20 May 23:07
f6d0327
Compare
Choose a tag to compare

This is another quick bugfix release:

  1. This release fixes compatibility with the QUIC transport (broken in 0.9.0).
  2. Un-exports the "FiltersConnectionGater" type. Exporting this type was unintentional.
  3. Reduces the number of addresses we advertise in some cases. Specifically, libp2p receives address "observations" from peers on the network and advertises these addresses once enough peers have reported them. However, in some networks, we can end up reporting many ports for the same address. In this release, we report at most two ports per address.

v0.9.1

20 May 06:08
9370679
Compare
Choose a tag to compare

This is a quick patch release to fix a couple of small but critical issues in 0.9.0:

  1. Fix a panic when a node is constructed without any listener addresses.
  2. Avoid leaking a goroutine if a peer connects to us and disconnects quickly.
  3. Emit address change events immediately when listen addresses are added and removed, instead of waiting for the periodic address change check to detect this.

v0.9.0

19 May 12:26
7abe2e4
Compare
Choose a tag to compare

🚀🚀🚀🚀🚀 This is a feature-packed release! Read on to learn more about the changes. 🚀🚀🚀🚀🚀

📉 Decaying tags in the Connection Manager

This release introduces Decaying Tags in the Connection Manager interfaces. A decaying tag is one whose value automatically decays over time.

The actual application of the decay behaviour is encapsulated in a user-provided decaying function (DecayFn). The function is called on every tick (determined by the tag's Interval property), and returns either the new value of the tag, or whether it should be erased altogether.

We do not set values directly on a decaying tag. Rather, we "bump" decaying tags by a delta. Doing so calls the BumpFn with the old value and the delta, to determine the new value.

Such a pluggable design affords a great deal of flexibility and versatility. Behaviours that are straightforward to implement include:

  • Decay a tag by -1, or by half its current value, on every tick.
  • Every time a value is bumped, sum it to its current value.
  • Exponentially boost a score with every bump.
  • Sum the incoming score, but keep it within min, max bounds.

To use Decaying Tags, check if the Connection Manager supports them first via the SupportsDecay function.

Check the godocs in the connmgr package for more info.

🚪 Connection gating

This release adds interfaces for Connection Gating: middleware components that intercept connections at different stages and decide whether to ALLOW or BLOCK the connection. In contrast to Connection Managers, Connection Gaters are actively consulted throughout the dial/listen pipeline.

Connection Gaters can intercept connections at these stages:

  • InterceptPeerDial is called on an imminent outbound peer dial request, prior to the addresses of that peer being available/resolved. Blocking connections at this stage is typical for blacklisting scenarios.

  • InterceptAddrDial is called on an imminent outbound dial to a peer on a particular address. Blocking connections at this stage is typical for address filtering.

  • InterceptAccept is called as soon as a transport listener receives an inbound connection request, before any upgrade takes place. Transports who accept already secure and/or multiplexed connections (e.g. possibly QUIC) MUST call this method regardless, for correctness/consistency.

  • InterceptSecured is called for both inbound and outbound connections, after a security handshake has taken place and we've authenticated the peer.

  • InterceptUpgraded is called for inbound and outbound connections, after libp2p has finished upgrading the connection entirely to a secure, multiplexed channel.

See godocs for the ConnectionGater interface for more info.

Migration/adoption notes

The old filter.Filters construct is still available, and behind the scenes, go-libp2p translates it to a connmgr.ConnectionGater that intercepts only address dials, and evaluates them against the Filters.

It is encouraged to transition to using pure ConnectionGaters, as it gives you more control over the entire lifecycle of a connection. It also allows you to blacklist peers.

The constructor options work this way:

  • ConnectionGater(connmgr.ConnectionGater) => sets the connection gater and renders all other Filter* options invalid.
  • Filters(*filter.Filters) (deprecated) => converts the passed Filters to a ConnectionGater, and sets it internally. Cannot be used with ConnectionGater(connmgr.ConnectionGater).
  • FilterAddresses(addrs ...*net.IPNet) (deprecated) => blocks the supplied subnets in the underlying Filters if one has been set, else it creates a new Filters initializing it with the supplied blocked addresses. Compatible with Filters(), incompatible with ConnectionGater().

🔐 Identify protocols now exchange signed peer records

For enhanced security, the identify family of protocols now exchange Signed Peer Records: self-certified records that enumerate our addresses. Previously, when third parties propagated addresses about peers they could tamper them inflight. With signed peer records, such attacks are no longer possible.

Pubsub and DHT protocols are the main beneficiaries within go-libp2p, but signed peer records are available to the application layer too. They can be queried in the peerstore, by first checking if the underlying implementation supports them via GetCertifiedAddrBook().

It is also possible to transmit other types of certified payloads. Check out the godocs of the record package under go-libp2p-core for more info.

This release also deraces the identify family of protocols.

v0.8.3

28 Apr 02:49
c833e2c
Compare
Choose a tag to compare

Multiple dependency updates:

  • Fix a data race in the websocket transport when setting deadlines.
  • Fix a bug in the circuit transport where we might stop listening on the transport when a single connection aborts.

v0.8.2

25 Apr 07:09
v0.8.2
ef1cfe7
Compare
Choose a tag to compare

Fixes two tricky bugs:

  1. Ensures we don't forget addresses observed by connected peers. Previously, this wasn't so bad because our peers would know our addresses, and would be able to direct new peers towards us. However, we'll now tell all of our peers our new address set, so they'll also forget our address :(.
  2. Harden logic around identifying connections.

Note: 2 means that all new streams now wait for identify to complete. Previously, only Connect did this. In practice, this should save time as:

  1. Identify is always one RTT.
  2. Identify starts as soon as we get the connection.
  3. Once identify has completed, all streams can skip the negotiation step.

Otherwise, streams trying to negotiate one of multiple protocols may have to spend several round-trips negotiating.

v0.8.1

17 Apr 19:21
5fa6149
Compare
Choose a tag to compare
  • Fix a noisy log line.
  • Add a missing ticker.Stop() to avoid leaking a timer on shutdown.

v0.8.0

15 Apr 02:22
6f4961b
Compare
Choose a tag to compare

Important changes:

  • The TLS security transport has been added to the default security transports, alongside SECIO. SECIO will still be preferred for the moment.
  • The WithReachability option included in the previous release has been split into ForceReachabilityPrivate() and ForceReachabilityPublic() to make it clear what this option does.

Other:

  • Expose AutoNAT throttling options.
  • Remove use of goprocess from the libp2p host.