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:
Roman
2022-06-17 17:47:14 +04:00
committed by GitHub
parent 0108d216d2
commit 1988c4ac1d
17 changed files with 277 additions and 158 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]
[build-dependencies]
prost-build = "0.9"
prost-build = "0.10"
[dependencies]
async-trait = "0.1"
@@ -29,7 +29,7 @@ futures = "0.3.21"
futures-timer = "3.0.2"
hex = "0.4.0"
ip_network = "0.4.1"
libp2p = "0.44.0"
libp2p = "0.45.1"
linked_hash_set = "0.1.3"
linked-hash-map = "0.5.4"
log = "0.4.17"
+2 -2
View File
@@ -14,13 +14,13 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]
[build-dependencies]
prost-build = "0.9"
prost-build = "0.10"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", features = [
"derive",
] }
futures = "0.3.21"
libp2p = "0.44.0"
libp2p = "0.45.1"
smallvec = "1.8.0"
sc-peerset = { version = "4.0.0-dev", path = "../../peerset" }
+2 -2
View File
@@ -14,14 +14,14 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]
[build-dependencies]
prost-build = "0.9"
prost-build = "0.10"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", features = [
"derive",
] }
futures = "0.3.21"
libp2p = "0.44.0"
libp2p = "0.45.1"
log = "0.4.16"
prost = "0.10"
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
+2 -1
View File
@@ -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> {
+6 -3
View File
@@ -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 {
+2 -2
View File
@@ -14,7 +14,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]
[build-dependencies]
prost-build = "0.9"
prost-build = "0.10"
[dependencies]
bitflags = "1.3.2"
@@ -23,7 +23,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = [
] }
either = "1.5.3"
futures = "0.3.21"
libp2p = "0.44.0"
libp2p = "0.45.1"
log = "0.4.17"
lru = "0.7.5"
prost = "0.10"
+1 -1
View File
@@ -17,7 +17,7 @@ async-std = "1.11.0"
async-trait = "0.1.50"
futures = "0.3.21"
futures-timer = "3.0.1"
libp2p = { version = "0.44.0", default-features = false }
libp2p = { version = "0.45.1", default-features = false }
log = "0.4.17"
parking_lot = "0.12.0"
rand = "0.7.2"