972 Commits

Author SHA1 Message Date
Max Inden
16b2f1563d
chore: use workspace rust-version
Pull-Request: #4344.
2023-08-18 09:02:22 +00:00
dependabot[bot]
2c4c961d69
deps: bump log from 0.4.19 to 0.4.20
Pull-Request: #4322.
2023-08-14 10:16:13 +00:00
dependabot[bot]
8022769daf
deps: bump clap from 4.3.19 to 4.3.21
Pull-Request: #4319.
2023-08-14 09:20:07 +00:00
dependabot[bot]
a4b8ff4673
deps: bump tokio from 1.29.1 to 1.31.0
Pull-Request: #4318.
2023-08-14 09:00:31 +00:00
Max Inden
5a8eb793fe
chore: prepare libp2p v0.52.2
Pull-Request: #4312.
2023-08-11 10:10:42 +00:00
shamil-gadelshin
e65155281e
fix(kad): reduce noise of "remote supports our protocol" log
This PR changes the logging of the Kademlia connection handler related to the remote Kademlia mode changes:
- Downgrade log level for the remote kademlia protocol report from `info` to `debug`.
- Introduce connection_id for the handler to improve logging.

Pull-Request: #4278.
2023-08-07 09:31:15 +00:00
dependabot[bot]
1278161603
deps: bump regex from 1.9.1 to 1.9.3
Pull-Request: #4295.
2023-08-07 08:35:57 +00:00
Akihito Nakano
f95f39f634
feat(gossipsub): add getter function to obtain TopicScoreParams
Added a getter function to obtain `TopicScoreParams`. I need this function for testing which checks if scoring parameters are updated as expected.

Pull-Request: #4231.
2023-08-03 15:19:25 +00:00
Thomas Eizinger
cb8a92026a
deps(yamux): update yamux to v0.12
Pull-Request: #3013.
2023-08-02 15:02:54 +00:00
quininer
37d57f41de
fix(relay): remove unconditional async-std dependency
`libp2p-relay` crate specifies the `libp2p-swarm/async-std` feature, which causes an `async-std` dependency to always be introduced.

Pull-Request: #4283.
2023-08-02 13:46:27 +00:00
Thomas Sénéchal
4d637aedb7
docs: fix last OutboundQueryCompleted in kad doc
`OutboundQueryCompleted` hasn't been fully replaced by `OutboundQueryProgressed` in kad doc.

Pull-Request: #4257.
2023-08-02 10:43:37 +00:00
arsenron
23d7d1a247
feat(kad): implement common traits on RoutingUpdate
A few weeks ago when I was debugging my wrong setup with kademlia, I could not conveniently debug `RoutingUpdate` after adding an address to the DHT. It would be nice to have a few derivable traits on a public enum.

Pull-Request: #4270.
2023-07-31 14:23:45 +00:00
Darius Clark
8ff2cf3a37
fix(relay): export RateLimiter type
The `rate-limiter` module  was not made publicly available. This change exports the `RateLimiter` trait defined within that module which allows users to define their own rate limiters. To make common usecases easy, we also provide a set of constructor functions for common rate limiters.

Resolves #3741.

Pull-Request: #3742.
2023-07-31 13:58:20 +00:00
Benno
cf3cff147c
fix(kad): prevent simultaneous dials to peer
By default, dialing is prevented when already connected. `kad` already checks this manually before doing dials. By changing the condition from `Disconnected` to `NotDialing`, we prevent simultaneous dials to a peer.

Pull-Request: #4224.
2023-07-24 17:06:48 +00:00
dependabot[bot]
12c98dca35
deps: bump either from 1.8.1 to 1.9.0
Pull-Request: #4243.
2023-07-24 16:02:14 +00:00
dependabot[bot]
521eea2d01
deps: bump thiserror from 1.0.43 to 1.0.44
Pull-Request: #4242.
2023-07-24 15:46:36 +00:00
Zeeshan Lakhani
52cf26f530
refactor(request-reponse): replace serde_cbor with cbor4ii
As per `RUSTSEC-2021-0127`, serde_cbor is unmaintained.

Fixes #4182.
Related: https://github.com/rustsec/advisory-db/pull/1114.

Pull-Request: #4187.
2023-07-20 13:18:36 +00:00
Darius Clark
f0b1b122e6
feat(relay): add functions to Limit to access its data
Currently, `Limit` is supplied to many of relay client events, however there is no way to access the fields. This PR adds functions to allow access to the data from those fields.

Pull-Request: #4162.
2023-07-20 08:06:33 +00:00
dependabot[bot]
6ac15bdb98
deps: bump lru from 0.10.1 to 0.11.0
Pull-Request: #4198.
2023-07-19 13:41:32 +00:00
dependabot[bot]
132688961f
deps: bump clap from 4.3.11 to 4.3.12
Pull-Request: #4206.
2023-07-19 13:10:14 +00:00
dependabot[bot]
c70f3245dc
deps: bump prometheus-client from 0.21.1 to 0.21.2
Pull-Request: #4173.
2023-07-19 11:01:53 +00:00
dependabot[bot]
efdba39f83
deps: bump thiserror from 1.0.40 to 1.0.43
Pull-Request: #4174.
2023-07-17 08:45:14 +00:00
Benno
30024f38d4
fix: clippy useless_conversion and useless_vec
Pull-Request: #4190.
2023-07-16 03:31:37 +00:00
Max Inden
df1caa0da9
chore: prepare libp2p-swarm v0.43.1 and libp2p-kad v0.44.2
Pull-Request: #4166.
2023-07-13 01:58:30 +00:00
dependabot[bot]
2f288523b0
deps: bump clap from 4.3.10 to 4.3.11
Pull-Request: #4178.
2023-07-11 11:44:04 +00:00
dependabot[bot]
1246d832a4
deps: bump serde_json from 1.0.99 to 1.0.100
Pull-Request: #4172.
2023-07-11 09:31:49 +00:00
dependabot[bot]
a92a801cce
deps: bump smallvec from 1.10.0 to 1.11.0
Pull-Request: #4171.
2023-07-11 08:58:09 +00:00
dependabot[bot]
a6c427483c
deps: bump regex from 1.8.4 to 1.9.1
Pull-Request: #4170.
2023-07-11 08:19:26 +00:00
dependabot[bot]
185cb4a2e3
deps: bump tokio from 1.28.2 to 1.29.1
Pull-Request: #4148.
2023-07-10 09:31:15 +00:00
Darius Clark
cbb9c7c0f3
feat(kad): allow to explicitly set Mode::{Client,Server}
The current implementation in Kademlia relies on an external address to determine if it should be in client or server mode. However there are instances where a node, which may know an external address, wishes to remain in client mode and switch to server mode at a later point.

This PR introduces `Kademlia::set_mode`, which accepts an `Option<Mode>` that would allow one to set `Mode::Client` for client mode, `Mode::Server` for server mode, or `None` to determine if we should operate as a client or server based on our external addresses.

Resolves #4074.

Pull-Request: #4132.
2023-07-04 06:07:56 +00:00
dependabot[bot]
00ffa04afc
deps: bump lru from 0.10.0 to 0.10.1
Pull-Request: #4141.
2023-07-03 17:59:11 +00:00
dependabot[bot]
62ab42aecb
deps: bump clap from 4.3.8 to 4.3.10
Pull-Request: #4144.
2023-07-03 16:46:28 +00:00
Thomas Eizinger
f335697573
fix(kad): allow for different order of events in assertion
Fixes the test failure witnessed in https://github.com/libp2p/rust-libp2p/actions/runs/5392115337/jobs/9790198947?pr=4128#step:6:162.

Pull-Request: #4129.
2023-06-28 12:26:44 +00:00
joshuef
93aa21aba9
fix(kad): re-expose Distance as KBucketDistance
Adds back in Distance as a public type. Follows `KBucketKey` naming for clarity.

Resolves #4108.

Pull-Request: #4109.


  
Co-Authored-By: Josh Wilson <joshuef@gmail.com>
  

  
Co-Authored-By: Max Inden <mail@max-inden.de>
2023-06-27 01:58:22 +00:00
Thomas Eizinger
d5475fccde
fix(test): only listen on 127.0.0.1 for ephemeral swarm
This resolves an issue where our tests were depending on the number of network interfaces available on the local machine.

Related #4110.

Pull-Request: #4122.


  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
2023-06-27 01:21:47 +00:00
dependabot[bot]
6241b92fe4
deps: bump clap from 4.3.3 to 4.3.8
Pull-Request: #4118.
2023-06-26 10:43:20 +00:00
dependabot[bot]
26801481fa
deps: bump serde_json from 1.0.97 to 1.0.99
Pull-Request: #4119.
2023-06-26 10:19:34 +00:00
Max Inden
73dbde1519
refactor(perf): expose single latency measurement
Instead of exposing the time to establish a connection, the time to upload the bytes and the time to download the bytes, expose a single time including all three.

The rational here is, that differentiation of the three is flawed. E.g. when does one stop the upload timer and start the download timer? When the last byte is sent? When the last byte is flushed? When the first byte is received?

See https://github.com/libp2p/test-plans/pull/184#pullrequestreview-1482600521 for past discussion.

Pull-Request: #4105.


  
Co-Authored-By: Max Inden <mail@max-inden.de>
2023-06-26 03:56:17 +00:00
dependabot[bot]
e28f0326c7
deps: bump clap from 4.3.2 to 4.3.3
Pull-Request: #4061.
2023-06-20 15:23:15 +00:00
dependabot[bot]
0d5c1eae16
deps: bump serde_json from 1.0.96 to 1.0.97
Pull-Request: #4085.
2023-06-20 14:16:12 +00:00
dependabot[bot]
face06b05c
deps: bump arrayvec from 0.7.2 to 0.7.4
Pull-Request: #4087.
2023-06-20 13:32:36 +00:00
dependabot[bot]
04b7668c55
deps: bump sha2 from 0.10.6 to 0.10.7
Pull-Request: #4088.
2023-06-20 13:10:43 +00:00
Thomas Eizinger
78c150d0df
chore: don't use workspace inheritance for dev-dependencies
Using workspace inheritance breaks `cargo release` because it cannot resolve that the dev-dependencies should only use a `path` and not a version.

Pull-Request: #4097.


  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
2023-06-20 12:24:28 +00:00
Max Inden
8776fa8766
chore: prepare libp2p v0.52.0 release
Pull-Request: #4053.


  
Co-Authored-By: Max Inden <mail@max-inden.de>
  

  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
2023-06-19 11:49:39 +00:00
Denis Garus
c4ab04c57c
feat(rendezvous): directly return error from register
Resolves #4070.

Pull-Request: #4073.
2023-06-17 11:19:41 +00:00
Denis Garus
b8ceeccdc6
refactor(rendezvous): rewrite using libp2p-request-response
Fixes [#3878](https://github.com/libp2p/rust-libp2p/issues/3878).

Pull-Request: #4051.


  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
2023-06-14 17:49:23 +00:00
dependabot[bot]
d263ee67a9
deps: bump log from 0.4.18 to 0.4.19
Pull-Request: #4058.
2023-06-13 10:29:36 +00:00
Max Inden
2910c985e8
fix(examples): call Swarm::add_external_address in dcutr and relay
> Observed addresses (aka. external address candidates) of the local node, reported by a remote node
> via `libp2p-identify`, are no longer automatically considered confirmed external addresses, in
> other words they are no longer trusted by default. Instead users need to confirm the reported
> observed address either manually, or by using `libp2p-autonat`. In trusted environments users can
> simply extract observed addresses from a `libp2p-identify::Event::Received { info:
> libp2p_identify::Info { observed_addr }}` and confirm them via `Swarm::add_external_address`.

Follow-up to https://github.com/libp2p/rust-libp2p/pull/3954.

Pull-Request: #4052.
2023-06-09 03:26:24 +00:00
Max Inden
e0f9de3683
chore(kad): extend changelog entry on client/server mode
Pull-Request: #4050.
2023-06-08 05:51:12 +00:00
Thomas Eizinger
ed14630672
feat: leverage type-safe /p2p in multiaddr
This updates `multiaddr` to version `0.19`.

Depends-On: #3656.
Depends-On: https://github.com/multiformats/rust-multiaddr/pull/83.
Resolves: #4039.

Pull-Request: #4037.
2023-06-08 01:38:18 +00:00