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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.