2811 Commits

Author SHA1 Message Date
Thomas Eizinger
7120529c6d
fix(kad): rewrite tests to be less flaky
Not sure why but these tests have recently been quite flaky and are blocking several PRs.

Pull-Request: #4634.
2023-10-13 04:18:19 +00:00
João Oliveira
497f393987
fix(quic): don't report error for gracefully closed connections
Closes quinn's `Endpoint` with `Ok(())`  when `Accept` returns `None`.

Resolves: #4588.
Related: https://github.com/quinn-rs/quinn/issues/1676.

Pull-Request: #4621.
2023-10-12 09:05:07 +00:00
Thomas Eizinger
5c498f656c
ci: use new "transport-interop" action
Resolves: #4592.

Pull-Request: #4594.
2023-10-11 20:01:34 +00:00
Max Inden
3a0f0c292a
fix(server): remove support_draft_29
Support for QUIC draft 29 was removed with https://github.com/libp2p/rust-libp2p/pull/4467.

https://github.com/libp2p/rust-libp2p/pull/4120 reintroduced it as a faulty merge.

This commit removes it again.

Pull-Request: #4622.
2023-10-10 13:05:54 +00:00
Max Inden
d605255fec
feat(libp2p): add SwarmBuilder
Introduce the new `libp2p::SwarmBuilder`. Users should use the new `libp2p::SwarmBuilder` instead of the now deprecated `libp2p::swarm::SwarmBuilder`. See `libp2p::SwarmBuilder` docs on how to use the new builder.

Fixes #3657.
Fixes #3563.
Fixes #3179.

Pull-Request: #4120.
2023-10-10 06:55:14 +00:00
dependabot[bot]
3ae72557ab
deps: bump tokio from 1.32.0 to 1.33.0
Pull-Request: #4615.
2023-10-10 05:17:02 +00:00
dependabot[bot]
6cc40fe533
deps: bump byteorder from 1.4.3 to 1.5.0
Pull-Request: #4614.
2023-10-10 05:04:05 +00:00
Thomas Eizinger
d3f34454d4
fix: don't push rust-libp2p-server image for dependabot PRs
Pull-Request: #4619.
2023-10-10 04:47:51 +00:00
Thomas Eizinger
19c5cf22ec
feat(websocket): add WebSocket for WASM environments
Resolves https://github.com/libp2p/rust-libp2p/issues/3611.

Pull-Request: #4102.
2023-10-10 01:41:29 +00:00
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]
e6be50154d
deps: bump proc-macro-warning from 0.4.2 to 1.0.0
Pull-Request: #4608.
2023-10-10 00:56:57 +00:00
dependabot[bot]
14ccaed094
deps: bump libc from 0.2.148 to 0.2.149
Pull-Request: #4609.
2023-10-09 13:43:06 +00:00
dependabot[bot]
2f22dd2be1
deps: bump proc-macro2 from 1.0.67 to 1.0.69
Pull-Request: #4613.
2023-10-09 13:23:47 +00:00
pradt2
8114894f67
docs: add pk records insertion example
In the original issue I mention that a lot of external dependencies would be needed to insert records into the IPFS DHT. While this is still true for IPNS-type records, I found that PK-type records can be created with no need for external code. Thus, I decided to try and enhance the already existing example and add the option to insert a PK record there.

Resolves #2263.

Pull-Request: #4567.
2023-10-09 13:08:22 +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
dependabot[bot]
94894e4c9f
deps: bump num-traits from 0.2.16 to 0.2.17
Pull-Request: #4612.
2023-10-09 11:06:22 +00:00
dependabot[bot]
630b7132dc
deps: bump reqwest from 0.11.21 to 0.11.22
Pull-Request: #4611.
2023-10-09 10:53:25 +00:00
dependabot[bot]
ba4d56f436
deps: bump syn from 2.0.37 to 2.0.38
Pull-Request: #4607.
2023-10-09 09:14:52 +00:00
clebrin
1a460fa66f
feat: change md issue templates into yml forms
Resolves: #4151.

Pull-Request: #4560.
2023-10-09 08:49:18 +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
Thomas Eizinger
35b8308817
fix(interop): only write to cache if we have credentials
For pull-requests coming from forks, we don't have access to the secrets. This is currently failing CI for all PRs from forks as docker cannot write the cache after running the tests.

Pull-Request: #4604.
2023-10-09 01:50:19 +00:00
Thomas Eizinger
77149f08c4
fix(identity): correctly follow extract-expand for HKDF
As @mxinden pointed out in https://github.com/libp2p/rust-libp2p/pull/4554#discussion_r1344747938, we were not correctly following the HKDF steps of extract and expand.

Pull-Request: #4589.
2023-10-09 01:31:10 +00:00
Thomas Eizinger
ef9c544d4d
deps: upgrade cargo semver-checks to v0.24
I've also changed our use of the action to pin by Git hash as per our policy for external actions.

See https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v0.24.0 for details on the release.

Pull-Request: #4603.
2023-10-09 01:14:44 +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
Thomas Eizinger
7d1d67cad3
ci: create dependency cache layer of interop tests
Currently, the Docker images for the HEAD branch of the pull-request get re-built completely every time we push a new commit to a branch. That is because the RUN caches use the local disk of the host system but those are ephemeral in GitHub actions.

To fix this, we rewrite the dockerfiles to use `cargo chef`, a tool developed to create a cached layer of built dependencies that doesn't get invalidated as the application source changes.

Normally, these layers are also cached on the local filesystem. To have them available across pull-requests and branches, we instruct buildkit to use the same S3 cache as we use in the interop tests already for docker layers. As a result, this should greatly speed up our CI.

Resolves: #3925.

Pull-Request: #4593.
2023-10-05 04:14:45 +00:00
Marco Inacio
246acfd425
refactor(examples): change ipfs-kad from async-std to tokio
Related: #4449.

Pull-Request: #4590.
2023-10-05 03:27:02 +00:00
Marco Inacio
0e94bc24c7
refactor(examples): change ipfs-private from async-std to tokio
Related: #4449.

Pull-Request: #4591.
2023-10-04 23:18:25 +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
Arpan Kapoor
399eaa3915
refactor(examples): change ping from async-std to tokio
Related: #4449.

Pull-Request: #4570.
2023-10-03 06:35:13 +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]
5c7a18bc1f
deps: bump reqwest from 0.11.20 to 0.11.21
Pull-Request: #4584.
2023-10-03 00:24:14 +00:00
Thomas Eizinger
60650d8b90
chore(identity): release version 0.2.4
`libp2p-identity` gets a special treatment in our workspace because it is the only crate that is a dependency of crates _outside_ the workspace, in particular `multiaddr`. We however also depend on `multiaddr` again in the workspace. As a result, we need to use `[patch.crates-io]` to replace the `libp2p-identity` version across the entire dependency tree. This however doesn't work well with `cargo semver-checks` as it doesn't copy over `[patch]` sections into its workspace where it does the docs building.

To fix the semver checks error, we need to release a new version of `libp2p-identity`.

Pull-Request: #4583.
2023-10-03 00:04:57 +00:00
Thomas Eizinger
ef1cd354d8
fix(identity): address clippy lint
Pull-Request: #4582.
2023-10-02 22:59:39 +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
João Oliveira
7f92cb0725
feat(quic): support stateless resets
Resolves #3419.

Pull-Request: #4554.
2023-10-02 00:28:32 +00:00
Dominik Vogt
c86d1117be
refactor(examples): change autonat example from async-std to tokio
Changed the `autonat` example to use `tokio` instead of `async-std` as runtime.

Related: #4449.

Pull-Request: #4574.
2023-10-01 21:38:40 +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
Thomas Eizinger
91fb6a16eb
feat(deflate): deprecate in preparation for removal
Resolves: #4522.

Pull-Request: #4540.
2023-09-27 08:32:40 +00:00
Thomas Eizinger
9cd0f3dbed
fix(swarm): prevent overflow in keep-alive computation
When adding a very large `Duration` to an `Instant`, an overflow can occur. To fix this, we check this before instantiating `Delay` and half the given duration until it no longer overflows.

Fixes: #4555.

Pull-Request: #4559.
2023-09-27 07:38:03 +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]
636966697e
deps: bump tokio-util from 0.7.8 to 0.7.9
Pull-Request: #4552.
2023-09-25 08:45:20 +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
dependabot[bot]
8e1944c6e1
deps: bump curve25519-dalek from 4.1.0 to 4.1.1
Pull-Request: #4550.
2023-09-25 08:21:51 +00:00