1842 Commits

Author SHA1 Message Date
Chad Nehemiah
d97893d293
swarm(-derive)/: Rename references of protocol handler to connection handler (#2640) 2022-05-18 09:52:50 +02:00
Max Inden
d21cd5fed7
misc/: Move rw-stream-sink into rust-libp2p monorepo (#2641)
* misc/rw-stream-sink: Initial commit

See
62a923cc27

* misc/rw-stream-sink: Update to Rust edition 2021

* misc/rw-stream-sink: Add changelog
2022-05-16 19:17:49 +02:00
hrxi
efe9c07b34
protocols/kad: Update arrayvec dependency to latest version 0.7.2 (#2644) 2022-05-16 18:52:19 +02:00
hrxi
d69681b27c
Drop atomic dependency (#2643)
Replace `atomic::Atomic<u64>` by `std::sync::atomic:AtomicU64`.

The original motivation of using `atomic::Atomic<u64>` instead of
`std`'s version in #1670 was the following:

> I used the atomic crate and an Atomic<u64> because the AtomicU64 type
> isn't available on all architectures. The atomic crate automatically
> falls back to using a Mutex on platforms that don't support AtomicU64.

This argumentation is moot because the crate directly depends on
`libp2p-core` which also uses `AtomicU64`.
2022-05-12 14:05:33 +10:00
Elena Frank
f04f6bb4fc
identify/handler: Improve property name (#2639) 2022-05-11 11:18:20 +10:00
Carson Farmer
5cf68902ce
swarm/: Remove redundant doc strings on behaviour trait (#2634)
Signed-off-by: Carson Farmer <carson.farmer@gmail.com>
2022-05-09 17:53:01 +02:00
dependabot[bot]
93fa86c263
build(deps): Update prometheus-client requirement from 0.15.0 to 0.16.0 (#2631)
* build(deps): Update prometheus-client requirement from 0.15.0 to 0.16.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.15.0...v0.16.0)

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

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

* *: Update changelogs

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-05-06 14:57:40 +02:00
Elena Frank
9c7861f8ed
.github/: Fix config.yml file name & add note for logger (#2633) 2022-05-06 10:36:34 +02:00
Max Inden
afc5b8d8cd
swarm/src/lib: Prioritize Behaviour over Pool and Pool over Listeners (#2627)
Have the main event loop (`Swarm::poll_next_event`) prioritize:

1. Work on `NetworkBehaviour` over work on `Pool`, thus prioritizing
   local work over work coming from a remote.

2. Work on `Pool` over work on `ListenersStream`, thus prioritizing work
   on existing connections over upgrading new incoming connections.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2022-05-05 20:15:24 +02:00
Max Inden
bbd2f8f009
misc/prost-codec: Introduce codec for varint prefixed Protobuf messages (#2630)
Extracts the Protobuf en-/decoding pattern into its separate crate
and applies it to `libp2p-identify`.
2022-05-05 18:28:47 +02:00
Max Inden
3cfbf89a3a
swarm/src/connection/pool: Remove 'a lifetime in PoolEvent (#2625)
Simplifies `PoolEvent`, no longer carrying a reference to an
`EstablishedConnection` or the `Pool`, but instead the `PeerId`,
`ConnectionId` and `ConnectedPoint` directly.

Co-authored-by: Elena Frank <elena.frank@protonmail.com>
2022-05-04 10:33:40 +02:00
Max Inden
3e1ed95cf6
swarm/src/connection: Prioritize handler over connection (#2626)
Prioritize work in handler over work on connection, thus prioritizing local work
over work coming from a remote.
2022-05-03 22:26:28 +02:00
Hubert
70d38520fd
*: Activate clippy::style lint group (#2620) 2022-05-03 13:11:48 +02:00
Chiu-Hsiang Hsu
f46fecd4d7
src/tutorials/ping: Fix typo in multiaddress (#2623) 2022-04-27 08:48:22 +02:00
Hubert
22fbce34d5
*: Fix clippy warnings (#2615) 2022-04-19 12:13:45 +02:00
Wink Saville
0c1ac781a2
src/tutorials/hole-punching: Clarify use of libp2p-lookup & server IP (#2616) 2022-04-18 14:41:25 +02:00
Janmajayamall
c427bb3958
protocols/kad: Implement Error for GetRecordError (#2614) 2022-04-17 10:16:32 +02:00
dependabot[bot]
7ce9fb4fb1
build(deps): Bump Swatinem/rust-cache from 1.3.0 to 1.4.0 (#2613)
* build(deps): Bump Swatinem/rust-cache from 1.3.0 to 1.4.0

Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/v1/CHANGELOG.md)
- [Commits](842ef286ff...cb2cf0cc7c)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Apply suggestions from code review

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-04-17 09:58:51 +02:00
Elena Frank
093863870b
.github/: Add templates for Issues and PRs (#2611) 2022-04-16 16:50:27 +02:00
Divma
a1f3547b43
protocols/gossipsub: Allow score buckets to be set (#2595)
Moves the score buckets to the metrics configuration, setting the same defaults
as what we had but also allowing the user to pass a reference to the score
thresholds to create them from that. Having them in the config also allows users
to set them directly.
2022-04-08 21:32:27 +02:00
Elena Frank
102509afe3
swarm/behaviour: make either mod private (#2610)
With no public items, having this module public serves no purpose.
2022-04-08 09:06:06 +10:00
Elvis
f5b982a13b
protocols/ping: Log remote PeerId instead of payload (#2608) 2022-04-07 21:37:02 +02:00
Max Inden
2ad905f35a
{core,swarm}/: Don't require Transport: Clone and take &mut (#2529)
Previously `libp2p-swarm` required a `Transport` to be `Clone`. Methods
on `Transport`, e.g. `Transport::dial` would take ownership, requiring
e.g. a `Clone::clone` before calling `Transport::dial`.

The requirement of `Transport` to be `Clone` is no longer needed in
`libp2p-swarm`. E.g.  concurrent dialing can be done without a clone per
dial.

This commit removes the requirement of `Clone` for `Transport` in
`libp2p-swarm`. As a follow-up methods on `Transport` no longer take
ownership, but instead a mutable reference (`&mut self`).

On the one hand this simplifies `libp2p-swarm`, on the other it
simplifies implementations of `Transport`.
2022-04-06 20:23:16 +02:00
dependabot[bot]
7a1147877a
build(deps): Update prost-build requirement from 0.9 to 0.10 (#2596)
* build(deps): Update prost-build requirement from 0.9 to 0.10

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/commits)

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

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

* .github/workflow: Don't run integration test in container

* .github/workflow: Don't run doc step in container

* .github/workflows: Remove component docs

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-04-06 15:54:42 +02:00
TotalKrill
90140a6eaf
*: Change structopt to native clap derive implementations (#2600)
Co-authored-by: Max Inden <mail@max-inden.de>
2022-04-05 21:56:44 +02:00
dependabot[bot]
680604f3d3
build(deps): Update prost requirement from 0.9 to 0.10 (#2597)
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/commits)

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

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-04-05 21:35:54 +02:00
Max Inden
f26adbcd84
*: Prepare libp2p v0.44.0 (#2604) 2022-04-04 18:27:41 +02:00
Max Inden
4d796fdca1
protocols/{dcutr,relay}: Expose error types (#2605)
Co-authored-by: canewsin <canews.in@gmail.com>
2022-04-04 11:32:54 +02:00
Max Inden
6cc3b4ec52
*: Import libp2p with default-features = false (#2574)
* *: Import `libp2p` with `default-features = false`

While not a win in most cases, it reduces compile time for tests of
individual crates.

* Cargo.toml: Set features for examples
2022-03-22 11:22:17 +01:00
Yoshiera
3abef2e70c
examples/file-sharing: Exclude two swarm events from panic (#2580) 2022-03-22 10:59:05 +01:00
dependabot[bot]
0c24821a14
build(deps): Bump actions/checkout from 2.4.0 to 3 (#2581)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

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

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-03-21 19:07:21 +01:00
Roman
d81ad52ff8
swarm/src/handler: Add impl IntoIterator for MultiHandler (#2572) 2022-03-21 18:50:44 +01:00
Max Inden
6b5744c33d
.github/workflows: Add cargo audit (#2430)
Run cargo audit on each push and on a daily schedule.
2022-03-18 17:49:28 +01:00
Max Inden
7839e7b362
protocols/gossipsub/Cargo.toml: Update to regex v1.5.5 (#2576)
See https://rustsec.org/advisories/RUSTSEC-2022-0013
2022-03-18 17:13:27 +01:00
Max Inden
e771ab8659
protocols/dcutr/Cargo.toml: Update prost to v0.9 (#2575) 2022-03-18 16:58:01 +01:00
Addy Bryant
b0dc4bc1c7
swarm-derive/: Allow mixing of ignored fields (#2570) 2022-03-18 16:37:00 +01:00
dependabot[bot]
7f97d49073
build(deps): Update derive_builder requirement from 0.10.0 to 0.11.1 (#2568)
Updates the requirements on [derive_builder](https://github.com/colin-kiegel/rust-derive-builder) to permit the latest version.
- [Release notes](https://github.com/colin-kiegel/rust-derive-builder/releases)
- [Commits](https://github.com/colin-kiegel/rust-derive-builder/compare/v0.10.0...v0.11.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-18 15:46:33 +01:00
Pawan Dhananjay
b98d23263a
protocols/gossipsub: Fix metric name (#2558) 2022-03-17 17:44:52 +01:00
Max Inden
ca9d53886d
Revert ".github/workflow: Use ubuntu-18.04 fixing missing protoc binary " (#2554)
* Revert ".github/workflow: Use ubuntu-18.04 fixing missing protoc binary  (#2368)"

* .github: Use llvm installation script
2022-03-17 17:27:17 +01:00
Mitali Bisht
a30d93e34b
src/tutorials/hole-punching: Correct commands to use ip4 instead of dns4 (#2563) 2022-03-17 17:09:19 +01:00
Frederik-Baetens
fe5bc277e2
src/swarm/behaviour: Clarify custom NetworkBehaviour deriviation (#2501) 2022-03-17 16:24:43 +01:00
Akihito Nakano
96103ee590
protocols/autonat: Fix wrong parameter name in examples (#2555) 2022-03-13 10:23:15 +11:00
Gheorghe
69cde63ac7
examples/chat: Fix typo (#2553)
Co-authored-by: Max Inden <mail@max-inden.de>
2022-03-11 13:34:59 +01:00
Fabricio Demattê
e38eb09f5d
misc/keygen: Implement cli tool to handle key material (#2453)
- Load keys from file
- Generate new keys (with optional prefix)
- Replaces peer-id-generator

Co-authored-by: Fabricio Dematte <fabriciodematte7p@gmail.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-03-11 12:44:05 +01:00
Max Inden
108c970a59
protocols/relay: Remove support for Circuit Relay v1 protocol (#2549) 2022-03-11 12:12:10 +01:00
Thomas Eizinger
5291011c73
core/: Add PeerId::try_from_multiaddr (#2551) 2022-03-10 10:43:16 +01:00
Max Inden
a168410dbe
src/tutorials/hole-punching: Update to published blog post (#2550) 2022-03-06 18:06:35 +01:00
413umc
7dfc15fa3d
src/tutorials: Do minor text improvements (#2547) 2022-03-06 17:43:09 +01:00
Max Inden
85f71746c6
README: Remove mention of Network in libp2p-core (#2548) 2022-03-05 20:29:15 +01:00
John Hall
19bc106b9c
misc/metrics: Move from tide to hyper (#2528)
Metrics example server based on hyper replaces a component based on Tide
framework. This removes dependency on Tide which triggered audit warnings.

Co-authored-by: Max Inden <mail@max-inden.de>
2022-03-05 15:15:10 +01:00