Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

207 lines
5.3 KiB
Markdown
Raw Normal View History

# 0.24.0 [unreleased]
- Update to `libp2p-core` `v0.39.0`.
- Rename types as per [discussion 2174].
`RequestResponse` has been renamed to `Behaviour`.
The `RequestResponse` prefix has been removed from various types like `RequestResponseEvent`.
Users should prefer importing the request_response protocol as a module (`use libp2p::request_response;`),
and refer to its types via `request_response::`. For example: `request_response::Behaviour` or `request_response::Event`.
See [PR 3159].
- Update to `libp2p-swarm` `v0.42.0`.
[discussion 2174]: https://github.com/libp2p/rust-libp2p/discussions/2174
[PR 3159]: https://github.com/libp2p/rust-libp2p/pull/3159
# 0.23.0
- Update to `libp2p-core` `v0.38.0`.
- Update to `libp2p-swarm` `v0.41.0`.
- Replace `RequestResponse`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3011].
- Replace `RequestResponseHandler`'s `ConnectionHandler` implemention `inject_*` methods
with the new `on_*` methods. See [PR 3085].
.github/workflows: Refactor CI jobs (#3090) We refactor our continuous integration workflow with the following goals in mind: - Run as few jobs as possible - Have the jobs finish as fast as possible - Have the jobs redo as little work as possible There are only so many jobs that GitHub Actions will run in parallel. Thus, it makes sense to not create massive matrices but instead group things together meaningfully. The new `test` job will: - Run once for each crate - Ensure that the crate compiles on its specified MSRV - Ensure that the tests pass - Ensure that there are no semver violations This is an improvement to before because we are running all of these in parallel which speeds up execution and highlights more errors at once. Previously, tests run later in the pipeline would not get run at all until you make sure the "first" one passes. We also previously did not verify the MSRV of each crate, making the setting in the `Cargo.toml` rather pointless. The new `cross` job supersedes the existing `wasm` job. This is an improvement because we now also compile the crate for windows and MacOS. Something that wasn't checked before. We assume that checking MSRV and the tests under Linux is good enough. Hence, this job only checks for compile-errors. The new `feature_matrix` ensures we compile correctly with certain feature combinations. `libp2p` exposes a fair few feature-flags. Some of the combinations are worth checking independently. For the moment, this concerns only the executor related transports together with the executor flags but this list can easily be extended. The new `clippy` job runs for `stable` and `beta` rust. Clippy gets continuously extended with new lints. Up until now, we would only learn about those as soon as a new version of Rust is released and CI would run the new lints. This leads to unrelated failures in CI. Running clippy on with `beta` Rust gives us a heads-up of 6 weeks before these lints land on stable. Fixes #2951.
2022-11-18 22:04:16 +11:00
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
.github/workflows: Refactor CI jobs (#3090) We refactor our continuous integration workflow with the following goals in mind: - Run as few jobs as possible - Have the jobs finish as fast as possible - Have the jobs redo as little work as possible There are only so many jobs that GitHub Actions will run in parallel. Thus, it makes sense to not create massive matrices but instead group things together meaningfully. The new `test` job will: - Run once for each crate - Ensure that the crate compiles on its specified MSRV - Ensure that the tests pass - Ensure that there are no semver violations This is an improvement to before because we are running all of these in parallel which speeds up execution and highlights more errors at once. Previously, tests run later in the pipeline would not get run at all until you make sure the "first" one passes. We also previously did not verify the MSRV of each crate, making the setting in the `Cargo.toml` rather pointless. The new `cross` job supersedes the existing `wasm` job. This is an improvement because we now also compile the crate for windows and MacOS. Something that wasn't checked before. We assume that checking MSRV and the tests under Linux is good enough. Hence, this job only checks for compile-errors. The new `feature_matrix` ensures we compile correctly with certain feature combinations. `libp2p` exposes a fair few feature-flags. Some of the combinations are worth checking independently. For the moment, this concerns only the executor related transports together with the executor flags but this list can easily be extended. The new `clippy` job runs for `stable` and `beta` rust. Clippy gets continuously extended with new lints. Up until now, we would only learn about those as soon as a new version of Rust is released and CI would run the new lints. This leads to unrelated failures in CI. Running clippy on with `beta` Rust gives us a heads-up of 6 weeks before these lints land on stable. Fixes #2951.
2022-11-18 22:04:16 +11:00
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
2022-10-14 15:30:16 +01:00
# 0.22.0
- Bump rand to 0.8 and quickcheck to 1. See [PR 2857].
- Update to `libp2p-core` `v0.37.0`.
- Update to `libp2p-swarm` `v0.40.0`.
[PR 2857]: https://github.com/libp2p/rust-libp2p/pull/2857
2022-09-07 09:44:51 +02:00
# 0.21.0
- Update to `libp2p-swarm` `v0.39.0`.
- Update to `libp2p-core` `v0.36.0`.
2022-08-22 05:14:04 +02:00
# 0.20.0
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
2022-07-05 13:09:58 +02:00
# 0.19.0
- Update to `libp2p-core` `v0.34.0`.
- Update to `libp2p-swarm` `v0.37.0`.
2022-05-31 13:12:53 +02:00
# 0.18.0
- Update to `libp2p-core` `v0.33.0`.
- Update to `libp2p-swarm` `v0.36.0`.
2022-04-04 18:27:41 +02:00
# 0.17.0
- Update to `libp2p-swarm` `v0.35.0`.
2022-02-22 14:05:19 +01:00
# 0.16.0 [2022-02-22]
- Update to `libp2p-core` `v0.32.0`.
- Update to `libp2p-swarm` `v0.34.0`.
- Merge NetworkBehaviour's inject_\* paired methods (see PR 2445).
[PR 2445]: https://github.com/libp2p/rust-libp2p/pull/2445
2022-01-27 11:29:09 +01:00
# 0.15.0 [2022-01-27]
- Update dependencies.
- Remove unused `lru` crate (see [PR 2358]).
- Migrate to Rust edition 2021 (see [PR 2339]).
[PR 2339]: https://github.com/libp2p/rust-libp2p/pull/2339
[PR 2358]: https://github.com/libp2p/rust-libp2p/pull/2358
2021-11-16 16:39:42 +01:00
# 0.14.0 [2021-11-16]
- Use `instant` instead of `wasm-timer` (see [PR 2245]).
- Update dependencies.
[PR 2245]: https://github.com/libp2p/rust-libp2p/pull/2245
# 0.13.0 [2021-11-01]
- Make default features of `libp2p-core` optional.
[PR 2181](https://github.com/libp2p/rust-libp2p/pull/2181)
- Update dependencies.
- Manually implement `Debug` for `RequestResponseHandlerEvent` and
`RequestProtocol`. See [PR 2183].
- Remove `RequestResponse::throttled` and the `throttled` module.
See [PR 2236].
[PR 2183]: https://github.com/libp2p/rust-libp2p/pull/2183
[PR 2236]: https://github.com/libp2p/rust-libp2p/pull/2236
2021-07-12 21:24:58 +02:00
# 0.12.0 [2021-07-12]
- Update dependencies.
2021-04-13 20:15:15 +02:00
# 0.11.0 [2021-04-13]
- Update `libp2p-swarm`.
- Implement `std::error::Error` for `InboundFailure` and `OutboundFailure` [PR
2033](https://github.com/libp2p/rust-libp2p/pull/2033).
2021-03-17 15:28:13 +01:00
# 0.10.0 [2021-03-17]
- Update `libp2p-swarm`.
- Close stream even when no response has been sent.
[PR 1987](https://github.com/libp2p/rust-libp2p/pull/1987).
- Update dependencies.
2021-02-15 20:06:50 +01:00
# 0.9.1 [2021-02-15]
- Make `is_pending_outbound` return true on pending connection.
[PR 1928](https://github.com/libp2p/rust-libp2p/pull/1928).
- Update dependencies.
# 0.9.0 [2021-01-12]
- Update dependencies.
- Re-export `throttled`-specific response channel. [PR
1902](https://github.com/libp2p/rust-libp2p/pull/1902).
# 0.8.0 [2020-12-17]
- Update `libp2p-swarm` and `libp2p-core`.
- Emit `InboundFailure::ConnectionClosed` for inbound requests that failed due
to the underlying connection closing.
[PR 1886](https://github.com/libp2p/rust-libp2p/pull/1886).
- Derive Clone for `InboundFailure` and `Outbound}Failure`.
[PR 1891](https://github.com/libp2p/rust-libp2p/pull/1891)
2020-12-08 12:07:20 +01:00
# 0.7.0 [2020-12-08]
[request-response] Refine success & error reporting for inbound requests. (#1867) * Refine error reporting for inbound request handling. At the moment one can neither get confirmation when a response has been sent on the underlying transport, nor is one aware of response omissions. The latter was originally intended as a feature for support of one-way protocols, which seems like a bad idea in hindsight. The lack of notification for sent responses may prohibit implementation of some request-response protocols that need to ensure a happens-before relation between sending a response and a subsequent request, besides uses for collecting statistics. Even with these changes, there is no active notification for failed inbound requests as a result of connections unexpectedly closing, as is the case for outbound requests. Instead, for pending inbound requests this scenario can be identified if necessary by the absense of both `InboundFailure` and `ResponseSent` events for a particular previously received request. Interest in this situation is not expected to be common and would otherwise require explicitly tracking all inbound requests in the `RequestResponse` behaviour, which would be a pity. `RequestResponse::send_response` now also synchronously returns an error if the inbound upgrade handling the request has been aborted, due to timeout or closing of the connection, giving more options for graceful error handling for inbound requests. As an aside, the `Throttled` wrapper now no longer emits inbound or outbound error events occurring in the context of sending credit requests or responses. This is in addition to not emitting `ResponseSent` events for ACK responses of credit grants. * Update protocols/request-response/src/lib.rs Co-authored-by: Max Inden <mail@max-inden.de> * Address some minor clippy warnings. (#1868) * Track pending credit request IDs. In order to avoid emitting events relating to credit grants or acks on the public API. The public API should only emit events relating to the actual requests and responses sent by client code. * Small cleanup * Cleanup * Update versions and changelogs. * Unreleased Co-authored-by: Max Inden <mail@max-inden.de>
2020-12-07 13:07:47 +01:00
- Refine emitted events for inbound requests, introducing
the `ResponseSent` event and the `ResponseOmission`
inbound failures. This effectively removes previous
support for one-way protocols without responses.
[PR 1867](https://github.com/libp2p/rust-libp2p/pull/1867).
# 0.6.0 [2020-11-25]
- Update `libp2p-swarm` and `libp2p-core`.
# 0.5.0 [2020-11-09]
- Update dependencies.
2020-10-16 20:36:47 +02:00
# 0.4.0 [2020-10-16]
- Update dependencies.
2020-09-09 12:20:25 +02:00
# 0.3.0 [2020-09-09]
2020-09-07 17:25:15 +02:00
- Add support for opt-in request-based flow-control to any
Add back the LRU cache to `Throttled`. (#1731) * Restore `RequestResponse::throttled`. In contrast to the existing "throttled" approach this PR adds back- pressure to the protocol without requiring pre-existing knowledge of all nodes about their limits. It adds small, CBOR-encoded headers to the actual payload data. Extra credit messages communicate back to the sender how many more requests it is allowed to send. * Remove some noise. * Resend credit grant after connection closed. Should an error in some lower layer cause a connection to be closed, our previously sent credit grant may not have reached the remote peer. Therefore, pessimistically, a credit grant is resent whenever a connection is closed. The remote ignores duplicate grants. * Remove inbound/outbound tracking per peer. * Send ACK as response to duplicate credit grants. * Simplify. * Fix grammar. * Incorporate review feedback. - Remove `ResponseSent` which was a leftover from previous attemps and issue a credit grant immediately in `send_response`. - Only resend credit grants after a connection is closed if we are still connected to this peer. * Move codec/header.rs to throttled/codec.rs. * More review suggestions. * Generalise `ProtocolWrapper` and use shorter prefix. * Update protocols/request-response/src/lib.rs Co-authored-by: Roman Borschel <romanb@users.noreply.github.com> * Update protocols/request-response/src/throttled.rs Co-authored-by: Roman Borschel <romanb@users.noreply.github.com> * Update protocols/request-response/src/throttled.rs Co-authored-by: Roman Borschel <romanb@users.noreply.github.com> * Minor comment changes. * Limit max. header size to 8KiB * Always construct initial limit with 1. Since honest senders always assume a send budget of 1 and wait for credit afterwards, setting the default limit to a higher value can only become effective after informing the peer about it which means leaving `max_recv` at 1 and setting `next_max` to the desired value. * Use LRU cache to keep previous peer infos. Peers may send all their requests, reconnect and send again all their requests, starting from a fresh budget. The LRU cache keeps the peer information around and reuses it when the peer reconnects, continuing with the previous remaining limit. Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-09-09 11:04:20 +02:00
request-response protocol via `RequestResponse::throttled()`.
2020-09-07 17:25:15 +02:00
[PR 1726](https://github.com/libp2p/rust-libp2p/pull/1726).
- Update `libp2p-swarm` and `libp2p-core`.
# 0.2.0 [2020-08-18]
[core/swarm] Emit events for active connection close and fix `disconnect()`. (#1619) * Emit events for active connection close and fix `disconnect()`. The `Network` does currently not emit events for actively closed connections, e.g. via `EstablishedConnection::close` or `ConnectedPeer::disconnect()`. As a result, when actively closing connections, there will be `ConnectionEstablished` events emitted without eventually a matching `ConnectionClosed` event. This seems undesirable and has the consequence that the `Swarm::ban_peer_id` feature in `libp2p-swarm` does not result in appropriate calls to `NetworkBehaviour::inject_connection_closed` and `NetworkBehaviour::inject_disconnected`. Furthermore, the `disconnect()` functionality in `libp2p-core` is currently broken as it leaves the `Pool` in an inconsistent state. This commit does the following: 1. When connection background tasks are dropped (i.e. removed from the `Manager`), they always terminate immediately, without attempting an orderly close of the connection. 2. An orderly close is sent to the background task of a connection as a regular command. The background task emits a `Closed` event before terminating. 3. `Pool::disconnect()` removes all connection tasks for the affected peer from the `Manager`, i.e. without an orderly close, thereby also fixing the discovered state inconsistency due to not removing the corresponding entries in the `Pool` itself after removing them from the `Manager`. 4. A new test is added to `libp2p-swarm` that exercises the ban/unban functionality and places assertions on the number and order of calls to the `NetworkBehaviour`. In that context some new testing utilities have been added to `libp2p-swarm`. This addresses https://github.com/libp2p/rust-libp2p/issues/1584. * Update swarm/src/lib.rs Co-authored-by: Toralf Wittner <tw@dtex.org> * Incorporate some review feedback. * Adapt to changes in master. * More verbose panic messages. * Simplify There is no need for a `StartClose` future. * Fix doc links. * Further small cleanup. * Update CHANGELOGs and versions. Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-08-04 11:30:09 +02:00
- Fixed connection keep-alive, permitting connections to close due
to inactivity.
[core/swarm] Emit events for active connection close and fix `disconnect()`. (#1619) * Emit events for active connection close and fix `disconnect()`. The `Network` does currently not emit events for actively closed connections, e.g. via `EstablishedConnection::close` or `ConnectedPeer::disconnect()`. As a result, when actively closing connections, there will be `ConnectionEstablished` events emitted without eventually a matching `ConnectionClosed` event. This seems undesirable and has the consequence that the `Swarm::ban_peer_id` feature in `libp2p-swarm` does not result in appropriate calls to `NetworkBehaviour::inject_connection_closed` and `NetworkBehaviour::inject_disconnected`. Furthermore, the `disconnect()` functionality in `libp2p-core` is currently broken as it leaves the `Pool` in an inconsistent state. This commit does the following: 1. When connection background tasks are dropped (i.e. removed from the `Manager`), they always terminate immediately, without attempting an orderly close of the connection. 2. An orderly close is sent to the background task of a connection as a regular command. The background task emits a `Closed` event before terminating. 3. `Pool::disconnect()` removes all connection tasks for the affected peer from the `Manager`, i.e. without an orderly close, thereby also fixing the discovered state inconsistency due to not removing the corresponding entries in the `Pool` itself after removing them from the `Manager`. 4. A new test is added to `libp2p-swarm` that exercises the ban/unban functionality and places assertions on the number and order of calls to the `NetworkBehaviour`. In that context some new testing utilities have been added to `libp2p-swarm`. This addresses https://github.com/libp2p/rust-libp2p/issues/1584. * Update swarm/src/lib.rs Co-authored-by: Toralf Wittner <tw@dtex.org> * Incorporate some review feedback. * Adapt to changes in master. * More verbose panic messages. * Simplify There is no need for a `StartClose` future. * Fix doc links. * Further small cleanup. * Update CHANGELOGs and versions. Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-08-04 11:30:09 +02:00
- Bump `libp2p-core` and `libp2p-swarm` dependencies.
# 0.1.1
- Always properly `close()` the substream after sending requests and
responses in the `InboundUpgrade` and `OutboundUpgrade`. Otherwise this is
left to `RequestResponseCodec::write_request` and `RequestResponseCodec::write_response`,
which can be a pitfall and lead to subtle problems (see e.g.
https://github.com/libp2p/rust-libp2p/pull/1606).
Add libp2p-request-response protocol. (#1596) * Add the libp2p-request-response protocol. This crate provides a generic implementation for request/response protocols, whereby each request is sent on a new substream. * Fix OneShotHandler usage in floodsub. * Custom ProtocolsHandler and multiple protocols. 1. Implement a custom ProtocolsHandler instead of using the OneShotHandler for better control and error handling. In particular, all request/response sending/receiving is kept in the substreams upgrades and thus the background task of a connection. 2. Support multiple protocols (usually protocol versions) with a single `RequestResponse` instance, with configurable inbound/outbound support. * Small doc clarification. * Remove unnecessary Sync bounds. * Remove redundant Clone constraint. * Update protocols/request-response/Cargo.toml Co-authored-by: Toralf Wittner <tw@dtex.org> * Update dev-dependencies. * Update Cargo.tomls. * Add changelog. * Remove Sync bound from RequestResponseCodec::Protocol. Apparently the compiler just needs some help with the scope of borrows, which is unfortunate. * Try async-trait. * Allow checking whether a ResponseChannel is still open. Also expand the commentary on `send_response` to indicate that responses may be discard if they come in too late. * Add `RequestResponse::is_pending`. As an analogue of `ResponseChannel::is_open` for outbound requests. * Revert now unnecessary changes to the OneShotHandler. Since `libp2p-request-response` is no longer using it. * Update CHANGELOG for libp2p-swarm. Co-authored-by: Toralf Wittner <tw@dtex.org>
2020-06-29 17:08:40 +02:00
# 0.1.0
- Initial release.