From 5c58db63d4f5ca1e4d90d63b34f8635e0ab7adbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 20 Jan 2023 20:10:05 +0000 Subject: [PATCH 1/2] swarm: make on_connection_handler_event impl mandatory. --- swarm/src/behaviour.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/swarm/src/behaviour.rs b/swarm/src/behaviour.rs index 896b7aa38ad..12a3122212b 100644 --- a/swarm/src/behaviour.rs +++ b/swarm/src/behaviour.rs @@ -172,8 +172,7 @@ pub trait NetworkBehaviour: 'static { _connection_id: ConnectionId, _event: <::Handler as ConnectionHandler>::OutEvent, - ) { - } + ); /// Polls for things that swarm should do. /// From 135cc9c62eafdc3a94b93fab2e53e99e0968d9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Mon, 23 Jan 2023 12:13:38 +0000 Subject: [PATCH 2/2] swarm: update CHANGELOG.md --- swarm/CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 2bad2e8c375..f6c97905f06 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -9,19 +9,21 @@ - Add `estblished_in` to `SwarmEvent::ConnectionEstablished`. See [PR 3134]. - Remove deprecated `inject_*` methods from `NetworkBehaviour` and `ConnectionHandler`. - see [PR 3264]. + Make the implementation of `on_swarm_event` and `on_connection_handler_event` + both mandatory. See [PR 3264] and [PR 3364]. - Update to `libp2p-swarm-derive` `v0.32.0`. - Remove type parameter from `PendingOutboundConnectionError` and `PendingInboundConnectionError`. These two types are always used with `std::io::Error`. See [PR 3272]. -- Replace `SwarmBuilder::connection_event_buffer_size` with `SwarmBuilder::per_connection_event_buffer_size` . +- Replace `SwarmBuilder::connection_event_buffer_size` with `SwarmBuilder::per_connection_event_buffer_size` . The configured value now applies _per_ connection. The default values remains 7. If you have previously set `connection_event_buffer_size` you should re-evaluate what a good size for a _per connection_ buffer is. See [PR 3188]. +[PR 3364]: https://github.com/libp2p/rust-libp2p/pull/3364 [PR 3170]: https://github.com/libp2p/rust-libp2p/pull/3170 [PR 3134]: https://github.com/libp2p/rust-libp2p/pull/3134 [PR 3153]: https://github.com/libp2p/rust-libp2p/pull/3153