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.
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.
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.
... (truncated)
Commits
9370679 Merge pull request #943 from libp2p/fix/record-panic
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps github.com/libp2p/go-libp2p from 0.7.2 to 0.9.1.
Release notes
Sourced from github.com/libp2p/go-libp2p's releases.
Commits
9370679
Merge pull request #943 from libp2p/fix/record-panic01da330
fix: don't try to marshal a nil recordaa60461
Merge pull request #941 from libp2p/test/peer-records-no-listen-addrs15637fc
Merge pull request #942 from libp2p/fix/peer-handler-emptye3a983a
fix: don't leak a goroutine if a peer connects and immediately disconnects82c11bc
sleep longer in testbd9e7b5
detect listen addr changes in BasicHost3364dcc
make test fail to demonstrate issue0d6e02e
add test to demo missing peer records after listen7abe2e4
release v0.9.0: upgrade dependencies. (#937)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)