From 5a0f11e18251f038feaf5c1221aecb570de66059 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 20 Jun 2024 18:11:49 +0300 Subject: [PATCH] Use libp2p fork to circumvent Sink panic --- Cargo.lock | 128 +++++++++++--------------------------- network-libp2p/Cargo.toml | 4 +- 2 files changed, 38 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 536c739e2b..fab23a2b28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -487,19 +487,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "asynchronous-codec" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite", -] - [[package]] name = "asynchronous-codec" version = "0.7.0" @@ -1687,8 +1674,7 @@ dependencies = [ [[package]] name = "futures-bounded" version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "futures-timer", "futures-util", @@ -2621,8 +2607,7 @@ dependencies = [ [[package]] name = "libp2p" version = "0.53.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "bytes", "either", @@ -2659,8 +2644,7 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "libp2p-core", "libp2p-identity", @@ -2671,11 +2655,10 @@ dependencies = [ [[package]] name = "libp2p-autonat" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95151726170e41b591735bf95c42b888fe4aa14f65216a9fbf0edcc04510586" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "async-trait", - "asynchronous-codec 0.6.2", + "asynchronous-codec", "futures", "futures-timer", "instant", @@ -2684,7 +2667,7 @@ dependencies = [ "libp2p-request-response", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec 0.2.0", + "quick-protobuf-codec", "rand", "tracing", ] @@ -2692,8 +2675,7 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "libp2p-core", "libp2p-identity", @@ -2704,8 +2686,7 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.41.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8130a8269e65a2554d55131c770bdf4bcd94d2b8d4efb24ca23699be65066c05" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "either", "fnv", @@ -2733,8 +2714,7 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "async-trait", "futures", @@ -2749,10 +2729,9 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "base64 0.21.7", "byteorder", "bytes", @@ -2768,7 +2747,7 @@ dependencies = [ "libp2p-swarm", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand", "regex", "serde", @@ -2800,11 +2779,10 @@ dependencies = [ [[package]] name = "libp2p-kad" version = "0.45.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "arrayvec 0.7.4", - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "either", "fnv", @@ -2816,7 +2794,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand", "serde", "sha2", @@ -2830,8 +2808,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "data-encoding", "futures", @@ -2851,8 +2828,7 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "futures", "instant", @@ -2869,10 +2845,9 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "curve25519-dalek", "futures", @@ -2895,8 +2870,7 @@ dependencies = [ [[package]] name = "libp2p-ping" version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "either", "futures", @@ -2913,8 +2887,7 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "bytes", "futures", @@ -2937,8 +2910,7 @@ dependencies = [ [[package]] name = "libp2p-request-response" version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12823250fe0c45bdddea6eefa2be9a609aff1283ff4e1d8a294fdbb89572f6f" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "async-trait", "futures", @@ -2957,8 +2929,7 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.44.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "either", "fnv", @@ -2982,8 +2953,7 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -2994,8 +2964,7 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "futures", "futures-timer", @@ -3011,8 +2980,7 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "futures", "futures-rustls", @@ -3030,8 +2998,7 @@ dependencies = [ [[package]] name = "libp2p-upnp" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963eb8a174f828f6a51927999a9ab5e45dfa9aa2aa5fed99aa65f79de6229464" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "futures", "futures-timer", @@ -3046,8 +3013,7 @@ dependencies = [ [[package]] name = "libp2p-websocket" version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "either", "futures", @@ -3066,8 +3032,7 @@ dependencies = [ [[package]] name = "libp2p-websocket-websys" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550e578dcc9cd572be9dd564831d1f5efe8e6661953768b1d56c1d462855bf6f" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "bytes", "futures", @@ -3084,8 +3049,7 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200cbe50349a44760927d50b431d77bed79b9c0a3959de1af8d24a63434b71e5" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "either", "futures", @@ -3313,15 +3277,14 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "bytes", "futures", - "log", "pin-project", "smallvec", - "unsigned-varint 0.7.2", + "tracing", + "unsigned-varint 0.8.0", ] [[package]] @@ -5509,26 +5472,12 @@ dependencies = [ "byteorder", ] -[[package]] -name = "quick-protobuf-codec" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "quick-protobuf", - "thiserror", - "unsigned-varint 0.7.2", -] - [[package]] name = "quick-protobuf-codec" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "quick-protobuf", "thiserror", @@ -5952,8 +5901,7 @@ checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "rw-stream-sink" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +source = "git+https://github.com/Eligioo/rust-libp2p?branch=stefan/quicksink-no-panic#af2e5c6cedd4d330f0f29e48cd126b0148902b63" dependencies = [ "futures", "pin-project", @@ -7106,10 +7054,6 @@ name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", -] [[package]] name = "unsigned-varint" diff --git a/network-libp2p/Cargo.toml b/network-libp2p/Cargo.toml index 30c161333d..d9d0fe6911 100644 --- a/network-libp2p/Cargo.toml +++ b/network-libp2p/Cargo.toml @@ -57,7 +57,7 @@ nimiq-utils = { workspace = true, features = [ nimiq-validator-network = { workspace = true } [target.'cfg(not(target_family = "wasm"))'.dependencies] -libp2p = { version = "0.53.2", default-features = false, features = [ +libp2p = { git = "https://github.com/Eligioo/rust-libp2p", branch = "stefan/quicksink-no-panic", default-features = false, features = [ "autonat", "gossipsub", "kad", @@ -71,7 +71,7 @@ libp2p = { version = "0.53.2", default-features = false, features = [ ] } [target.'cfg(target_family = "wasm")'.dependencies] -libp2p = { version = "0.53.2", default-features = false, features = [ +libp2p = { git = "https://github.com/Eligioo/rust-libp2p", branch = "stefan/quicksink-no-panic", default-features = false, features = [ "autonat", "gossipsub", "kad",