Commit Graph

2601 Commits

Author SHA1 Message Date
85bde7eed8 feat(swarm): downgrade connection limits warning from warn to debug
This tiny PR contains a proposed change for the warning related to the exceeded pending incoming connections limit. This warning can't be controlled and causes user confusion. It contains useful technical info but IMHO should be downgraded from `warn` to `debug`.

Pull-Request: #3671.
2023-03-31 10:30:53 +00:00
d7396706d0 fix(changelog): Make release heading levels consistent
See `##` for release headings everywhere. This is consistent with markdown conventions of one `#` per document and in line with https://keepachangelog.com/.

See report in https://github.com/libp2p/rust-libp2p/issues/3531.

Pull-Request: #3561.
2023-03-30 21:04:01 +00:00
dfa7bd6b57 refactor: don't depend on multihash features
All we need from the multihash is for it to be a data structure that we pass around. We only ever use the identity "hasher" and the sha256 hasher. Those are easily implemented without depending the (fairly heavy) machinery in `multihash`.

Unfortunately, this patch by itself does not yet lighten our dependency tree because `multiaddr` activates those features unconditionally. I opened a companion PR for this: https://github.com/multiformats/rust-multiaddr/pull/77.

https://github.com/multiformats/rust-multiaddr/pull/77 is another breaking change and we are trying to delay those at the moment. However, it will (hopefully) land eventually which should then be much easier to implement.

Fixes #3276.

Pull-Request: #3514.
2023-03-30 17:47:35 +00:00
75f967f4da refactor(identity): leverage Copy impl for ed25519 public key
No need for function calls to `to_bytes` and `from_bytes` if the type is `Copy`.

Related: #3649.

Pull-Request: #3706.
2023-03-30 11:07:37 +00:00
972ba4ca08 deps: bump serde from 1.0.157 to 1.0.159
Pull-Request: #3697.
2023-03-29 20:55:58 +00:00
bcbff8e534 docs(ROADMAP): mark connection management as done
Pull-Request: #3695.
2023-03-29 17:42:26 +00:00
4158f7120a deps: bump syn from 2.0.2 to 2.0.11
Pull-Request: #3696.
2023-03-29 16:27:12 +00:00
be42f214bf deps: bump regex from 1.7.1 to 1.7.3
Pull-Request: #3687.
2023-03-29 13:47:44 +00:00
486ac8baf2 chore: prepare libp2p v0.51.2
Depends-On: #3693.

Pull-Request: #3694.
2023-03-29 13:04:18 +00:00
bd0459121f deps: bump zeroize from 1.5.7 to 1.6.0
Pull-Request: #3685.
2023-03-29 12:07:18 +00:00
ea573b3b49 deps: bump bimap from 0.6.2 to 0.6.3
Pull-Request: #3641.
2023-03-29 11:28:43 +00:00
ce55601683 deps: bump async-io from 1.12.0 to 1.13.0
Pull-Request: #3683.
2023-03-29 10:59:41 +00:00
699a55bcc1 deps: bump actions/upload-pages-artifact from 1.0.7 to 1.0.8
Pull-Request: #3682.
2023-03-29 09:37:18 +00:00
3d3ccfe411 fix(libp2p): export perf protocol
As we do with all other protocols, make sure to expose `libp2p-perf` as well.

Related: https://github.com/libp2p/rust-libp2p/pull/3508#discussion_r1125546920.

Pull-Request: #3693.
2023-03-29 08:36:43 +00:00
4897b2e4b1 deps: bump async-trait from 0.1.66 to 0.1.67
Pull-Request: #3642.
2023-03-27 11:17:09 +00:00
1a85e24ef9 fix(quic): Downgrade driver shutdown log line from info to debug
No need to inform the user each time the quic socket driver is shutting down.

Pull-Request: #3672.
2023-03-24 17:09:22 +00:00
0ec701e101 ci(semver-checks): upgrade to cargo semver-checks v0.19.0
cargo-semver-checks v0.19.0 contains two new lints and a bugfix for the stale caches issue.
https://github.com/obi1kenobi/cargo-semver-checks/releases/v0.19.0/

Pull-Request: #3675.
2023-03-24 16:41:28 +00:00
82e38bfa28 ci(semver-checks): avoid stale caches after rustc or tool upgrade
With an upgrade to the Rust toolchain, the version of the rustdoc JSON may change. We incorporate the rustc version into the cache key to automatically invalidate the cache in that case. Additionally, we also incorporate the version of the `cargo semver-checks` tool.

Related: https://github.com/obi1kenobi/cargo-semver-checks/issues/415.

Pull-Request: #3664.
2023-03-24 15:08:56 +00:00
7e9581c4ef deps: bump thiserror from 1.0.39 to 1.0.40
Pull-Request: #3637.
2023-03-24 14:17:02 +00:00
dcbc04e89e feat(swarm): rename NetworkBehaviourAction to ToSwarm
Resolves #3123.

Pull-Request: #3658.
2023-03-24 13:43:49 +00:00
7ffa63b656 feat: add QUIC transport to the chat example
See: https://github.com/libp2p/rust-libp2p/issues/3501#issuecomment-1461492407

Pull-Request: #3635.
2023-03-24 11:12:38 +00:00
fd0983567c chore(relay): move server example to examples/
Related: #3111.

Pull-Request: #3663.
2023-03-23 21:38:56 +00:00
d652c014af chore(autonat): move example to examples/
Related: #3111.

Pull-Request: #3662.
2023-03-23 21:10:52 +00:00
3f99c31bb3 chore(gossipsub): bump crate version
Missed in https://github.com/libp2p/rust-libp2p/pull/3551/.

Pull-Request: #3668.
2023-03-23 14:17:18 +00:00
e307c0f9da ci(mergify): only report conflicts on draft PRs with a milestone
This is an evolution of the idea in https://github.com/libp2p/rust-libp2p/pull/3614 that should be closer to what we want. Not sure why I didn't think of this in the first place.

Pull-Request: #3660.
2023-03-23 07:29:22 +11:00
83c2aca298 feat(mergify): report merge conflicts for draft PRs
Pull-Request: #3614.
2023-03-23 02:22:53 +11:00
3411b2697c docs: update policy on breaking changes and changelog entry format
Pull-Request: #3615.
2023-03-22 14:21:43 +00:00
0e468655a4 feat(webrtc): make Fingerprint type public
`Certificate#fingerprint()` returns `Fingerprint`, but since it's not
public, I was not able to test it in my project. I.e. before this change it was
not possible to do:

```
cert.fingerprint() == Fingerprint::raw([1u8 ...])
```

Pull-Request: #3648.
2023-03-21 22:33:43 +00:00
64cd225dca fix(gossipsub): fix check for fanout peer inclusion in test_join
The check for fanout peer inclusion in `test_join` does not check anything since `new_peers` is always empty.

12b785e94e/protocols/gossipsub/src/behaviour/tests.rs (L611)

I assume the intention was to fill the `new_peers` with the fanout peers. In this MR I do just that.

Pull-Request: #3628.
2023-03-21 22:04:57 +00:00
f64187049d feat: introduce libp2p-allow-block-list connection management module
Currently, banning peers is a first-class feature of `Swarm`. With the new connection management capabilities of `NetworkBehaviour`, we can now implement allow and block lists as a separate module.

We introduce a new crate `libp2p-allow-block-list` and deprecate `Swarm::ban_peer_id` in favor of that.

Related #2824.

Pull-Request: #3590.
2023-03-21 20:58:09 +00:00
3fa10be0d5 feat(swarm): introduce ConnectionId::new_unchecked constructor
In earlier iterations of the design for generic connection management, we removed the `ConnectionId::new` constructor because it would have allowed users to create `ConnectionId`s that are already taken, thus breaking invariants that `NetworkBehaviour`s rely on. Later, we incorporated the creation of `ConnectionId` in `DialOpts` which mitigates this risk altogether.

Thus, it is reasonably safe to introduce a public, non-deprecated constructor for `ConnectionId` that can be used for tests.

Related https://github.com/libp2p/rust-libp2p/pull/3327#issuecomment-1469870307.

Pull-Request: #3652.
2023-03-21 19:28:46 +00:00
ab9555c8b6 feat: deprecate webrtc and quic features in libp2p crate
We currently expose `libp2p-quic` and `libp2p-webrtc` as submodules from the `libp2p` crate despite those only being "alpha" status. This causes problems because we need to pin those dependencies due to `cargo` automatically upgrading alphas (which are allowed to incur breaking changes as per semver spec). Additionally, exposing these modules practically hides the "alpha" state of those modules, rendering it kind of obsolete.

The "alpha" state is still true for those modules, thus to properly communicate this to users, we deprecate the modules and require users to spell out the dependency and the alpha version in their manifest.

Pull-Request: #3580.
2023-03-21 17:52:47 +00:00
48a70e5102 feat: introduce libp2p-connection-limits connection management module
This patch deprecates the existing connection limits within `Swarm` and uses the new `NetworkBehaviour` APIs to implement it as a plugin instead.

Related #2824.

Pull-Request: #3386.
2023-03-21 15:04:53 +00:00
0341817b26 chore(swarm-test): specify versions for dependencies
Every crate released to crates.io must have versions specified for all prod. dependencies.

Related: https://github.com/libp2p/rust-libp2p/pull/3629.

Pull-Request: #3650.
2023-03-21 11:18:45 +00:00
4f18d0413c deps: bump syn from 1.0.109 to 2.0.2
Pull-Request: #3645.
2023-03-20 18:22:58 +00:00
9f63a0a69e feat(swarm-test): allow publishing to crates.io
Allows folks like @bajtos to use the crate, see https://github.com/filecoin-station/zinnia/pull/85.

I opted for not exposing the crate through the `libp2p` meta crate as it is a testing tool only. @thomas
let me know if you prefer me to do so.

Pull-Request: #3629.
2023-03-20 17:49:35 +00:00
06d644b63d deps: bump x509-parser from 0.14.0 to 0.15.0
Pull-Request: #3640.
2023-03-20 15:30:09 +00:00
e9b45db786 deps: bump quote from 1.0.25 to 1.0.26
Pull-Request: #3639.
2023-03-20 14:47:10 +00:00
15ef8c0325 deps: bump clap from 4.1.8 to 4.1.11
Pull-Request: #3638.
2023-03-20 14:06:08 +00:00
ea5917bcbb deps: bump actions/deploy-pages from 1 to 2
Pull-Request: #3636.
2023-03-20 13:32:09 +00:00
252d504d5a deps: bump serde from 1.0.155 to 1.0.157
Pull-Request: #3643.
2023-03-20 13:03:01 +00:00
ba38685ba7 deps: bump anyhow from 1.0.69 to 1.0.70
Pull-Request: #3644.
2023-03-20 12:26:55 +00:00
9d1116fd5d feat(perf): implement libp2p perf protocol
Implementation of the libp2p perf protocol according to https://github.com/libp2p/specs/pull/478/.

//CC @MarcoPolo  as the author of the specification.

**Don't (yet) expect this to produce reliable performance metrics.**

Pull-Request: #3508.
2023-03-19 18:20:42 +00:00
8f271caec3 chore(identity): prepare 0.1.1 release
As discussed in https://github.com/libp2p/rust-libp2p/pull/3626#pullrequestreview-1344657608.

Pull-Request: #3631.
2023-03-18 11:11:21 +00:00
14292c4758 feat(identity): add From impls for specific keypair types
Closes #3618.

Pull-Request: #3626.
2023-03-16 16:10:54 +00:00
873a90edbd fix(identity): remove prost-build from build deps
There's no `build.rs` and `build-dependency` is not needed

Pull-Request: #3619.
2023-03-16 09:55:42 +00:00
32598d89d6 fix(rendezvous): update port in server example to match clients
Pull-Request: #3617.
2023-03-15 11:35:59 +00:00
1b09b8c85c docs(release): Skip unused cargo release steps
`cargo release` provides multiple steps:
- changes
- version
- replace
- hook
- commit
- publish
- owner
- tag
- push
- config
- help

We only make use of `publish` and `tag`. We explicitly don't want `cargo release` to do `version` or `commit`.

Update the release docs accordingly, namely replace the generic `cargo release` with a two step process `cargo release publish` and `cargo release tag`.

Pull-Request: #3596.
2023-03-14 19:22:21 +00:00
d7bf56376e docs(release): clarify how we handle alpha versions
Pull-Request: #3584.
2023-03-14 12:14:12 +00:00
eb5e269165 fix(gossipsub): signed messages use monotonically increasing seq numbers
This modifies the gossipsub implementation to use monotonically increasing sequence numbers for signed messages (as dictated by the specification). There is a discussion about this in #3453. This change will make rust-libp2p gossipsub align with the go-implementation when messages are signed.

Messages will however still use randomized sequence numbers when messages are unsigned for security reasons (as discussed in the issue linked).

This shouldn't change any user-level API, only the seqno behavior. It is fully backwards compatible.

Resolves #3453.

Pull-Request: #3551.
2023-03-14 00:06:01 +00:00