Releases: libp2p/go-libp2p-core
v0.8.2
v0.8.1
- Introduce a
sec.SecureMuxer
interface which can select security protocols and open outbound connections with simultaneous open. It is a wrapper around theSecureTransport
interface.
v0.8.0
v0.8.0 introduces a BREAKING interface change: MuxedConn.OpenStream
and Conn.NewStream
now both take a context.Context
. This allows stream multiplexer implementations to unblock OpenStream
when requested to do so.
Release v0.7.0
This is release includes a significant BREAKING CHANGE to the stream interface.
Previously, Close()
closed streams for writing, but left them open for reading. Unfortunately, this meant streams would not be garbage collected until either (a) an EOF had been read on the stream or (b) Reset
had been called. While technically documented, this behavior was extraordinarily surprising and most libp2p applications end up misusing and leaking streams (leading to memory leaks).
A CloseRead
function has been introduced to close a stream for reading only (writing is still allowed).
- Any in-progress
Read
calls will be interrupted with a non-EOF error. - No further calls to
Read
will succeed. - The handling of new incoming data on the stream after calling close is implementation defined. Currently,
- Yamux and Mplex will throw away incoming data on a closed stream.
- QUIC will return an error to the sender.
Close
now closes the stream for both reading and writing. Close
is equivalent to calling CloseRead
and CloseWrite
. Importantly, Close
will not wait for any form of acknowledgment. If acknowledgment is required, the caller must call CloseWrite
, then wait on the stream for a response (or an EOF), then call Close()
to free the stream object.
When done with a stream, the user must call either Close()
or Reset()
to discard the stream, even after calling CloseRead()
and/or CloseWrite()
.
v0.6.1
v0.6.0
This release adds EXPERIMENTAL introspection support. See libp2p/go-libp2p#947 for more info.
- New
introspection
package encapsulating all introspection abstractions.Introspector
: to be satisfied by components that are capable of spelunking the state of the system, and representing in accordance with the introspection schema.IntrospectionEndpoint
: interface to be implemented by introspection endpoints. An introspection endpoint makes introspection data accessible to external consumers, over, for example, WebSockets, or TCP, or libp2p itself.
- New
host.IntrospectableHost
interface to be implemented by introspectable hosts. - Protobuf introspection schema under
introspection/pb
. ID() string
methods innetwork.Conn
andnetwork.Stream
.Opened
field innetwork.Stat
to track the opening timestamp of connections and streams.
v0.5.7
v0.5.6
v0.5.5
Highlights
📉 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.
Minor changes
- Stringer functions for
network
package enums.
v0.5.4
Highlights
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.
Minor changes
- Added a
FirstSupportedProtocol
API to theProtobook
interface which returns the first protocol a peer supports from among the given interfaces.