Skip to content

Releases: libp2p/go-libp2p

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

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.