1930 Commits

Author SHA1 Message Date
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
dependabot[bot]
59bba65ac0
build(deps): Update async-std-resolver requirement from 0.20 to 0.21 (#2543)
* build(deps): Update async-std-resolver requirement from 0.20 to 0.21

Updates the requirements on [async-std-resolver](https://github.com/bluejekyll/trust-dns) to permit the latest version.
- [Release notes](https://github.com/bluejekyll/trust-dns/releases)
- [Changelog](https://github.com/bluejekyll/trust-dns/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluejekyll/trust-dns/compare/v0.20.0...v0.21.1)

---
updated-dependencies:
- dependency-name: async-std-resolver
  dependency-type: direct:production
...

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

* build(deps): Update trust-dns-resolver requirement from 0.20 to 0.21

Updates the requirements on [trust-dns-resolver](https://github.com/bluejekyll/trust-dns) to permit the latest version.
- [Release notes](https://github.com/bluejekyll/trust-dns/releases)
- [Changelog](https://github.com/bluejekyll/trust-dns/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluejekyll/trust-dns/compare/v0.20.0...v0.21.1)

---
updated-dependencies:
- dependency-name: trust-dns-resolver
  dependency-type: direct:production
...

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

* transports/dns: Bump patch version

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2022-03-02 14:10:53 +01:00
Max Inden
b919d0002a
swarm/src/lib: Improve connection counting for test_behaviour_disconnect_all (#2532) 2022-03-02 12:10:57 +01:00
dependabot[bot]
a179dbb449
build(deps): Bump actions/checkout from 2.4.0 to 3 (#2544)
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>
2022-03-02 11:26:08 +01:00
Thomas Eizinger
d1f472b3c0
core/src/transport: Don't print inner error when returning as source (#2533)
According to
https://github.com/rust-lang/project-error-handling/issues/44#issuecomment-858151860,
we should not be printing the inner error AND returning it as source. Libraries
like `anyhow` will traverse the chain of `source` errors and build up a composed
error message. Printing it and returning the same error from `source` results in
duplicate error messages in that case.
2022-03-01 15:39:01 +01:00
Karatus
fd31d61a7f
examples/chat-tokio.rs: Fix typo (#2541) 2022-02-28 10:50:07 +01:00
Friedel Ziegelmayer
e2fcc47da6
swarm/src/behaviour: Remove Send bound from NetworkBehaviour (#2535)
The bound is no longer needed across the libp2p-XXX crates.

Co-authored-by: Max Inden <mail@max-inden.de>
2022-02-28 10:27:58 +01:00
Max Inden
99855b1d10
*: Apply clippy suggestions (#2540) 2022-02-28 10:05:17 +01:00
Max Inden
b1859464c9
*: Prepare v0.43.0 (#2531) 2022-02-22 14:05:19 +01:00
Max Inden
fd2be38faf
swarm/: Rename ProtocolsHandler to ConnectionHandler (#2527)
A `ProtocolsHandler`, now `ConnectionHandler`, handels a connection, not
a protocol. Thus the name `CONNECTIONHandler` is more appropriate.

Next to the rename of `ProtocolsHandler` this commit renames the `mod
protocols_handler` to `mod handler`. Finally all combinators (e.g.
`ProtocolsHandlerSelect`) are renamed appropriately.
2022-02-21 13:32:24 +01:00
Marco Munizaga
6511e6ba45
core/src/signed_envelope/: Return signing key with payload (#2522)
Remove `SignedEnvelope::payload` in favor of
`SignedEnvelope::payload_and_signing_key`. The caller is expected to check that
the returned signing key makes sense in the payload's context.
2022-02-21 10:45:57 +01:00
Max Inden
2ff9acee22
swarm/: Make NodeHandlerWrapper an impl detail of connection (#2523)
Previously one would wrap a `ProtocolsHandler` into a
`NodeHandlerWrapper` as early as possible, even though the functionality
of `NodeHandlerWrapper` is only needed within `mod connection`.

This commit makes `NodeHandlerWrapper` an implementation detail of `mod
connection`, thus neither `mod protocols_handler`, `mod pool` nor the
root level (`libp2p-swarm`) need to bother about the abstraction.

In addition to the above, this commit:

- Renames `NodeHandlerWrapper` to `HandlerWrapper`. The word `Node` is
  outdated.
- Removes `NodeHandlerWrapperBuilder`. With this simplification it is no
  longer needed.
- Folds `NodeHandlerWrapperError` into `ConnectionError`. No need for
  upper layers to be aware of the fact that `ProtocolHandler`s are
  wrapped.
2022-02-18 11:32:58 +01:00
Max Inden
eeb3504d5f
swarm/src/lib: Rework connection exports (#2525) 2022-02-17 21:12:37 +01:00