484 Commits

Author SHA1 Message Date
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
Thomas Eizinger
b6a1398060
fix: remove redundant intra-doc link
The recent Rust release introduced a new rustdoc lint which is currently failing CI.

Pull-Request: #4602.
2023-10-09 00:58:32 +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
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
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
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
c97f86f61e
docs: remove old multiaddr README
Pull-Request: #4532.
2023-09-21 00:58:31 +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
Doug A
f5e644da8f
feat(webrtc): add WebRTC for WASM environments
This PR implements `Transport` for WebRTC for browsers by using web-sys. Only the `webrtc-direct` spec is implemented. The `webrtc` spec for connecting two browsers with each other is left to a future PR.

Related: https://github.com/libp2p/specs/issues/475.
Related #2617.
Supersedes: #4229.

Pull-Request: #4248.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2023-09-17 19:13:11 +00:00
chirag-bgh
4ea42c99eb
refactor(server): remove spawning of 2nd tokio runtime
Closes #4448.

Pull-Request: #4454.
2023-09-13 02:45:50 +00:00
sufferpurrityxd
b0c3da7f87
feat(swarm): log local peer id on swarm creation
Closes https://github.com/libp2p/rust-libp2p/issues/4394.

Pull-Request: #4439.
2023-09-12 10:09:27 +00:00
Max Inden
0e64d71196
fix(server): filter out /quic in favor of /quic-v1
Configuration files generated by Kubo <= v0.22 list both `/quic` and `/quic-v1` listen addresses with the same UDP port. Given that we enable draft-29, the two addresses are treated the same by rust-libp2p's QUIC implementation. Though calling `listen_on` with both results in an "Address already in use" error by the OS on the second call. To prevent this from happening filter out `/quic` addresses in favor of `/quic-v1`.

Pull-Request: #4467.
2023-09-12 03:03:38 +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
Mario Camou
ce8f38cc16
feat(misc/server): add libp2p-lookup to rust-libp2p-server
As mentioned in #4444, we need to include https://github.com/mxinden/libp2p-lookup/ in the image so that we can enable a healthcheck when it starts up.

Pull-Request: #4466.
2023-09-11 16:51:54 +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]
c1bccd5c1c
deps: bump base64 from 0.21.2 to 0.21.3
Pull-Request: #4401.
2023-09-04 09:43:13 +00:00
Max Inden
96213b37c6
fix(misc/server): adhere to --metrics-path and listen on 0.0.0.0:8888
This commit reverts the previous metrics behavior. Namely:

- adhering to --metrics-path flag
- listening on 0.0.0.0:8888 instead of 127.0.0.1:8080

Note that 8888 is the default IPFS debug (aka. metrics) port.

See https://github.com/mxinden/rust-libp2p-server/blob/master/src/metric_server.rs for previous behavior.

Pull-Request: #4392.
2023-08-30 14:39:07 +00:00
dependabot[bot]
e36e8ce445
deps: bump serde from 1.0.185 to 1.0.188
Pull-Request: #4398.
2023-08-28 08:41:54 +00:00
Max Inden
9946890b53
fix(misc/server): import libp2p as workspace dependency
One needs to specify a version of `libp2p` dependeny in `misc/server/Cargo.toml` or import as a workspace dependency, in order to publish to crates.io.

This commit does the latter for the sake of consistency with the other libp2p-* dependencies.

Pull-Request: #4391.
2023-08-25 08:44:15 +00:00
Max Inden
f265f39e70
fix(misc/server): add repository URL to Cargo.toml
Pull-Request: #4390.
2023-08-24 16:10:34 +00:00
Max Inden
e8759c85c2
chore: prepare libp2p v0.52.3
- Addresses TLS CVE:
- https://github.com/libp2p/rust-libp2p/pull/4381
- https://github.com/libp2p/rust-libp2p/pull/4378
- Stable QUIC https://github.com/libp2p/rust-libp2p/pull/4325
- New rust-libp2p-server release https://github.com/libp2p/rust-libp2p/pull/4311

Pull-Request: #4387.
2023-08-24 12:47:59 +00:00
Max Inden
e974efb755
feat: add rust-libp2p-server to monorepo
Moves https://github.com/mxinden/rust-libp2p-server to the rust-libp2p monorepository.

> # Rust libp2p Server
>
> A rust-libp2p based server implementation running:
>
> - the [Kademlia protocol](https://github.com/libp2p/specs/tree/master/kad-dht)
>
> - the [Circuit Relay v2 protocol](https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md)
>
> - the [AutoNAT protocol](https://github.com/libp2p/specs/blob/master/autonat/README.md)

Pull-Request: #4311.
2023-08-21 18:49:42 +00:00
dependabot[bot]
1d6d016641
deps: bump serde from 1.0.183 to 1.0.185
Pull-Request: #4363.
2023-08-21 14:03:51 +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]
608e2dbb19
deps: bump serde_json from 1.0.104 to 1.0.105
Pull-Request: #4347.
2023-08-19 22:41:44 +00:00
dependabot[bot]
d3da24f312
deps: bump pin-project from 1.1.2 to 1.1.3
Pull-Request: #4296.
2023-08-18 21:29:40 +00:00
Max Inden
16b2f1563d
chore: use workspace rust-version
Pull-Request: #4344.
2023-08-18 09:02:22 +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
Max Inden
5a8eb793fe
chore: prepare libp2p v0.52.2
Pull-Request: #4312.
2023-08-11 10:10:42 +00:00
hanabi1224
b5d993267f
feat: memory based connection limits
Implements memory-based connection limits where the user can specify an absolute or a relative limit of the process' memory usage in relation to the available system memory.

Related: #4252.

Pull-Request: #4281.
2023-08-08 16:29:21 +00:00
dependabot[bot]
72fd50ae6c
deps: bump serde from 1.0.179 to 1.0.183
Pull-Request: #4294.
2023-08-07 09:14:58 +00:00
dependabot[bot]
55f05aa6c8
deps: bump serde from 1.0.178 to 1.0.179
Pull-Request: #4271.
2023-07-31 09:00:23 +00:00
Age Manning
53df98298a
fix(connection-limits): correct connection tracking
The connection limit behaviour was not taking into account connection errors. Also, it was using the behaviour events to indicate established connections which is not always going to be the case because other behaviours can deny the connections (thanks @divagant-martian).

Closes #4249

Pull-Request: #4250.
2023-07-26 13:36:14 +00:00
dependabot[bot]
b52c3ac317
deps: bump serde from 1.0.171 to 1.0.175
Pull-Request: #4246.
2023-07-24 16:19:48 +00:00
Onur
660fadba35
chore(gossipsub): include in libp2p meta crate when compiling for wasm
Since https://github.com/libp2p/rust-libp2p/pull/3973, gossipsub now fully supports wasm targets. It functions properly when added as a dependency on its own. However, when trying to use it under libp2p by activating a feature, it's not possible and the compiler will raise an error like `unresolved import libp2p::gossipsub`. This pull request enables the use of gossipsub for wasm targets when it's activated as a feature of the libp2p dependency.

Pull-Request: #4217.
2023-07-20 07:48:21 +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]
42be5b5d16
deps: bump serde from 1.0.168 to 1.0.171
Pull-Request: #4199.
2023-07-19 11:18:10 +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
Benno
30024f38d4
fix: clippy useless_conversion and useless_vec
Pull-Request: #4190.
2023-07-16 03:31:37 +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]
62ab42aecb
deps: bump clap from 4.3.8 to 4.3.10
Pull-Request: #4144.
2023-07-03 16:46:28 +00:00
dependabot[bot]
ed4b4644d1
deps: bump pin-project from 1.1.0 to 1.1.2
Pull-Request: #4146.
2023-07-03 15:34:26 +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