From d7ee0e4d3509a2d614bf6e6fd5cbf3b487122f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Tue, 24 Jan 2023 01:10:26 +0000 Subject: [PATCH] fix(swarm)!: make on_connection_handler_event impl mandatory. (#3364) Sorry I missed this on https://github.com/libp2p/rust-libp2p/pull/3264 --- swarm/CHANGELOG.md | 8 ++++---- swarm/src/behaviour.rs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 353197245dc..0d2a38d65f6 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -9,21 +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]. -- Remove `ConnectionId::new`. Manually creating `ConnectionId`s is now unsupported. See [PR 3327]. - +[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 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. ///