Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Releases: libp2p/go-libp2p-core

v0.8.2

17 Feb 09:28
Compare
Choose a tag to compare
  • #175 -- Adds support for transient connections.

v0.8.1

17 Feb 07:31
410e6bd
Compare
Choose a tag to compare
  • Introduce a sec.SecureMuxer interface which can select security protocols and open outbound connections with simultaneous open. It is a wrapper around the SecureTransport interface.

v0.8.0

17 Feb 09:12
83ac1d3
Compare
Choose a tag to compare

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

02 Sep 00:48
v0.7.0
d6afc69
Compare
Choose a tag to compare

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

30 Jul 09:41
98f9714
Compare
Choose a tag to compare

dependency upgrades.

v0.6.0

05 Jun 11:31
Compare
Choose a tag to compare

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 in network.Conn and network.Stream.
  • Opened field in network.Stat to track the opening timestamp of connections and streams.

v0.5.7

03 Jun 19:10
0d53a55
Compare
Choose a tag to compare
  • Extends the ConnectionManager interface to support querying for protected peers; see #158.
  • Adds a generic DHT event; see #154.
  • Adds wildcard subscriptions for events and an accessor to enumerate known types; see #153.

v0.5.6

18 May 10:46
acf0d3d
Compare
Choose a tag to compare
  • Decaying tags: added the capability to explicitly Remove() a decaying tag from a peer, and to Close(), stop tracking and clear a decaying tag for all peers.

v0.5.5

14 May 16:28
Compare
Choose a tag to compare

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

14 May 10:50
1c39960
Compare
Choose a tag to compare

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 the Protobook interface which returns the first protocol a peer supports from among the given interfaces.