2425 Commits

Author SHA1 Message Date
Thomas Eizinger
3411b2697c
docs: update policy on breaking changes and changelog entry format
Pull-Request: #3615.
2023-03-22 14:21:43 +00:00
Anton
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
Lin Oshitani
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
Thomas Eizinger
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
Thomas Eizinger
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
Thomas Eizinger
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
Thomas Eizinger
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
Thomas Eizinger
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
dependabot[bot]
4f18d0413c
deps: bump syn from 1.0.109 to 2.0.2
Pull-Request: #3645.
2023-03-20 18:22:58 +00:00
Max Inden
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
dependabot[bot]
06d644b63d
deps: bump x509-parser from 0.14.0 to 0.15.0
Pull-Request: #3640.
2023-03-20 15:30:09 +00:00
dependabot[bot]
e9b45db786
deps: bump quote from 1.0.25 to 1.0.26
Pull-Request: #3639.
2023-03-20 14:47:10 +00:00
dependabot[bot]
15ef8c0325
deps: bump clap from 4.1.8 to 4.1.11
Pull-Request: #3638.
2023-03-20 14:06:08 +00:00
dependabot[bot]
ea5917bcbb
deps: bump actions/deploy-pages from 1 to 2
Pull-Request: #3636.
2023-03-20 13:32:09 +00:00
dependabot[bot]
252d504d5a
deps: bump serde from 1.0.155 to 1.0.157
Pull-Request: #3643.
2023-03-20 13:03:01 +00:00
dependabot[bot]
ba38685ba7
deps: bump anyhow from 1.0.69 to 1.0.70
Pull-Request: #3644.
2023-03-20 12:26:55 +00:00
Max Inden
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
Thomas Eizinger
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
creativcoder
14292c4758
feat(identity): add From impls for specific keypair types
Closes #3618.

Pull-Request: #3626.
2023-03-16 16:10:54 +00:00
hanabi1224
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
Saddam UWEJAN
32598d89d6
fix(rendezvous): update port in server example to match clients
Pull-Request: #3617.
2023-03-15 11:35:59 +00:00
Max Inden
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
Thomas Eizinger
d7bf56376e
docs(release): clarify how we handle alpha versions
Pull-Request: #3584.
2023-03-14 12:14:12 +00:00
Age Manning
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
Victor Ermolaev
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
Victor Ermolaev
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
DrHuangMHT
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
Max Inden
8927abf176
docs(README): update examples link 2023-03-13 15:03:47 +01:00
dependabot[bot]
18caef76cb
deps: bump serde from 1.0.152 to 1.0.155
Pull-Request: #3599.
2023-03-13 12:29:37 +00:00
dependabot[bot]
34d7af818b
deps: bump snow from 0.9.1 to 0.9.2
Pull-Request: #3600.
2023-03-13 12:05:06 +00:00
dependabot[bot]
9d0ec7e074
deps: bump futures from 0.3.26 to 0.3.27
Pull-Request: #3597.
2023-03-13 11:35:04 +00:00
dependabot[bot]
2e6564f786
deps: bump libc from 0.2.139 to 0.2.140
Pull-Request: #3601.
2023-03-13 11:00:58 +00:00
dependabot[bot]
feaba061ca
deps: bump quote from 1.0.23 to 1.0.25
Pull-Request: #3602.
2023-03-13 10:19:32 +00:00
Thomas Eizinger
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
Max Inden
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
Thomas Eizinger
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
Max Inden
3959b2ccef
docs: Prepare v0.51.1 (#3594) 2023-03-12 16:42:57 +01:00
Thomas Eizinger
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
Thomas Eizinger
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
Doug A
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
Thomas Eizinger
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
Thomas Eizinger
8555e083d8
fix: update Cargo.lock after version bumps
Pull-Request: #3586.
2023-03-10 15:53:36 +00:00
Max Inden
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
Max Inden
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
Max Inden
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
Thomas Eizinger
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
Thomas Eizinger
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
Thomas Eizinger
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
GitHub
0def9606a7 chore: Update .github/workflows/semantic-pull-request.yml [skip ci] 2023-03-09 12:35:15 +00:00
Thomas Eizinger
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