Commit Graph

2601 Commits

Author SHA1 Message Date
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
8a27375f96 fix(clippy): bump clap to latest version
The recent beta release of clippy flags some code usage in clap. Bump clap's version to avoid the CI failure.

See https://github.com/clap-rs/clap/issues/4733.

Pull-Request: #3569.
2023-03-08 08:39:36 +00:00
b63e05dad6 refactor: move examples to common location
Refactor examples into separate binary crates.

Fixes https://github.com/libp2p/rust-libp2p/issues/3111.

Pull-Request: #3509.
2023-03-08 08:17:33 +00:00
2c10cd838a refactor(uds): Move WASM feature flagging to root Cargo.toml
Crates that don't compile for WASM are feature flagged in the root `Cargo.toml`, expcept for `libp2p-uds`. This commit removes the inconsistency.

As a side-effect, this might help prevent bugs like https://github.com/libp2p/rust-libp2p/pull/3502 going forward.

Pull-Request: #3503.
2023-03-07 14:02:13 +00:00
6b73dac59b feat(noise): remove tests for deprecated protocol
With `0.51`, we finally officially deprecated the non-spec compliant version of noise. This one needs a very heavy dependency for testing: `libsodium-sys-stable`.

I propose to remove the tests now. The actual implementation is not yet removed because it would be a breaking change. Once we decide to make the next breaking change, we can also include the removal of the deprecated API.

Pull-Request: #3510.
2023-03-07 13:30:47 +00:00
d529945286 deps: bump Swatinem/rust-cache from 2.2.0 to 2.2.1
Pull-Request: #3516.
2023-03-06 21:15:57 +00:00
1a2608d084 fix(dcutr): don't set dial concurrency factor in example
Since https://github.com/libp2p/rust-libp2p/pull/2741 the default dial concurrency factor is > 1, more specifically 8. Thus there is no need to explicitly set it anylonger.

Pull-Request: #3550.
2023-03-06 11:48:03 +00:00
050504fbe5 fix(libp2p-quic): pin and update tls prerelease dep
Pin libp2p-quic's tls prerelease dependency and update it

Pull-Request: #3548.
2023-03-03 20:16:00 +00:00
12b785e94e fix(quic,tls,webrtc): pin pre-release version
If pre-releases aren't pinned, new ones can introduce breaking changes and be automatically fetched by cargo.

Pull-Request: #3538.
2023-03-03 04:01:16 +00:00
972ed39283 feat(ci): remove semantic PR title check in favor of dedicated workflow
With https://github.com/libp2p/github-mgmt/pull/125, we will have a dedicated workflow that validates the PR title. Remove our custom step in favor of that.

Pull-Request: #3496.
2023-03-03 02:58:20 +00:00
db82e0210e feat: migrate to quick-protobuf
Instead of relying on `protoc` and buildscripts, we generate the bindings using `pb-rs` and version them within our codebase. This makes for a better IDE integration, a faster build and an easier use of `rust-libp2p` because we don't force the `protoc` dependency onto them.

Resolves #3024.

Pull-Request: #3312.
2023-03-02 10:45:07 +00:00
4910160bea chore: Update .github/workflows/semantic-pull-request.yml [skip ci] 2023-03-02 09:50:32 +00:00
1a1635347d feat(ci): remove actions-rs/cargo and use r7kamura/rust-problem-matchers
Resolves https://github.com/libp2p/rust-libp2p/issues/3398.

Pull-Request: #3528.
2023-03-02 04:41:55 +00:00
bc88900641 deps: update p256 requirement from 0.11.1 to 0.12.0
Pull-Request: #3336.
2023-03-01 04:34:49 +00:00
10f948d8c0 feat(ci): consider dtolnay/rust-toolchain a trusted action
dtolnay is a very reputable member of the Rust community. I'd like to propose to make an exception to the "pin all external actions to a hash" rule. The action is updated very regularly and causes spam in the form of dependabot PRs.

Additionally, by pinning the action we cannot make use of the very neat shorthand syntax of specifying the desired Rust version.

Pull-Request: #3487.
2023-03-01 02:55:58 +00:00
73013de3f1 refactor: remove unused dependencies
Pull-Request: #3530.
2023-02-28 23:39:01 +00:00
7f5b40af17 feat(ci): cache registry baseline rustdoc JSON
The latest release (v0.18) of `cargo semver-checks` includes a [feature](https://github.com/obi1kenobi/cargo-semver-checks/pull/339) where the rustdoc JSON files for registry baselines is cached in `target/semver-checks/cache`. The rustdoc JSON files for released crates never changes as the source code on crates.io cannot be changed once a version is published. Thus, it is unnecessary to generate that JSON on every CI run.

We extract a separate action that installs `cargo semver-checks` for us and also sets up a cache. The cache is scoped to released version of the crate, meaning it automatically invalidates once we publish a new version.

This speeds up the `cargo semver-checks` step by 50% which is ~ 1 minute per job.

Pull-Request: #3469.
2023-02-28 08:06:47 +00:00
c1bb234563 deps: bump prost-build from 0.11.6 to 0.11.8
Pull-Request: #3525.
2023-02-28 07:32:16 +00:00
b1beab71aa deps: bump syn from 1.0.107 to 1.0.109
Pull-Request: #3524.
2023-02-28 06:53:24 +00:00