update libp2p to 0.55 (#6889)

Updates libp2p to `0.55`.
Will address the deprecations in a subsequent PR
This commit is contained in:
João Oliveira
2025-01-31 12:21:06 +00:00
committed by GitHub
parent b6db213548
commit ddb845d503
9 changed files with 351 additions and 159 deletions

View File

@@ -26,7 +26,7 @@ futures-timer = "3.0.2"
getrandom = "0.2.12"
hashlink = { workspace = true }
hex_fmt = "0.3.0"
libp2p = { version = "0.54", default-features = false }
libp2p = { version = "0.55", default-features = false }
prometheus-client = "0.22.0"
quick-protobuf = "0.8"
quick-protobuf-codec = "0.3"

View File

@@ -194,7 +194,6 @@ impl EnabledHandler {
&mut self,
FullyNegotiatedOutbound { protocol, .. }: FullyNegotiatedOutbound<
<Handler as ConnectionHandler>::OutboundProtocol,
<Handler as ConnectionHandler>::OutboundOpenInfo,
>,
) {
let (substream, peer_kind) = protocol;
@@ -217,7 +216,7 @@ impl EnabledHandler {
) -> Poll<
ConnectionHandlerEvent<
<Handler as ConnectionHandler>::OutboundProtocol,
<Handler as ConnectionHandler>::OutboundOpenInfo,
(),
<Handler as ConnectionHandler>::ToBehaviour,
>,
> {
@@ -423,7 +422,7 @@ impl ConnectionHandler for Handler {
type OutboundOpenInfo = ();
type OutboundProtocol = ProtocolConfig;
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo> {
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, ()> {
match self {
Handler::Enabled(handler) => {
SubstreamProtocol::new(either::Either::Left(handler.listen_protocol.clone()), ())
@@ -458,9 +457,7 @@ impl ConnectionHandler for Handler {
fn poll(
&mut self,
cx: &mut Context<'_>,
) -> Poll<
ConnectionHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::ToBehaviour>,
> {
) -> Poll<ConnectionHandlerEvent<Self::OutboundProtocol, (), Self::ToBehaviour>> {
match self {
Handler::Enabled(handler) => handler.poll(cx),
Handler::Disabled(DisabledHandler::ProtocolUnsupported { peer_kind_sent }) => {
@@ -479,12 +476,7 @@ impl ConnectionHandler for Handler {
fn on_connection_event(
&mut self,
event: ConnectionEvent<
Self::InboundProtocol,
Self::OutboundProtocol,
Self::InboundOpenInfo,
Self::OutboundOpenInfo,
>,
event: ConnectionEvent<Self::InboundProtocol, Self::OutboundProtocol>,
) {
match self {
Handler::Enabled(handler) => {
@@ -521,7 +513,7 @@ impl ConnectionHandler for Handler {
}) => match protocol {
Either::Left(protocol) => handler.on_fully_negotiated_inbound(protocol),
#[allow(unreachable_patterns)]
Either::Right(v) => void::unreachable(v),
Either::Right(v) => libp2p::core::util::unreachable(v),
},
ConnectionEvent::FullyNegotiatedOutbound(fully_negotiated_outbound) => {
handler.on_fully_negotiated_outbound(fully_negotiated_outbound)