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.
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.
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.
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.
`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.
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.
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.
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.
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.
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.
We've moved away from having individual examples in crates in #3111. This one in `transports/webrtc` seems to have slipped through.
Pull-Request: #4531.
Introduces blanket implementation of `{In,Out}boundConnectionUpgrade` and uses it in transport upgrade infrastructure.
Resolves: #4307.
Pull-Request: #4316.
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.