2425 Commits

Author SHA1 Message Date
Koonts
63727bda64
fix(examples): use absolute paths to link to examples
The examples have recently been moved to a new directory. Use absolute paths to link to them and fix two bad links from renamed crates.

Pull-Request: #3571.
2023-03-08 17:43:10 +00:00
dependabot[bot]
ff66f8edff
deps: bump serde_json from 1.0.93 to 1.0.94
Pull-Request: #3553.
2023-03-08 13:42:29 +00:00
Thomas Eizinger
d53cfed236
chore: move libp2p crate to a dedicated directory
Currently, our top-level `Cargo.toml` manifest represents a crate AND a workspace. This causes surprising behaviour (e.g. #2949) where we need to explicitly pass `--workpace` to every command to run it on the entire workspace and not just the meta crate.

My moving the meta crate into its own directory, the root manifest file is a virtual manifest only and thus, every `cargo` command will automatically default to running on the entire workspace.

On top of this, I personally find it easier to understand if workspace and crate manifests are not mixed.

Pull-Request: #3536.
2023-03-08 13:20:39 +00:00
dependabot[bot]
645b229d43
deps: bump thiserror from 1.0.38 to 1.0.39
Pull-Request: #3554.
2023-03-08 12:59:53 +00:00
dependabot[bot]
9c177d1673
deps: bump async-trait from 0.1.64 to 0.1.66
Pull-Request: #3555.
2023-03-08 12:39:06 +00:00
Thomas Eizinger
7069d78ee3
test: introduce libp2p-swarm-test
This patch-set introduces `libp2p-swarm-test`. It provides utilities for quick and safe bootstrapping of tests for `NetworkBehaviour`s. The main design features are:

- Everything has timeouts
- APIs don't get in your way
- Minimal boilerplate

Closes #2884.

Pull-Request: #2888.
2023-03-08 09:36:35 +00:00
Thomas Eizinger
8a27375f96
fix(clippy): bump clap to latest version
The recent beta release of clippy flags some code usage in clap. Bump clap's version to avoid the CI failure.

See https://github.com/clap-rs/clap/issues/4733.

Pull-Request: #3569.
2023-03-08 08:39:36 +00:00
Oleg Kubrakov
b63e05dad6
refactor: move examples to common location
Refactor examples into separate binary crates.

Fixes https://github.com/libp2p/rust-libp2p/issues/3111.

Pull-Request: #3509.
2023-03-08 08:17:33 +00:00
Max Inden
2c10cd838a
refactor(uds): Move WASM feature flagging to root Cargo.toml
Crates that don't compile for WASM are feature flagged in the root `Cargo.toml`, expcept for `libp2p-uds`. This commit removes the inconsistency.

As a side-effect, this might help prevent bugs like https://github.com/libp2p/rust-libp2p/pull/3502 going forward.

Pull-Request: #3503.
2023-03-07 14:02:13 +00:00
Thomas Eizinger
6b73dac59b
feat(noise): remove tests for deprecated protocol
With `0.51`, we finally officially deprecated the non-spec compliant version of noise. This one needs a very heavy dependency for testing: `libsodium-sys-stable`.

I propose to remove the tests now. The actual implementation is not yet removed because it would be a breaking change. Once we decide to make the next breaking change, we can also include the removal of the deprecated API.

Pull-Request: #3510.
2023-03-07 13:30:47 +00:00
dependabot[bot]
d529945286
deps: bump Swatinem/rust-cache from 2.2.0 to 2.2.1
Pull-Request: #3516.
2023-03-06 21:15:57 +00:00
Max Inden
1a2608d084
fix(dcutr): don't set dial concurrency factor in example
Since https://github.com/libp2p/rust-libp2p/pull/2741 the default dial concurrency factor is > 1, more specifically 8. Thus there is no need to explicitly set it anylonger.

Pull-Request: #3550.
2023-03-06 11:48:03 +00:00
ozwaldorf
050504fbe5
fix(libp2p-quic): pin and update tls prerelease dep
Pin libp2p-quic's tls prerelease dependency and update it

Pull-Request: #3548.
2023-03-03 20:16:00 +00:00
ozwaldorf
12b785e94e
fix(quic,tls,webrtc): pin pre-release version
If pre-releases aren't pinned, new ones can introduce breaking changes and be automatically fetched by cargo.

Pull-Request: #3538.
2023-03-03 04:01:16 +00:00
Thomas Eizinger
972ed39283
feat(ci): remove semantic PR title check in favor of dedicated workflow
With https://github.com/libp2p/github-mgmt/pull/125, we will have a dedicated workflow that validates the PR title. Remove our custom step in favor of that.

Pull-Request: #3496.
2023-03-03 02:58:20 +00:00
Miguel Guarniz
db82e0210e
feat: migrate to quick-protobuf
Instead of relying on `protoc` and buildscripts, we generate the bindings using `pb-rs` and version them within our codebase. This makes for a better IDE integration, a faster build and an easier use of `rust-libp2p` because we don't force the `protoc` dependency onto them.

Resolves #3024.

Pull-Request: #3312.
2023-03-02 10:45:07 +00:00
libp2p-mgmt-read-write[bot]
4910160bea
chore: Update .github/workflows/semantic-pull-request.yml [skip ci] 2023-03-02 09:50:32 +00:00
Bogdan
1a1635347d
feat(ci): remove actions-rs/cargo and use r7kamura/rust-problem-matchers
Resolves https://github.com/libp2p/rust-libp2p/issues/3398.

Pull-Request: #3528.
2023-03-02 04:41:55 +00:00
dependabot[bot]
bc88900641
deps: update p256 requirement from 0.11.1 to 0.12.0
Pull-Request: #3336.
2023-03-01 04:34:49 +00:00
Thomas Eizinger
10f948d8c0
feat(ci): consider dtolnay/rust-toolchain a trusted action
dtolnay is a very reputable member of the Rust community. I'd like to propose to make an exception to the "pin all external actions to a hash" rule. The action is updated very regularly and causes spam in the form of dependabot PRs.

Additionally, by pinning the action we cannot make use of the very neat shorthand syntax of specifying the desired Rust version.

Pull-Request: #3487.
2023-03-01 02:55:58 +00:00
Thomas Eizinger
73013de3f1
refactor: remove unused dependencies
Pull-Request: #3530.
2023-02-28 23:39:01 +00:00
Thomas Eizinger
7f5b40af17
feat(ci): cache registry baseline rustdoc JSON
The latest release (v0.18) of `cargo semver-checks` includes a [feature](https://github.com/obi1kenobi/cargo-semver-checks/pull/339) where the rustdoc JSON files for registry baselines is cached in `target/semver-checks/cache`. The rustdoc JSON files for released crates never changes as the source code on crates.io cannot be changed once a version is published. Thus, it is unnecessary to generate that JSON on every CI run.

We extract a separate action that installs `cargo semver-checks` for us and also sets up a cache. The cache is scoped to released version of the crate, meaning it automatically invalidates once we publish a new version.

This speeds up the `cargo semver-checks` step by 50% which is ~ 1 minute per job.

Pull-Request: #3469.
2023-02-28 08:06:47 +00:00
dependabot[bot]
c1bb234563
deps: bump prost-build from 0.11.6 to 0.11.8
Pull-Request: #3525.
2023-02-28 07:32:16 +00:00
dependabot[bot]
b1beab71aa
deps: bump syn from 1.0.107 to 1.0.109
Pull-Request: #3524.
2023-02-28 06:53:24 +00:00
Thomas Eizinger
2ca93e12c5
refactor(interop-test): remove easy to replace strum dependency
We only use `strum` for the interop-tests but we add 3 dependencies to a full build of the repository for it, including a proc-macro which needs to be pipelined in front of other crates which makes them hard to parallelize. Remove it in favor of fairly trivial reimplementation of `FromStr`.

Pull-Request: #3513.
2023-02-28 05:04:59 +00:00
hanabi1224
52a32ffac1
fix(pnet): flush nonce in handshake
Previously, we did not flush the nonce within the handshake to the stream. This caused problems when `pnet` was composed with the websocket transport. Inserting a flush fixes these compatibility problems.

Resolves https://github.com/libp2p/rust-libp2p/issues/3475.

Pull-Request: #3476.
2023-02-28 04:34:54 +00:00
dependabot[bot]
b8d95ff974
deps: bump tempfile from 3.3.0 to 3.4.0
Pull-Request: #3520.
2023-02-28 03:25:42 +00:00
dependabot[bot]
3a049f0815
deps: bump prost from 0.11.6 to 0.11.8
Pull-Request: #3517.
2023-02-28 02:10:45 +00:00
dependabot[bot]
ac97e28d45
deps: bump env_logger from 0.9.3 to 0.10.0
Pull-Request: #3518.
2023-02-28 01:35:40 +00:00
Thomas Eizinger
d6ebac4e78
refactor(interop-tests): disable unused features
This removes a few dependencies from our dependency tree without any impact on functionality.

Pull-Request: #3512.
2023-02-28 00:37:04 +00:00
Max Inden
ad2954c631
docs(coding-guidelines): Add request response correlation
Allow correlating asynchronous responses to their requests.

Pull-Request: #3290.
2023-02-27 22:57:03 +00:00
Max Inden
1a9cf4f776
fix(uds): Bump version
https://github.com/libp2p/rust-libp2p/pull/3196/ forgot to bump `libp2p-uds`. `libp2p-uds` was updated to `libp2p-core` `v0.39.0` thus requiring the version bump.

This has happened before, see https://github.com/libp2p/rust-libp2p/pull/2720.

Pull-Request: #3502.
2023-02-24 13:21:06 +00:00
Max Inden
71015ee16f
docs: prepare v0.51.0
A large release with lots of changes I am looking forward to. Sorry for the long release cadence.

Anything folks would like to see included that is not yet in `master`? As usual I would like to only block on bug fixes.

Pull-Request: #3491.
2023-02-24 10:42:29 +00:00
Thomas Eizinger
622d0b00de
feat(ci): don't dismiss reviews on dependabot PRs
Pull-Request: #3486.
2023-02-24 21:00:24 +11:00
Thomas Eizinger
d80d92dc45
feat(ci): lint against usages of variables with underscore
Prefixing a variable with an underscore (`_`) in Rust indicates that it is not used. Through refactorings, it can sometimes happen that we do end up using such a variable. In this case, the underscore should be removed.

Clippy can help us with this.

Pull-Request: #3484.
2023-02-24 08:34:59 +00:00
dependabot[bot]
6383e1e8bd
deps: update base64 requirement from 0.20.0 to 0.21.0
Pull-Request: #3315.
2023-02-24 00:36:59 +00:00
Thomas Eizinger
19a554965f
feat(swarm)!: allow NetworkBehaviours to manage connections
Previously, a `ConnectionHandler` was immediately requested from the `NetworkBehaviour` as soon as a new dial was initiated or a new incoming connection accepted.

With this patch, we delay the creation of the handler until the connection is actually established and fully upgraded, i.e authenticated and multiplexed.

As a consequence, `NetworkBehaviour::new_handler` is now deprecated in favor of a new set of callbacks:

- `NetworkBehaviour::handle_pending_inbound_connection`
- `NetworkBehaviour::handle_pending_outbound_connection`
- `NetworkBehaviour::handle_established_inbound_connection`
- `NetworkBehaviour::handle_established_outbound_connection`

All callbacks are fallible, allowing the `NetworkBehaviour` to abort the connection either immediately or after it is fully established. All callbacks also receive a `ConnectionId` parameter which uniquely identifies the connection. For example, in case a `NetworkBehaviour` issues a dial via `NetworkBehaviourAction::Dial`, it can unambiguously detect this dial in these lifecycle callbacks via the `ConnectionId`.

Finally, `NetworkBehaviour::handle_pending_outbound_connection` also replaces `NetworkBehaviour::addresses_of_peer` by allowing the behaviour to return more addresses to be used for the dial.

Resolves #2824.

Pull-Request: #3254.
2023-02-23 23:43:33 +00:00
Thomas Eizinger
794b2a23d0
feat(swarm): remove unused types from public API
Pull-Request: #3497.
2023-02-23 22:25:27 +00:00
Max Inden
79fce51f9b
docs(release): Document patch release process
Quick documentation update to describe patch release branching convention.

Pull-Request: #3490.
2023-02-23 01:03:25 +00:00
dependabot[bot]
30ff1317d6
deps: bump clap from 4.1.4 to 4.1.6
Pull-Request: #3480.
2023-02-22 23:15:32 +00:00
Mahmoud
577e8f9547
chore: update notable users in Readme
Add [Ursa](https://github.com/fleek-network/ursa) by fleek to the notable user's section in Readme.

Pull-Request: #3493.
2023-02-22 21:44:00 +00:00
dependabot[bot]
c7f367a675
deps: bump hyper from 0.14.23 to 0.14.24
Pull-Request: #3429.
2023-02-21 03:13:23 +00:00
dependabot[bot]
bfe3117ff2
deps: bump serde_json from 1.0.91 to 1.0.93
Pull-Request: #3440.
2023-02-21 02:19:37 +00:00
dependabot[bot]
78e48c7851
deps: bump heck from 0.4.0 to 0.4.1
Pull-Request: #3426.
2023-02-21 01:42:59 +00:00
StemCll
58af2e0887
refactor(gossipsub): make error module private
Resolves https://github.com/libp2p/rust-libp2p/issues/3392.

Pull-Request: #3457.
2023-02-20 19:35:21 +00:00
Elena Frank
79b7cef070
fix(identify): don't close stream in protocol::recv
Don't close the stream `protocol::recv`.

This is a short-term fix for #3298.

The issue behind this is a general one on the QUIC transport when closing streams, as described in #3343. This PR only circumvents the issue for identify. A proper solution for our QUIC transport still needs more thought.

Pull-Request: #3344.
2023-02-19 21:18:54 +00:00
Max Inden
0f4930f92b
docs(roadmap): Update done projects and reprioritize (#3467) 2023-02-19 18:40:32 +01:00
dependabot[bot]
57b6605e71
deps: bump amannn/action-semantic-pull-request from 5.0.2 to 5.1.0
Pull-Request: #3459.
2023-02-17 09:24:05 +00:00
dependabot[bot]
462ddeacb7
deps: bump wasm-bindgen-futures from 0.4.33 to 0.4.34
Pull-Request: #3427.
2023-02-17 04:53:54 +00:00
Thomas Eizinger
75cb9ec0ee
feat(ci): move PR number to commit message body
Pull-Request: #3470.
2023-02-17 16:48:15 +13:00