Skip to content

Commit ddb845d

Browse files
authored
update libp2p to 0.55 (#6889)
Updates libp2p to `0.55`. Will address the deprecations in a subsequent PR
1 parent b6db213 commit ddb845d

File tree

9 files changed

+350
-158
lines changed

9 files changed

+350
-158
lines changed

Cargo.lock

Lines changed: 333 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beacon_node/lighthouse_network/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ futures = { workspace = true }
2020
gossipsub = { workspace = true }
2121
hex = { workspace = true }
2222
itertools = { workspace = true }
23-
libp2p-mplex = "0.42"
23+
libp2p-mplex = "0.43"
2424
lighthouse_version = { workspace = true }
2525
lru = { workspace = true }
2626
lru_cache = { workspace = true }
@@ -50,7 +50,7 @@ unused_port = { workspace = true }
5050
void = "1.0.2"
5151

5252
[dependencies.libp2p]
53-
version = "0.54"
53+
version = "0.55"
5454
default-features = false
5555
features = ["identify", "yamux", "noise", "dns", "tcp", "tokio", "plaintext", "secp256k1", "macros", "ecdsa", "metrics", "quic", "upnp"]
5656

beacon_node/lighthouse_network/gossipsub/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ futures-timer = "3.0.2"
2626
getrandom = "0.2.12"
2727
hashlink = { workspace = true }
2828
hex_fmt = "0.3.0"
29-
libp2p = { version = "0.54", default-features = false }
29+
libp2p = { version = "0.55", default-features = false }
3030
prometheus-client = "0.22.0"
3131
quick-protobuf = "0.8"
3232
quick-protobuf-codec = "0.3"

beacon_node/lighthouse_network/gossipsub/src/handler.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ impl EnabledHandler {
194194
&mut self,
195195
FullyNegotiatedOutbound { protocol, .. }: FullyNegotiatedOutbound<
196196
<Handler as ConnectionHandler>::OutboundProtocol,
197-
<Handler as ConnectionHandler>::OutboundOpenInfo,
198197
>,
199198
) {
200199
let (substream, peer_kind) = protocol;
@@ -217,7 +216,7 @@ impl EnabledHandler {
217216
) -> Poll<
218217
ConnectionHandlerEvent<
219218
<Handler as ConnectionHandler>::OutboundProtocol,
220-
<Handler as ConnectionHandler>::OutboundOpenInfo,
219+
(),
221220
<Handler as ConnectionHandler>::ToBehaviour,
222221
>,
223222
> {
@@ -423,7 +422,7 @@ impl ConnectionHandler for Handler {
423422
type OutboundOpenInfo = ();
424423
type OutboundProtocol = ProtocolConfig;
425424

426-
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo> {
425+
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, ()> {
427426
match self {
428427
Handler::Enabled(handler) => {
429428
SubstreamProtocol::new(either::Either::Left(handler.listen_protocol.clone()), ())
@@ -458,9 +457,7 @@ impl ConnectionHandler for Handler {
458457
fn poll(
459458
&mut self,
460459
cx: &mut Context<'_>,
461-
) -> Poll<
462-
ConnectionHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::ToBehaviour>,
463-
> {
460+
) -> Poll<ConnectionHandlerEvent<Self::OutboundProtocol, (), Self::ToBehaviour>> {
464461
match self {
465462
Handler::Enabled(handler) => handler.poll(cx),
466463
Handler::Disabled(DisabledHandler::ProtocolUnsupported { peer_kind_sent }) => {
@@ -479,12 +476,7 @@ impl ConnectionHandler for Handler {
479476

480477
fn on_connection_event(
481478
&mut self,
482-
event: ConnectionEvent<
483-
Self::InboundProtocol,
484-
Self::OutboundProtocol,
485-
Self::InboundOpenInfo,
486-
Self::OutboundOpenInfo,
487-
>,
479+
event: ConnectionEvent<Self::InboundProtocol, Self::OutboundProtocol>,
488480
) {
489481
match self {
490482
Handler::Enabled(handler) => {
@@ -521,7 +513,7 @@ impl ConnectionHandler for Handler {
521513
}) => match protocol {
522514
Either::Left(protocol) => handler.on_fully_negotiated_inbound(protocol),
523515
#[allow(unreachable_patterns)]
524-
Either::Right(v) => void::unreachable(v),
516+
Either::Right(v) => libp2p::core::util::unreachable(v),
525517
},
526518
ConnectionEvent::FullyNegotiatedOutbound(fully_negotiated_outbound) => {
527519
handler.on_fully_negotiated_outbound(fully_negotiated_outbound)

beacon_node/lighthouse_network/src/discovery/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ impl<E: EthSpec> NetworkBehaviour for Discovery<E> {
994994
&mut self,
995995
_peer_id: PeerId,
996996
_connection_id: ConnectionId,
997-
_event: void::Void,
997+
_event: std::convert::Infallible,
998998
) {
999999
}
10001000

beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ impl<E: EthSpec> NetworkBehaviour for PeerManager<E> {
3737
// no events from the dummy handler
3838
}
3939

40-
fn poll(&mut self, cx: &mut Context<'_>) -> Poll<ToSwarm<Self::ToSwarm, void::Void>> {
40+
fn poll(
41+
&mut self,
42+
cx: &mut Context<'_>,
43+
) -> Poll<ToSwarm<Self::ToSwarm, std::convert::Infallible>> {
4144
// perform the heartbeat when necessary
4245
while self.heartbeat.poll_tick(cx).is_ready() {
4346
self.heartbeat();

beacon_node/lighthouse_network/src/rpc/handler.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ where
353353
!matches!(self.state, HandlerState::Deactivated)
354354
}
355355

356+
#[allow(deprecated)]
356357
fn poll(
357358
&mut self,
358359
cx: &mut Context<'_>,
@@ -814,6 +815,7 @@ where
814815
Poll::Pending
815816
}
816817

818+
#[allow(deprecated)]
817819
fn on_connection_event(
818820
&mut self,
819821
event: ConnectionEvent<

beacon_node/lighthouse_network/src/service/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ impl<E: EthSpec> Network<E> {
18461846
None
18471847
}
18481848
#[allow(unreachable_patterns)]
1849-
BehaviourEvent::ConnectionLimits(le) => void::unreachable(le),
1849+
BehaviourEvent::ConnectionLimits(le) => libp2p::core::util::unreachable(le),
18501850
},
18511851
SwarmEvent::ConnectionEstablished { .. } => None,
18521852
SwarmEvent::ConnectionClosed { .. } => None,

beacon_node/network/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ execution_layer = { workspace = true }
3131
fnv = { workspace = true }
3232
futures = { workspace = true }
3333
hex = { workspace = true }
34-
igd-next = "0.14"
34+
igd-next = { version = "0.16", features = ["aio_tokio"] }
3535
itertools = { workspace = true }
3636
lighthouse_network = { workspace = true }
3737
logging = { workspace = true }

0 commit comments

Comments
 (0)