Commit Graph

1978 Commits

Author SHA1 Message Date
749ff00a79 transports/noise: Have NoiseAuthenticated::xx use X25519Spec (#2954)
We support two versions of the Noise XX handshake with X25519, but only one of
them is compliant with the specification and thus compliant with other
implementations. We should always default to the spec compliant handshake.

Fixes bug introduced in https://github.com/libp2p/rust-libp2p/pull/2887/
2022-09-29 13:16:22 +01:00
04b07c4d14 swarm-derive: Specify NetworkBehaviour by full path (#2932)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-09-27 19:27:32 +10:00
b28ab2c6bc build(deps): Update lru to 0.8.0 (#2908)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-09-27 11:39:10 +10:00
d747537911 README: Update notable users (#2922)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2022-09-24 22:49:45 +10:00
0063722bda examples/README: Reference hole punching tutorial (#2935) 2022-09-24 22:14:46 +10:00
121a11c7f1 swarm: Provide peer_id to inject_dial_failure on connection limit error (#2928) 2022-09-23 12:57:52 +02:00
bcff814b92 core/identity: Implement Hash and Ord for PublicKey (#2915)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2022-09-22 19:35:42 +02:00
0a12418b18 build(deps): Bump actions/stale from 3 to 6 (#2929)
Bumps [actions/stale](https://github.com/actions/stale) from 3 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v3...v6)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 18:14:35 +02:00
e530118fb0 build(deps): Bump rand to 0.8 and quickcheck to 1 (#2857)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-09-22 18:48:32 +10:00
a4d1e58836 swarm/connection: Enforce limit on inbound substreams via StreamMuxer (#2861)
* Provide separate functions for injecting in- and outbound streams

* Inline `HandlerWrapper` into `Connection`

* Only poll for new inbound streams if we are below the limit

* yamux: Buffer inbound streams in `StreamMuxer::poll`
2022-09-21 15:02:21 +02:00
f4362cb8aa CHANGELOG: Add missing entry for noise update (#2912) 2022-09-21 14:14:53 +02:00
ed1b89902a protocols/noise: Add NoiseConfig::with_prologue (#2903) 2022-09-21 13:46:35 +02:00
39d63513d4 chore: Update .github/workflows/stale.yml [skip ci] 2022-09-19 13:41:33 +00:00
45faefa36c *: Unfiy how we depend on crates across the workspace (#2886) 2022-09-19 17:32:02 +10:00
2025de3ef0 swarm-derive/: Allow for templated behaviours (#2907)
This patch fixes an issue where we couldn't use type parameters on a behaviour
with a custom out event that had different type parameters.
2022-09-16 16:57:41 +02:00
c81b06a9b2 *: Fix various clippy warnings (#2900) 2022-09-16 16:30:11 +02:00
2c739e9bdb protocols/noise: Introduce NoiseAuthenticated::xx constructor with X25519 DH key exchange (#2887)
Co-authored-by: Max Inden <mail@max-inden.de>
2022-09-16 11:41:35 +10:00
5906140d38 protocols/kad: Remove deprecated set_protocol_name() (#2866) 2022-09-15 15:30:32 +02:00
72bade1799 build(deps): Update env_logger to 0.9 and criterion to 0.4 (#2896) 2022-09-14 13:01:41 +10:00
66c275520d swarm/: Fix rare test failure of multiple_addresses_err (#2882)
In case we accidentally generate the same port twice, we will try to
issue two dial attempts to the same address but also expect two dial
errors which is exactly what this test is trying to catch.
Unfortunately, the assertion is badly written and does not catch
duplicate inputs.
2022-09-11 08:55:26 +02:00
457fb51ee0 transports/tcp: Simplify IfWatcher integration (#2813)
With if-watch `2.0.0` `IfWatcher::new` is not async anymore, hence the
`IfWatch` wrapping logic is obsolete.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2022-09-10 12:40:09 +02:00
c650dc19db *: Replace _serde with dep:serde in Cargo.toml (#2868) 2022-09-08 18:30:43 +10:00
83c67954e9 *: Prepare v0.48.0 (#2869) 2022-09-07 09:44:51 +02:00
d2eddf4ff1 muxers/yamux: Remove OpenSubstreamToken (#2873) 2022-09-07 09:25:33 +02:00
2eca38cca0 core/upgrade/: Add ReadyUpgrade (#2855) 2022-09-07 09:08:23 +02:00
8644c65a22 core/: Introduce rsa feature flag to avoid ring dependency (#2860)
- Introduce `rsa` feature flag to `libp2p-core`.
- Expose `rsa` feature in `libp2p`.
- Add `rsa` feature to `libp2p` `default`.
2022-09-07 08:16:22 +02:00
a40180c3d8 .github/: Introduce interop tests (#2835)
Adds two workflows on push & PR:

* `run-ping-interop-cross-version`: runs a Testground interoperability test
  between multiple versions of rust-libp2p, including master, and the current
  branch (during a pull request)
* `run-ping-interop-cross-implementation`: runs a Testground interoperability
  test between go-libp2p and rust-libp2p, and the current branch (during a pull
  request)

We rely on the https://github.com/libp2p/test-plans/ repository to retrieve and
run the tests.

Co-authored-by: Piotr Galar <piotr.galar@gmail.com>
2022-09-07 06:10:01 +02:00
b8c3b282ee protocols/gossipsub: Allow publishing to anything that implements Into<TopicHash> (#2862) 2022-09-05 06:31:13 +02:00
f04df2901b .git-blame-ignore-revs/: Initialize and add rustfmt commit (#2864)
Ignoring certain revisions helps in finding the "correct" commit
that touched a file last.

For more information, see:

https://www.git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt
2022-09-04 14:29:39 +02:00
cee199afca protocols/kad: Support multiple protocol names (#2846)
Add support for multiple Kademlia protocol names to allow
protocol name upgrades.
2022-09-03 02:46:50 +02:00
89f898c69f protocols/mdns: Allow users to choose between async-io and tokio runtime (#2748)
Allow users to choose between async-io and tokio runtime
in the mdns protocol implementation. `async-io` is a default
feature, with an additional `tokio` feature.

Fix high CPU usage with Tokio library.
2022-09-02 05:53:38 +02:00
36a2773861 *: Update changelogs for prost dep update (#2851) 2022-08-30 10:03:54 +02:00
f16561c960 .github/workflows: Split advisory issues from PR workflows using cargo-deny (#2803) 2022-08-30 09:48:26 +02:00
e01f77bc49 transports/noise: Migrate away from deprecated sodiumoxide for tests (#2817) 2022-08-30 09:20:41 +02:00
6855ab943b swarm-derive/: Remove support for ignoring fields on struct (#2842)
With the removal of `NetworkBehaviourEventProcess` there is no more need for
ignoring fields.
2022-08-29 07:39:47 +02:00
247b5536d4 swarm-derive/: Remove support for custom poll method (#2841)
With the removal of `NetworkBehaviourEventProcess` there is no more need for a
custom poll method.
2022-08-28 10:51:49 +02:00
a3dec471c0 docs/coding-guidelines: Document limit on number of tasks (#2839)
Add guideline to limit number of tasks being spawned.
2022-08-26 09:02:14 +02:00
ca07ce4d64 swarm/behaviour: Remove deprecated NetworkBehaviourEventProcess (#2840)
Removes the `NetworkBehaviourEventProcess` and all its associated logic.

See deprecation pull request https://github.com/libp2p/rust-libp2p/pull/2784.

Find rational in https://github.com/libp2p/rust-libp2p/pull/2751.
2022-08-26 07:08:33 +02:00
d92cab8581 build(deps): Update p256 requirement from 0.10.0 to 0.11.0 (#2636)
* build(deps): Update p256 requirement from 0.10.0 to 0.11.0

Updates the requirements on [p256](https://github.com/RustCrypto/elliptic-curves) to permit the latest version.
- [Release notes](https://github.com/RustCrypto/elliptic-curves/releases)
- [Commits](https://github.com/RustCrypto/elliptic-curves/commits/p256/v0.10.1)

---
updated-dependencies:
- dependency-name: p256
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* core/: Bump version and add changelog entry

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-08-23 09:51:58 +02:00
d610e4b0fb protocols/dcutr: Disable libp2p-core default features (#2836) 2022-08-23 09:12:00 +02:00
4253080a43 *: Prepare v0.47.0 (#2830) 2022-08-22 05:14:04 +02:00
217dd2ca22 clippy.toml: Create config and disallow unbounded channels (#2823)
When using channels (e.g. `futures::channel::mpsc` or `std::sync::mpsc`)
always use the bounded variant, never use the unbounded variant. When
using a bounded channel, a slow consumer eventually slows down a fast
producer once the channel bound is reached, ideally granting the slow
consumer more system resources e.g. CPU time, keeping queues small and
thus latencies low.  When using an unbounded channel a fast producer
continues being a fast producer, growing the channel buffer
indefinitely, increasing latency until the illusion of unboundedness
breaks and the system runs out of memory.

One may use an unbounded channel if one enforces backpressure through an
out-of-band mechanism, e.g. the consumer granting the producer
send-tokens through a side-channel.
2022-08-20 07:31:45 +02:00
3d3666e1a6 *: Enforce no clippy warnings for examples (#2826) 2022-08-20 05:48:22 +02:00
8931860b2f core/identity: Allow clippy::large-enum-variant on Keypair (#2827) 2022-08-19 05:06:55 +02:00
475289c19c docs/coding-guidelines: Add document (#2780)
Add document outlining a set of coding guidelines followed and to be
followed across the rust-libp2p code base.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2022-08-17 09:03:20 +02:00
a2738fd555 swarm-derive/: Derive Debug for generated OutEvent (#2821)
When generating an `OutEvent` `enum` definition for a user, derive `Debug`
for that `enum`.

Why not derive `Clone`, `PartialEq` and `Eq` for the generated `enum`
definition?

While it is fine to require all sub-`OutEvent`s to implement
`Debug`, the same does not apply to traits like `Clone`. I
suggest users that need `Clone` to define their own `OutEvent`.
2022-08-17 08:40:32 +02:00
d2c50530e9 build(deps): Update prometheus-client requirement from 0.17.0 to 0.18.0 (#2822)
* build(deps): Update prometheus-client requirement from 0.17.0 to 0.18.0

Updates the requirements on [prometheus-client](https://github.com/prometheus/client_rust) to permit the latest version.
- [Release notes](https://github.com/prometheus/client_rust/releases)
- [Changelog](https://github.com/prometheus/client_rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_rust/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: prometheus-client
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-17 07:02:21 +02:00
67266c6a66 swarm-derive/: Add where clause of behaviour to generated out event (#2819)
When generating the `OutEvent` for a `NetworkBehaviour`, add the `where` clause of the
`NetworkBehaviour` `struct` to the generated `enum`.
2022-08-17 06:43:47 +02:00
8dc0188a1d swarm/src/connection: Test max_negotiating_inbound_streams (#2785)
Test that `HandlerWrapper` upholds the provided
`max_negotiating_inbound_streams` limit.
2022-08-16 10:15:31 +02:00
6a9fa3d930 build(deps): Update prost requirement from 0.10 to 0.11 (#2788)
* build(deps): Update prost-build requirement from 0.10 to 0.11

Updates the requirements on [prost-build](https://github.com/tokio-rs/prost) to permit the latest version.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: prost-build
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): Update prost requirement from 0.10 to 0.11

Updates the requirements on [prost](https://github.com/tokio-rs/prost) to permit the latest version.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: prost
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-16 08:49:09 +02:00