Skip to content

Commit 0306d01

Browse files
committed
Backport ddb845d50 update libp2p to 0.55
1 parent 96eccfa commit 0306d01

6 files changed

Lines changed: 14 additions & 17 deletions

File tree

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 = { workspace = true }
3030
prometheus-client = "0.22.0"
3131
quick-protobuf = "0.8"
3232
quick-protobuf-codec = "0.3"

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)

src/discovery/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ impl NetworkBehaviour for Discovery {
991991
&mut self,
992992
_peer_id: PeerId,
993993
_connection_id: ConnectionId,
994-
_event: void::Void,
994+
_event: std::convert::Infallible,
995995
) {
996996
}
997997

src/peer_manager/network_behaviour.rs

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

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

src/rpc/handler.rs

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

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

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

src/service/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ impl<AppReqId: ReqId, P: Preset> Network<AppReqId, P> {
19001900
None
19011901
}
19021902
#[allow(unreachable_patterns)]
1903-
BehaviourEvent::ConnectionLimits(le) => void::unreachable(le),
1903+
BehaviourEvent::ConnectionLimits(le) => libp2p::core::util::unreachable(le),
19041904
},
19051905
SwarmEvent::ConnectionEstablished { .. } => None,
19061906
SwarmEvent::ConnectionClosed { .. } => None,

0 commit comments

Comments
 (0)