Commit Graph

2619 Commits

Author SHA1 Message Date
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
2a18f7a5f0 fix(swarm): gracefully disable oneshot handler on dial upgrade errors
Resolves https://github.com/libp2p/rust-libp2p/issues/3269.

Pull-Request: #3577.
2023-03-13 20:37:59 +00:00
2ec5402474 feat(swarm): enforce creation of Swarm via SwarmBuilder
Mark constructors `Swarm::with_X_executor` as deprecated.
Move the deprecated functionality to `SwarmBuilder::with_X_executor`
Use `SwarmBuilder` throughout.

Resolves #3186.
Resolves #3107.

Pull-Request: #3588.
2023-03-13 19:53:14 +00:00
9d05c619e8 feat: derive Clone for mdns::Event
Derive trait `Clone` for `mdns::Event`. This makes cloning its contents without destroying type information possible.



Related #3593.

Pull-Request: #3606.
2023-03-13 17:17:03 +00:00
8927abf176 docs(README): update examples link 2023-03-13 15:03:47 +01:00
18caef76cb deps: bump serde from 1.0.152 to 1.0.155
Pull-Request: #3599.
2023-03-13 12:29:37 +00:00
34d7af818b deps: bump snow from 0.9.1 to 0.9.2
Pull-Request: #3600.
2023-03-13 12:05:06 +00:00
9d0ec7e074 deps: bump futures from 0.3.26 to 0.3.27
Pull-Request: #3597.
2023-03-13 11:35:04 +00:00
2e6564f786 deps: bump libc from 0.2.139 to 0.2.140
Pull-Request: #3601.
2023-03-13 11:00:58 +00:00
feaba061ca deps: bump quote from 1.0.23 to 1.0.25
Pull-Request: #3602.
2023-03-13 10:19:32 +00:00
ab35c55fc9 feat(ci): remove protoc installation where possible
We only retain it for the test job which runs `cargo semver-checks` which may need to build the rustdoc for the baseline version which still requires `protoc` to be installed until we make the next round of releases.

Pull-Request: #3592.
2023-03-13 08:01:47 +00:00
b11e53fe62 feat(.editorconfig): set insert_final_newline to true
Instructs editors to insert a newline at the end of a file and thus prevents GitHub flagging the missing newline.

Pull-Request: #3578.
2023-03-13 07:29:29 +00:00
8269b52887 feat(ci): update Rust version used for clippy to latest release (1.68.0)
Pull-Request: #3585.
2023-03-12 20:41:34 +00:00
3959b2ccef docs: Prepare v0.51.1 (#3594) 2023-03-12 16:42:57 +01:00
2a14df25eb feat: introduce libp2p-identity crate
This patch combines the `libp2p_core::identity` and `libp2p_core::peer_id` modules into a new crate: `libp2p-identity`.

Resolves https://github.com/libp2p/rust-libp2p/issues/3349.

Pull-Request: #3350.
2023-03-12 15:46:58 +01:00
d81f9476f7 fix(ci): use --locked instead of --frozen for lockfile check
`--frozen` also forbids network requests which fails in CI because we need to contact the registry in a clean CI container.

Pull-Request: #3589.
2023-03-11 09:54:32 +00:00
83ef657500 fix(webrtc): gracefully handle resets of individual connections
Fixes https://github.com/libp2p/rust-libp2p/issues/3574

Pull-Request: #3575.
2023-03-10 17:40:59 +00:00
dea6a8c4a9 feat(ci): add dedicated job for ensuring the lockfile is up-to-date
Instead of running with `--locked` which would require us to pick a CI job that does this, we can add a dedicated job that only has as its responsibility to ensure that `Cargo.lock` is up-to-date.

Fixes #3547.

Pull-Request: #3587.
2023-03-10 17:02:12 +00:00
8555e083d8 fix: update Cargo.lock after version bumps
Pull-Request: #3586.
2023-03-10 15:53:36 +00:00
69af8506d1 docs: Reintroduce root level changelog file
- Moved with https://github.com/libp2p/rust-libp2p/pull/3012
- Dependabot always shows root `CHANGELOG.md` in pull request on dependent repository

Pull-Request: #3583.
2023-03-10 14:36:50 +00:00
1f31e0c8c5 fix(libp2p): do not pin alpha versions
We will embrace the fact that cargo auto updates to new alpha versions. We can prevent auto updates on breaking alpha versions by bumping their minor version.

Reverts https://github.com/libp2p/rust-libp2p/pull/3538/

Pull-Request: #3582.
2023-03-10 12:40:19 +00:00
aedecf709c feat(tls): Promote to v0.1.0
Promotes `libp2p-tls` to `v0.1.0` thus removing the complexity of cargo's handling of `-alpha` releases for `libp2p-tls`.

Pull-Request: #3581.
2023-03-10 11:49:03 +00:00
0cad636eba fix: move changelog entries to correct version
Whilst https://github.com/libp2p/rust-libp2p/pull/3312 was in development, we pushed a new release out and forgot to move the changelog entries to the new version. Unfortunately, this is all still very manual until we have a solution for https://github.com/libp2p/rust-libp2p/issues/2902 so this stuff keeps happening.

Pull-Request: #3541.
2023-03-10 10:59:49 +00:00
c06731bc38 refactor: use target_arch instead of target_os for wasm cfg's
As far as I can tell, this is equivalent and less verbose.

Pull-Request: #3572.
2023-03-10 06:44:39 +00:00
ad022017b6 chore: update pull-request template
With the adoption of mergify, we now use the `## Description` section as the commit message. Update the PR template to guide users towards crafting a good commit message. Specifically, ask them to point to relevant issues and PRs at the end of the message instead of in a separate section.

Pull-Request: #3570.
2023-03-10 06:21:43 +00:00
0def9606a7 chore: Update .github/workflows/semantic-pull-request.yml [skip ci] 2023-03-09 12:35:15 +00:00
a613aaf0eb fix: remove stale libp2p/examples dir
The examples have been moved but we forgot to delete the old README.

Pull-Request: #3573.
2023-03-08 18:58:19 +00:00
63727bda64 fix(examples): use absolute paths to link to examples
The examples have recently been moved to a new directory. Use absolute paths to link to them and fix two bad links from renamed crates.

Pull-Request: #3571.
2023-03-08 17:43:10 +00:00
ff66f8edff deps: bump serde_json from 1.0.93 to 1.0.94
Pull-Request: #3553.
2023-03-08 13:42:29 +00:00
d53cfed236 chore: move libp2p crate to a dedicated directory
Currently, our top-level `Cargo.toml` manifest represents a crate AND a workspace. This causes surprising behaviour (e.g. #2949) where we need to explicitly pass `--workpace` to every command to run it on the entire workspace and not just the meta crate.

My moving the meta crate into its own directory, the root manifest file is a virtual manifest only and thus, every `cargo` command will automatically default to running on the entire workspace.

On top of this, I personally find it easier to understand if workspace and crate manifests are not mixed.

Pull-Request: #3536.
2023-03-08 13:20:39 +00:00
645b229d43 deps: bump thiserror from 1.0.38 to 1.0.39
Pull-Request: #3554.
2023-03-08 12:59:53 +00:00
9c177d1673 deps: bump async-trait from 0.1.64 to 0.1.66
Pull-Request: #3555.
2023-03-08 12:39:06 +00:00
7069d78ee3 test: introduce libp2p-swarm-test
This patch-set introduces `libp2p-swarm-test`. It provides utilities for quick and safe bootstrapping of tests for `NetworkBehaviour`s. The main design features are:

- Everything has timeouts
- APIs don't get in your way
- Minimal boilerplate

Closes #2884.

Pull-Request: #2888.
2023-03-08 09:36:35 +00:00