mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
Upgrade to libp2p 0.45.1 (#11682)
* Upgrade to libp2p 0.45.1 * Limit max_negotiating_inbound_streams to 512 * Upgrade prost-build to 0.10 * Set max_negotiating_inbound_streams to 2048 Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> * Fix authority discovery protobuf * Fix comments in authority-discovery schema Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> * Add a comment about transport initialization Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -379,7 +379,8 @@ where
|
||||
)
|
||||
.substream_upgrade_protocol_override(upgrade::Version::V1Lazy)
|
||||
.notify_handler_buffer_size(NonZeroUsize::new(32).expect("32 != 0; qed"))
|
||||
.connection_event_buffer_size(1024);
|
||||
.connection_event_buffer_size(1024)
|
||||
.max_negotiating_inbound_streams(2048);
|
||||
if let Some(spawner) = params.executor {
|
||||
struct SpawnImpl<F>(F);
|
||||
impl<F: Fn(Pin<Box<dyn Future<Output = ()> + Send>>)> Executor for SpawnImpl<F> {
|
||||
|
||||
@@ -55,12 +55,15 @@ pub fn build_transport(
|
||||
// Build the base layer of the transport.
|
||||
let transport = if !memory_only {
|
||||
let desktop_trans = tcp::TcpConfig::new().nodelay(true);
|
||||
let desktop_trans =
|
||||
websocket::WsConfig::new(desktop_trans.clone()).or_transport(desktop_trans);
|
||||
let dns_init = futures::executor::block_on(dns::DnsConfig::system(desktop_trans.clone()));
|
||||
let desktop_trans = websocket::WsConfig::new(desktop_trans)
|
||||
.or_transport(tcp::TcpConfig::new().nodelay(true));
|
||||
let dns_init = futures::executor::block_on(dns::DnsConfig::system(desktop_trans));
|
||||
EitherTransport::Left(if let Ok(dns) = dns_init {
|
||||
EitherTransport::Left(dns)
|
||||
} else {
|
||||
let desktop_trans = tcp::TcpConfig::new().nodelay(true);
|
||||
let desktop_trans = websocket::WsConfig::new(desktop_trans)
|
||||
.or_transport(tcp::TcpConfig::new().nodelay(true));
|
||||
EitherTransport::Right(desktop_trans.map_err(dns::DnsErr::Transport))
|
||||
})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user