1012 Commits

Author SHA1 Message Date
dependabot[bot]
5efcb8ff6d
deps: bump regex from 1.9.6 to 1.10.0
Pull-Request: #4617.
2023-10-10 01:13:45 +00:00
dependabot[bot]
1bfaf1c67d
deps: bump lru from 0.11.1 to 0.12.0
Pull-Request: #4610.
2023-10-09 12:04:49 +00:00
Hannes
3458950bea
chore(upnp, webrtc): add missing docs.rs metadata
Includes necessary package metadata to improve documentation on docs.rs (shows which items are behind a cfg).
Read more on: #2983

Pull-Request: #4599.
2023-10-09 02:46:32 +00:00
Binston Sukhael Cardoza
0e9d339bd2
ci: use workspace inheritance to enforce lints in all crates
Starting with nightly-2023-09-10, the `[lints]` section in `Cargo.toml` files is stable. Together with workspace inheritance, this can be used to declare all lints we want to enforce in a single place.

Resolves: #4484.

Pull-Request: #4575.
2023-10-09 02:20:46 +00:00
Max Inden
d862b40383
refactor(examples): remove #[behaviour(to_swarm = "Event")]
Removes the usage of the `to_swarm` `libp2p-swarm-derive` attribute in favor of the automatically generated event through the `NetworkBehaviour` derive macro.

Pull-Request: #4580.
2023-10-03 22:21:17 +00:00
dependabot[bot]
980bda088d
deps: bump regex from 1.9.5 to 1.9.6
Pull-Request: #4577.
2023-10-03 02:03:02 +00:00
dependabot[bot]
3ff354f1ef
deps: bump thiserror from 1.0.48 to 1.0.49
Pull-Request: #4578.
2023-10-03 01:50:38 +00:00
dependabot[bot]
90a9752dc7
deps: bump sha2 from 0.10.7 to 0.10.8
Pull-Request: #4579.
2023-10-02 09:03:11 +00:00
Denis Garus
ecdd0ff767
refactor(identify): use ReadyUpgrade for {In,Out}boundUpgrade
Related: #2863.

Pull-Request: #4563.
2023-09-28 23:23:54 +00:00
Hannes
665181efb5
chore: address latest clippy lints
I ran clippy on the current nightly and fixed issues found by it. Noteworthy are two instances of the [never_loop](https://rust-lang.github.io/rust-clippy/master/index.html#/never_loop) lint.

Pull-Request: #4571.
2023-09-28 10:08:51 +00:00
Arpan Kapoor
d30eb9daa7
fix(upnp): do not return failure events repeatedly
When a gateway is not found or is not routable, UPnP `NetworkBehaviour`'s `poll` repeatedly returns the same failure state, which increases CPU usage.

Pull-Request: #4569.
2023-09-28 07:52:24 +00:00
Panagiotis Ganelis
c8b5f49ec2
refactor(kad): rename to follow naming convention across repository
Renamed the following

`kad::Kademlia` -> `kad::Behaviour`
`kad::KademliaEvent` -> `kad::Event`
`kad::KademliaBucketInserts` -> `kad::BucketInserts`
`kad::KademliaStoreInserts` -> `kad::StoreInserts`
`kad::KademliaConfig` -> `kad::Config`
`kad::KademliaCaching` -> `kad::Caching`
`kad::KademliaEvent` -> `kad::Event`
`kad::KademliaConnectionType` -> `kad::ConnectionType`
`KademliaHandler` -> `Handler`
`KademliaHandlerEvent` -> `HandlerEvent`
`KademliaProtocolConfig` -> `ProtocolConfig`
`KademliaHandlerIn` -> `HandlerIn`
`KademliaRequestId` -> `RequestId`
`KademliaHandlerQueryErr` -> `HandlerQueryErr`

Resolves: #4485

Pull-Request: #4547.
2023-09-27 20:25:22 +00:00
Thomas Eizinger
fffd47b69f
refactor(plaintext): rename symbols to follow naming convention
Related: #2217.

Pull-Request: #4535.
2023-09-27 19:42:45 +00:00
joshuef
f6b5a1376a
chore(kad): update kad caching docs for clarity about write mechanism
Pull-Request: #4564.
2023-09-27 19:30:33 +00:00
Arpan Kapoor
38ea7ad453
fix(upnp): use correct mapping protocol for UDP
Return `PortMappingProtocol::UDP` when the multiaddress protocol is UDP.

Pull-Request: #4542.
2023-09-25 10:50:12 +00:00
dependabot[bot]
94432d83ad
deps: bump smallvec from 1.11.0 to 1.11.1
Pull-Request: #4551.
2023-09-25 08:33:29 +00:00
Marcel Gleeson
ad45d23d94
fix(identify): handle partial push messages
According to the [spec], all fields within push messages are optional. To handle missing fields, we deserialize push messages into a different struct, patch the previously received, full identify message with it and emit this as the new info.

Previously, we failed to parse the message which causes incompatibility with js-libp2p nodes as they don't send the public key in push messages. See 88c47f51f9/packages/libp2p/src/identify/identify.ts (L205-L210).

[spec]: https://github.com/libp2p/specs/tree/master/identify#identifypush

Pull-Request: #4495.
2023-09-24 11:36:58 +00:00
whtsht
95890b550b
refactor(dns): unify symbol naming
Renamed the following
- `dns::GenDnsConfig`  ->  `dns::Config`
- `dns::DnsConfig` -> `dns::async_std::Config`
- `dns::TokioDnsConfig` -> `dns::tokio::Config`

If async-std feature is enable, use `dns::async_std::Config`. When using tokio, import `dns::tokio::Config` . There is no need to use `dns::Config` directly.

Resolves #4486.
Related: #2217.

Pull-Request: #4505.
2023-09-24 05:31:42 +00:00
Max Inden
600b6af314
chore: prepare non-breaking releases
Crates to be released:

- core
- misc/futures-bounded
- misc/server
- misc/webrtc-utils
- protocols/kad
- protocols/ping
- protocols/upnp
- swarm
- transports/webrtc-websys
- transports/webrtc

Pull-Request: #4537.
2023-09-22 11:02:02 +00:00
Thomas Eizinger
32df6e8747
refactor(relay): delete now unused Action
This is a relict from when we still had to delay the construction of `ToSwarm` commands because some data was only available in `poll` via `PollParameters`. This is now resolved and `PollParameters` will go away.

Pull-Request: #4536.
2023-09-22 04:50:05 +00:00
Denis Garus
efea4902a5
refactor(relay): move stream-handling away from {In,Out}boundUpgrade
Fixes: #4075.

Pull-Request: #4275.
2023-09-20 08:11:36 +00:00
Sumit
c52a2fc3af
feat(swarm): allow configuration to idle connection timeout
Previously, a connection would be shut down immediately as soon as its `ConnectionHandler` reports `KeepAlive::No`. As we have gained experience with libp2p, it turned out that this isn't ideal.

For one, tests often need to keep connections alive longer than the configured protocols require. Plus, some usecases require connections to be kept alive in general.

Both of these needs are currently served by the `keep_alive::Behaviour`. That one does essentially nothing other than statically returning `KeepAlive::Yes` from its `ConnectionHandler`.

It makes much more sense to deprecate `keep_alive::Behaviour` and instead allow users to globally configure an `idle_conncetion_timeout` on the `Swarm`. This timeout comes into effect once a `ConnectionHandler` reports `KeepAlive::No`. To start with, this timeout is 0. Together with https://github.com/libp2p/rust-libp2p/issues/3844, this will allow us to move towards a much more aggressive closing of idle connections, together with a more ergonomic way of opting out of this behaviour.

Fixes #4121.

Pull-Request: #4161.
2023-09-19 22:32:29 +00:00
dependabot[bot]
3ee8ab6581
deps: bump serde_json from 1.0.106 to 1.0.107
Pull-Request: #4515.
2023-09-18 09:41:40 +00:00
dependabot[bot]
8a523f950f
deps: bump socket2 from 0.5.3 to 0.5.4
Pull-Request: #4513.
2023-09-18 09:17:45 +00:00
Ademola
508cad1f0d
feat(kad): migrate to quick-protobuf-codec crate
Resolves #4487.

Pull-Request: #4501.
2023-09-15 21:11:09 +00:00
João Oliveira
411a0495c5
feat(upnp): add implementation based on IGD protocol
Implements UPnP via the IGD protocol. The usage of IGD is an implementation detail and is planned to be extended to support NATpnp.

Resolves: #3903.

Pull-Request: #4156.
2023-09-12 10:29:27 +00:00
dependabot[bot]
f798572e78
deps: bump lru from 0.11.0 to 0.11.1
Pull-Request: #4478.
2023-09-11 23:57:05 +00:00
dependabot[bot]
0df1a96e3c
deps: bump base64 from 0.21.3 to 0.21.4
Pull-Request: #4479.
2023-09-11 23:32:09 +00:00
dependabot[bot]
ae3cef14cb
deps: bump serde_json from 1.0.105 to 1.0.106
Pull-Request: #4481.
2023-09-11 14:13:30 +00:00
dependabot[bot]
b08eb21794
deps: bump unsigned-varint from 0.7.1 to 0.7.2
Pull-Request: #4480.
2023-09-11 11:54:37 +00:00
dependabot[bot]
7a94dd820a
deps: bump bytes from 1.4.0 to 1.5.0
Pull-Request: #4476.
2023-09-11 09:36:26 +00:00
Darius Clark
cd32435d85
fix(ping): honor ping interval in case of errors
This PR adds a delay to ping connection handler after exceeding the failure rate to prevent opening a outbound stream right after an error.

Resolves #4410.

Pull-Request: #4423.
2023-09-09 09:37:25 +00:00
dependabot[bot]
0cc4881740
deps: bump thiserror from 1.0.44 to 1.0.48
Pull-Request: #4430.
2023-09-04 10:23:24 +00:00
dependabot[bot]
c1bccd5c1c
deps: bump base64 from 0.21.2 to 0.21.3
Pull-Request: #4401.
2023-09-04 09:43:13 +00:00
João Oliveira
50b8b637cf
deps: bump trust-dns-proto from 0.22.0 to 0.23.0
On https://github.com/libp2p/rust-libp2p/pull/3102 we left the `tokio-runtime` feature because of https://github.com/bluejekyll/trust-dns/issues/1830, meanwhile https://github.com/bluejekyll/trust-dns/pull/1831 was merged and `0.23.0` was released with it, so we no longer require the `tokio-runtime` feature.

Pull-Request: #4418.
2023-09-04 06:57:49 +00:00
dependabot[bot]
82e654c8a4
deps: bump regex from 1.9.3 to 1.9.5
Pull-Request: #4433.
2023-09-04 04:57:13 +00:00
Thomas Eizinger
06bc6777a1
chore: fix lint warnings introduced by beta clippy
Pull-Request: #4386.
2023-08-24 12:27:42 +00:00
dependabot[bot]
eb83367430
deps: bump clap from 4.3.21 to 4.3.23
Pull-Request: #4359.
2023-08-21 09:37:15 +00:00
dependabot[bot]
76797f8ad0
deps: bump tokio from 1.31.0 to 1.32.0
Pull-Request: #4356.
2023-08-21 09:16:26 +00:00
dependabot[bot]
608e2dbb19
deps: bump serde_json from 1.0.104 to 1.0.105
Pull-Request: #4347.
2023-08-19 22:41:44 +00:00
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