Update to libp2p 0.54

This is the same libp2p Substrate uses as of
https://github.com/paritytech/polkadot-sdk/pull/6248.
This commit is contained in:
Luke Parker
2025-01-17 04:50:15 -05:00
parent 2226dd59cc
commit 2a19e9da93
6 changed files with 292 additions and 347 deletions

View File

@@ -10,7 +10,7 @@ use futures_util::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
use libp2p::request_response::{
self, Codec as CodecTrait, Event as GenericEvent, Config, Behaviour, ProtocolSupport,
};
pub use request_response::{RequestId, Message};
pub use request_response::{InboundRequestId, Message};
use serai_cosign::SignedCosign;
@@ -129,7 +129,6 @@ pub(crate) type Event = GenericEvent<Request, Response>;
pub(crate) type Behavior = Behaviour<Codec>;
pub(crate) fn new_behavior() -> Behavior {
let mut config = Config::default();
config.set_request_timeout(Duration::from_secs(5));
let config = Config::default().with_request_timeout(Duration::from_secs(5));
Behavior::new([(PROTOCOL, ProtocolSupport::Full)], config)
}