2619 Commits

Author SHA1 Message Date
Thomas Eizinger
6b6187bd1c
fix(identity): remove prost dependency
Pull-Request: #3713.
2023-04-09 15:48:43 +00:00
dependabot[bot]
23c3d24610
deps: bump if-watch from 3.0.0 to 3.0.1
Pull-Request: #3730.
2023-04-09 14:27:58 +00:00
Thomas Eizinger
451c64a8b8
fix: specify correct libp2p-swarm dependency
With https://github.com/libp2p/rust-libp2p/pull/3658, these crates depend on the `0.42.1` release to access the new `ToSwarm` type. With the currently specified version, a user could theoretically run into a compile error if they pin `libp2p-swarm` to `0.42.0` in their lockfile but update to the latest patch release of one of these crates.

Pull-Request: #3711.
2023-04-05 19:44:32 +00:00
dependabot[bot]
bdc618e9c7
deps: bump tempfile from 3.4.0 to 3.5.0
Pull-Request: #3720.
2023-04-05 15:35:00 +00:00
dependabot[bot]
17dd72755d
deps: bump tokio from 1.26.0 to 1.27.0
Pull-Request: #3729.
2023-04-05 14:37:42 +00:00
Thomas Eizinger
7c85f92e31
refactor(gossipsub): use pop instead of remove
Doesn't change any functionality but `pop` returns an `Option` whereas `remove` will panic on out-of-bounds. I am more comfortable with `pop` and a pattern match. Also, usage of `continue` allows us to not use an `else`.

Pull-Request: #3734.
2023-04-04 16:04:40 +00:00
dependabot[bot]
95fa913923
deps: bump multiaddr from 0.17.0 to 0.17.1
Pull-Request: #3688.
2023-04-04 13:38:53 +00:00
Max Inden
5f2fff58c3
fix(.github): use run-interop-ping @master
We are currently using an old version of the ping interop tests. E.g. we are missing https://github.com/libp2p/test-plans/pull/148 which adds rust-libp2p v0.51.0.

Pull-Request: #3708.
2023-04-04 12:22:41 +00:00
Darius Clark
f2a7457fde
fix(gossipsub): prevent erroneously duplicate message IDs
Previously, we only mutably borrowed the `last_seq_no` in the current scope but did not modify the underlying number. This is because `u64` is copy and calling `wrapping_add` consumes `self` so the compiler just copied it. We introduce a new-type instead that is not `Copy`.

Additionally, `wrapping_add` and initializing with a random u64 might actually warp the number and thus not give us sequential numbers as intended in #3551. To solve this, we initialize with the current unix timestamp in nanoseconds. This allows a node to publish 1000000 messages a second and still not reuse sequence numbers even after a restart / re-initialization of the configuration. This is also what the go implementation does.

Resolves #3714.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>

Pull-Request: #3716.
2023-04-04 10:52:16 +00:00
dependabot[bot]
e350630caf
deps: bump webpki-roots from 0.22.6 to 0.23.0
Pull-Request: #3723.
2023-04-04 10:23:21 +00:00
Thomas Coratger
44d4b1133d
feat(libp2p): deprecate mplex
`mplex` module (no flow control and no streams limit) is deprecated to encourage `yamux` usage.

Resolves #3677.

Pull-Request: #3689.
2023-04-04 09:49:59 +00:00
Thomas Eizinger
4bbc108103
docs(libp2p): fix typo in changelog
There is no `0.52.2` version yet, only `0.51.2`.

Pull-Request: #3732.
2023-04-04 08:25:35 +00:00
dependabot[bot]
389e519e7f
deps: bump clap from 4.1.11 to 4.2.1
Pull-Request: #3731.
2023-04-03 19:02:18 +00:00
dependabot[bot]
5604538357
deps: bump hex-literal from 0.3.4 to 0.4.0
Pull-Request: #3727.
2023-04-03 16:40:47 +00:00
dependabot[bot]
6e93df79ae
deps: bump quinn-proto from 0.9.2 to 0.9.3
Pull-Request: #3726.
2023-04-03 15:45:41 +00:00
dependabot[bot]
0ff0ef7a35
deps: bump futures from 0.3.27 to 0.3.28
Pull-Request: #3725.
2023-04-03 14:43:42 +00:00
dependabot[bot]
3a9debf508
deps: bump serde_json from 1.0.94 to 1.0.95
Pull-Request: #3722.
2023-04-03 14:07:13 +00:00
dependabot[bot]
e5601dc998
deps: bump async-trait from 0.1.67 to 0.1.68
Pull-Request: #3721.
2023-04-03 13:32:07 +00:00
shamil-gadelshin
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
Max Inden
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
Thomas Eizinger
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
Thomas Eizinger
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
dependabot[bot]
972ba4ca08
deps: bump serde from 1.0.157 to 1.0.159
Pull-Request: #3697.
2023-03-29 20:55:58 +00:00
Thomas Eizinger
bcbff8e534
docs(ROADMAP): mark connection management as done
Pull-Request: #3695.
2023-03-29 17:42:26 +00:00
dependabot[bot]
4158f7120a
deps: bump syn from 2.0.2 to 2.0.11
Pull-Request: #3696.
2023-03-29 16:27:12 +00:00
dependabot[bot]
be42f214bf
deps: bump regex from 1.7.1 to 1.7.3
Pull-Request: #3687.
2023-03-29 13:47:44 +00:00
Max Inden
486ac8baf2
chore: prepare libp2p v0.51.2
Depends-On: #3693.

Pull-Request: #3694.
2023-03-29 13:04:18 +00:00
dependabot[bot]
bd0459121f
deps: bump zeroize from 1.5.7 to 1.6.0
Pull-Request: #3685.
2023-03-29 12:07:18 +00:00
dependabot[bot]
ea573b3b49
deps: bump bimap from 0.6.2 to 0.6.3
Pull-Request: #3641.
2023-03-29 11:28:43 +00:00
dependabot[bot]
ce55601683
deps: bump async-io from 1.12.0 to 1.13.0
Pull-Request: #3683.
2023-03-29 10:59:41 +00:00
dependabot[bot]
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
Max Inden
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
dependabot[bot]
4897b2e4b1
deps: bump async-trait from 0.1.66 to 0.1.67
Pull-Request: #3642.
2023-03-27 11:17:09 +00:00
Max Inden
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
Predrag Gruevski
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
Thomas Eizinger
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
dependabot[bot]
7e9581c4ef
deps: bump thiserror from 1.0.39 to 1.0.40
Pull-Request: #3637.
2023-03-24 14:17:02 +00:00
Thomas Eizinger
dcbc04e89e
feat(swarm): rename NetworkBehaviourAction to ToSwarm
Resolves #3123.

Pull-Request: #3658.
2023-03-24 13:43:49 +00:00
Oleg Kubrakov
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
Thomas Eizinger
fd0983567c
chore(relay): move server example to examples/
Related: #3111.

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

Pull-Request: #3662.
2023-03-23 21:10:52 +00:00
Max Inden
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
Thomas Eizinger
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
Thomas Eizinger
83c2aca298
feat(mergify): report merge conflicts for draft PRs
Pull-Request: #3614.
2023-03-23 02:22:53 +11:00
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