Releases: libp2p/go-libp2p
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
v0.9.5
v0.9.4
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:
- Have bumped the limit to 8192 bytes.
- Allow sending the identify message in multiple chunks.
- 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
This is a maintenance release.
Changelog:
v0.9.2
This is another quick bugfix release:
- This release fixes compatibility with the QUIC transport (broken in 0.9.0).
- Un-exports the "FiltersConnectionGater" type. Exporting this type was unintentional.
- 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
This is a quick patch release to fix a couple of small but critical issues in 0.9.0:
- Fix a panic when a node is constructed without any listener addresses.
- Avoid leaking a goroutine if a peer connects to us and disconnects quickly.
- 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
🚀🚀🚀🚀🚀 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 ConnectionGater
s, 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 otherFilter*
options invalid.Filters(*filter.Filters)
(deprecated) => converts the passedFilters
to aConnectionGater
, and sets it internally. Cannot be used withConnectionGater(connmgr.ConnectionGater)
.FilterAddresses(addrs ...*net.IPNet)
(deprecated) => blocks the supplied subnets in the underlyingFilters
if one has been set, else it creates a newFilters
initializing it with the supplied blocked addresses. Compatible withFilters()
, incompatible withConnectionGater()
.
🔐 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.