diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 7dd8e1e39..0f0ef844f 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -57,13 +57,5 @@ jobs: - name: Cleanup run: find . -name \*.profraw -type f -exec rm -f {} + - wasm: - name: wasm - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: wasm32-unknown-unknown - - run: cargo build --package avail-light-core --target wasm32-unknown-unknown + diff --git a/Cargo.lock b/Cargo.lock index be9b18e2a..dbf0149a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -550,23 +550,23 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] [[package]] name = "asn1-rs" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ - "asn1-rs-derive 0.5.0", + "asn1-rs-derive 0.5.1", "asn1-rs-impl 0.2.0", "displaydoc", "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -584,9 +584,9 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", @@ -862,6 +862,19 @@ dependencies = [ "syn 2.0.87", ] +[[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" @@ -1049,7 +1062,7 @@ dependencies = [ "strum", "sysinfo", "test-case", - "thiserror", + "thiserror 1.0.64", "thiserror-no-std", "threadpool", "tokio", @@ -1337,7 +1350,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.87", ] @@ -1572,13 +1585,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.104" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -1825,7 +1838,7 @@ checksum = "e37668cb35145dcfaa1931a5f37fde375eeae8068b4c0d2f289da28a270b2d2c" dependencies = [ "directories 4.0.1", "serde", - "thiserror", + "thiserror 1.0.64", "toml 0.5.11", ] @@ -2228,7 +2241,7 @@ version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs 0.6.1", + "asn1-rs 0.6.2", "displaydoc", "nom", "num-bigint", @@ -3285,7 +3298,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3492,9 +3505,9 @@ checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "447afdcdb8afb9d0a852af6dc65d9b285ce720ed7a59e42a8bf2e931c67bc1b5" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -3503,12 +3516,12 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.4.0", + "idna 1.0.3", "ipnet", "once_cell", "rand", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tokio", "tracing", @@ -3517,9 +3530,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" dependencies = [ "cfg-if 1.0.0", "futures-util", @@ -3531,7 +3544,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -3780,6 +3793,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -3788,9 +3919,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3798,12 +3929,23 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -4007,11 +4149,11 @@ dependencies = [ "rand", "rtcp", "rtp 0.9.0", - "thiserror", + "thiserror 1.0.64", "tokio", "waitgroup", "webrtc-srtp", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -4101,7 +4243,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.64", "walkdir", ] @@ -4168,7 +4310,7 @@ dependencies = [ "rustls-native-certs 0.7.1", "rustls-pki-types", "soketto 0.7.1", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.25.0", "tokio-util", @@ -4193,7 +4335,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.0", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.26.0", "tokio-util", @@ -4214,7 +4356,7 @@ dependencies = [ "jsonrpsee-types 0.21.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -4233,10 +4375,10 @@ dependencies = [ "hyper 0.14.29", "jsonrpsee-types 0.22.5", "pin-project", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -4256,10 +4398,10 @@ dependencies = [ "futures-util", "jsonrpsee-types 0.23.2", "pin-project", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -4279,7 +4421,7 @@ dependencies = [ "jsonrpsee-types 0.22.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tower", "tracing", @@ -4296,7 +4438,7 @@ dependencies = [ "beef", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4309,7 +4451,7 @@ dependencies = [ "beef", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4322,7 +4464,7 @@ dependencies = [ "http 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -4416,9 +4558,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libloading" @@ -4448,18 +4590,20 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.54.1" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" dependencies = [ "bytes", "either", "futures", "futures-timer", "getrandom", + "instant", "libp2p-allow-block-list", "libp2p-autonat", "libp2p-connection-limits", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-dcutr", "libp2p-dns", "libp2p-gossipsub", @@ -4468,7 +4612,7 @@ dependencies = [ "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-noise", + "libp2p-noise 0.44.0", "libp2p-ping", "libp2p-quic", "libp2p-relay", @@ -4479,16 +4623,17 @@ dependencies = [ "libp2p-yamux", "multiaddr", "pin-project", - "rw-stream-sink", - "thiserror", + "rw-stream-sink 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.64", ] [[package]] name = "libp2p-allow-block-list" -version = "0.4.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" dependencies = [ - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "void", @@ -4496,41 +4641,66 @@ dependencies = [ [[package]] name = "libp2p-autonat" -version = "0.13.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95151726170e41b591735bf95c42b888fe4aa14f65216a9fbf0edcc04510586" dependencies = [ "async-trait", - "asynchronous-codec", - "bytes", - "either", + "asynchronous-codec 0.6.2", "futures", - "futures-bounded", "futures-timer", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-request-response", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.2.0", "rand", - "rand_core", - "thiserror", "tracing", - "void", - "web-time", ] [[package]] name = "libp2p-connection-limits" -version = "0.4.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" dependencies = [ - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "void", ] +[[package]] +name = "libp2p-core" +version = "0.41.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-identity", + "multiaddr", + "multihash 0.19.1", + "multistream-select 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell", + "parking_lot 0.12.3", + "pin-project", + "quick-protobuf", + "rand", + "rw-stream-sink 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "smallvec", + "thiserror 1.0.64", + "tracing", + "unsigned-varint 0.8.0", + "void", + "web-time", +] + [[package]] name = "libp2p-core" version = "0.42.0" @@ -4543,16 +4713,15 @@ dependencies = [ "libp2p-identity", "multiaddr", "multihash 0.19.1", - "multistream-select", + "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc)", "once_cell", "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand", - "rw-stream-sink", - "serde", + "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc)", "smallvec", - "thiserror", + "thiserror 1.0.64", "tracing", "unsigned-varint 0.8.0", "void", @@ -4561,35 +4730,37 @@ dependencies = [ [[package]] name = "libp2p-dcutr" -version = "0.12.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f7bb7fa2b9e6cad9c30a6f67e3ff5c1e4b658c62b6375e35861a85f9c97bf3" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "either", "futures", "futures-bounded", "futures-timer", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", - "lru", + "lru 0.11.1", "quick-protobuf", - "quick-protobuf-codec", - "thiserror", + "quick-protobuf-codec 0.2.0", + "thiserror 1.0.64", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-dns" -version = "0.42.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" dependencies = [ "async-trait", "futures", "hickory-resolver", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "parking_lot 0.12.3", "smallvec", @@ -4598,11 +4769,12 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.47.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" dependencies = [ - "asynchronous-codec", - "base64 0.22.1", + "asynchronous-codec 0.7.0", + "base64 0.21.7", "byteorder", "bytes", "either", @@ -4611,12 +4783,13 @@ dependencies = [ "futures-ticker", "getrandom", "hex_fmt", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand", "regex", "serde", @@ -4624,27 +4797,27 @@ dependencies = [ "smallvec", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-identify" -version = "0.45.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "either", "futures", "futures-bounded", "futures-timer", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", - "lru", + "lru 0.12.3", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec", - "thiserror", + "thiserror 1.0.64", "tracing", "void", ] @@ -4663,50 +4836,52 @@ dependencies = [ "rand", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "tracing", "zeroize", ] [[package]] name = "libp2p-kad" -version = "0.46.2" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.45.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" dependencies = [ "arrayvec 0.7.4", - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "either", "fnv", "futures", "futures-bounded", "futures-timer", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand", "serde", "sha2 0.10.8", "smallvec", - "thiserror", + "thiserror 1.0.64", "tracing", "uint 0.9.5", "void", - "web-time", ] [[package]] name = "libp2p-mdns" -version = "0.46.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" dependencies = [ "data-encoding", "futures", "hickory-proto", "if-watch", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "rand", @@ -4719,11 +4894,13 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.15.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" dependencies = [ "futures", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-dcutr", "libp2p-identify", "libp2p-identity", @@ -4733,7 +4910,32 @@ dependencies = [ "libp2p-swarm", "pin-project", "prometheus-client", - "web-time", +] + +[[package]] +name = "libp2p-noise" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "curve25519-dalek", + "futures", + "libp2p-core 0.41.3", + "libp2p-identity", + "multiaddr", + "multihash 0.19.1", + "once_cell", + "quick-protobuf", + "rand", + "sha2 0.10.8", + "snow", + "static_assertions", + "thiserror 1.0.64", + "tracing", + "x25519-dalek", + "zeroize", ] [[package]] @@ -4741,11 +4943,11 @@ name = "libp2p-noise" version = "0.45.0" source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek", "futures", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "multiaddr", "multihash 0.19.1", @@ -4755,7 +4957,7 @@ dependencies = [ "sha2 0.10.8", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.64", "tracing", "x25519-dalek", "zeroize", @@ -4763,31 +4965,33 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.45.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" dependencies = [ "either", "futures", "futures-timer", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "rand", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-quic" -version = "0.11.1" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-tls", "parking_lot 0.12.3", @@ -4796,30 +5000,31 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.10", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] [[package]] name = "libp2p-relay" -version = "0.18.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d1c667cfabf3dd675c8e3cea63b7b98434ecf51721b7894cbb01d29983a6a9b" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "either", "futures", "futures-bounded", "futures-timer", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand", "static_assertions", - "thiserror", + "thiserror 1.0.64", "tracing", "void", "web-time", @@ -4827,52 +5032,53 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" dependencies = [ "async-trait", "futures", "futures-bounded", "futures-timer", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm", "rand", "smallvec", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-swarm" -version = "0.45.1" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" dependencies = [ "either", "fnv", "futures", "futures-timer", - "getrandom", - "libp2p-core", + "instant", + "libp2p-core 0.41.3", "libp2p-identity", "libp2p-swarm-derive", - "lru", - "multistream-select", + "lru 0.12.3", + "multistream-select 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "rand", "smallvec", "tokio", "tracing", "void", - "wasm-bindgen-futures", - "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.35.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.34.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4882,14 +5088,15 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.42.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" dependencies = [ "futures", "futures-timer", "if-watch", "libc", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "socket2 0.5.7", "tokio", @@ -4898,31 +5105,33 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.5.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" dependencies = [ "futures", "futures-rustls", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "rcgen", "ring 0.17.8", "rustls 0.23.10", "rustls-webpki 0.101.7", - "thiserror", + "thiserror 1.0.64", "x509-parser 0.16.0", "yasna", ] [[package]] name = "libp2p-upnp" -version = "0.3.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" dependencies = [ "futures", "futures-timer", "igd-next", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-swarm", "tokio", "tracing", @@ -4931,8 +5140,9 @@ dependencies = [ [[package]] name = "libp2p-webrtc" -version = "0.8.0-alpha" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.7.1-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9af8ced4eb617353ebf941724be74564c99fa2e0a42a54e8009bcd97613b08c" dependencies = [ "async-trait", "bytes", @@ -4940,16 +5150,16 @@ dependencies = [ "futures-timer", "hex", "if-watch", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", - "libp2p-noise", - "libp2p-webrtc-utils", + "libp2p-noise 0.44.0", + "libp2p-webrtc-utils 0.2.1", "multihash 0.19.1", "rand", "rcgen", "serde", - "stun 0.6.0", - "thiserror", + "stun", + "thiserror 1.0.64", "tinytemplate", "tokio", "tokio-util", @@ -4957,24 +5167,47 @@ dependencies = [ "webrtc", ] +[[package]] +name = "libp2p-webrtc-utils" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95eb35ba4991eab0284c2fc2d535b0a53fe10005001284c89f3cb01c5b0e1249" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "futures", + "hex", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-noise 0.44.0", + "quick-protobuf", + "quick-protobuf-codec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand", + "serde", + "sha2 0.10.8", + "thiserror 1.0.64", + "tinytemplate", + "tracing", +] + [[package]] name = "libp2p-webrtc-utils" version = "0.3.0" source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "futures", "hex", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", - "libp2p-noise", + "libp2p-noise 0.45.0", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc)", "rand", "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.64", "tinytemplate", "tracing", ] @@ -4989,11 +5222,11 @@ dependencies = [ "getrandom", "hex", "js-sys", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", - "libp2p-webrtc-utils", + "libp2p-webrtc-utils 0.3.0", "send_wrapper 0.6.0", - "thiserror", + "thiserror 1.0.64", "tracing", "wasm-bindgen", "wasm-bindgen-futures", @@ -5002,19 +5235,20 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.44.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.43.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b953b6803a1f3161a989538974d72511c4e48a4af355337b6fb90723c56c05" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "parking_lot 0.12.3", "pin-project-lite", - "rw-stream-sink", + "rw-stream-sink 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "soketto 0.8.0", - "thiserror", + "thiserror 1.0.64", "tracing", "url", "webpki-roots 0.25.4", @@ -5022,16 +5256,17 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.46.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" dependencies = [ "either", "futures", - "libp2p-core", - "thiserror", + "libp2p-core 0.41.3", + "thiserror 1.0.64", "tracing", "yamux 0.12.1", - "yamux 0.13.3", + "yamux 0.13.4", ] [[package]] @@ -5143,6 +5378,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -5163,6 +5404,15 @@ dependencies = [ "value-bag", ] +[[package]] +name = "lru" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "lru" version = "0.12.3" @@ -5183,9 +5433,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.5" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -5484,6 +5734,20 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "multistream-select" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint 0.7.2", +] + [[package]] name = "multistream-select" version = "0.13.0" @@ -5532,7 +5796,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5546,7 +5810,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -5772,11 +6036,11 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "asn1-rs 0.6.1", + "asn1-rs 0.6.2", ] [[package]] @@ -5807,7 +6071,7 @@ dependencies = [ "futures-sink", "js-sys", "pin-project-lite", - "thiserror", + "thiserror 1.0.64", "tracing", ] @@ -5824,7 +6088,7 @@ dependencies = [ "opentelemetry-proto", "opentelemetry_sdk", "prost", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic", "tracing", @@ -5857,7 +6121,7 @@ dependencies = [ "percent-encoding", "rand", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -6218,12 +6482,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" - [[package]] name = "powerfmt" version = "0.2.0" @@ -6365,9 +6623,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", @@ -6453,59 +6711,90 @@ 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 1.0.64", + "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" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "quick-protobuf", + "thiserror 1.0.64", + "unsigned-varint 0.8.0", +] + [[package]] name = "quick-protobuf-codec" version = "0.3.1" source = "git+https://github.com/libp2p/rust-libp2p?rev=aa9317fbdd88cc4c9a39ea608fa1d57e022297fc#aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.64", "unsigned-varint 0.8.0", ] [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.1.0", "rustls 0.23.10", - "thiserror", + "socket2 0.5.7", + "thiserror 2.0.7", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring 0.17.8", - "rustc-hash", + "rustc-hash 2.1.0", "rustls 0.23.10", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.7", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2 0.5.7", @@ -6611,7 +6900,7 @@ dependencies = [ "futures", "jsonrpsee 0.23.2", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", "wasm-bindgen-futures", @@ -6643,7 +6932,7 @@ checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6794,8 +7083,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33648a781874466a62d89e265fee9f17e32bc7d05a256e6cca41bf97eadcd8aa" dependencies = [ "bytes", - "thiserror", - "webrtc-util 0.8.1", + "thiserror 1.0.64", + "webrtc-util", ] [[package]] @@ -6809,7 +7098,7 @@ dependencies = [ "netlink-packet-route", "netlink-proto", "nix 0.24.3", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -6822,8 +7111,8 @@ dependencies = [ "bytes", "rand", "serde", - "thiserror", - "webrtc-util 0.8.1", + "thiserror 1.0.64", + "webrtc-util", ] [[package]] @@ -6835,8 +7124,8 @@ dependencies = [ "bytes", "rand", "serde", - "thiserror", - "webrtc-util 0.8.1", + "thiserror 1.0.64", + "webrtc-util", ] [[package]] @@ -6851,6 +7140,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -7006,6 +7301,9 @@ name = "rustls-pki-types" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +dependencies = [ + "web-time", +] [[package]] name = "rustls-platform-verifier" @@ -7084,6 +7382,17 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "rw-stream-sink" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + [[package]] name = "rw-stream-sink" version = "0.4.0" @@ -7222,7 +7531,7 @@ dependencies = [ "quote", "scale-info", "syn 2.0.87", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -7315,7 +7624,7 @@ checksum = "13254db766b17451aced321e7397ebf0a446ef0c8d2942b6e67a95815421093f" dependencies = [ "rand", "substring", - "thiserror", + "thiserror 1.0.64", "url", ] @@ -7699,7 +8008,7 @@ dependencies = [ "hex", "itertools 0.12.1", "log", - "lru", + "lru 0.12.3", "no-std-net", "parking_lot 0.12.3", "pin-project", @@ -7799,7 +8108,7 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", "sp-trie", "sp-version", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -7901,7 +8210,7 @@ dependencies = [ "sp-storage 19.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", "ss58-registry", "substrate-bip39", - "thiserror", + "thiserror 1.0.64", "tracing", "w3f-bls", "zeroize", @@ -8027,7 +8336,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8064,7 +8373,7 @@ dependencies = [ "parking_lot 0.12.3", "sp-core", "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8205,7 +8514,7 @@ dependencies = [ "sp-panic-handler", "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", "sp-trie", - "thiserror", + "thiserror 1.0.64", "tracing", "trie-db", ] @@ -8286,7 +8595,7 @@ dependencies = [ "sp-core", "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", - "thiserror", + "thiserror 1.0.64", "tracing", "trie-db", "trie-root", @@ -8306,7 +8615,7 @@ dependencies = [ "sp-runtime", "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-10)", "sp-version-proc-macro", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8464,29 +8773,10 @@ dependencies = [ "rand", "ring 0.17.8", "subtle", - "thiserror", + "thiserror 1.0.64", "tokio", "url", - "webrtc-util 0.8.1", -] - -[[package]] -name = "stun" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28fad383a1cc63ae141e84e48eaef44a1063e9d9e55bcb8f51a99b886486e01b" -dependencies = [ - "base64 0.21.7", - "crc", - "lazy_static", - "md-5", - "rand", - "ring 0.17.8", - "subtle", - "thiserror", - "tokio", - "url", - "webrtc-util 0.9.0", + "webrtc-util", ] [[package]] @@ -8548,7 +8838,7 @@ dependencies = [ "subxt-lightclient", "subxt-macro", "subxt-metadata", - "thiserror", + "thiserror 1.0.64", "tokio-util", "tracing", "url", @@ -8572,7 +8862,7 @@ dependencies = [ "scale-typegen", "subxt-metadata", "syn 2.0.87", - "thiserror", + "thiserror 1.0.64", "tokio", ] @@ -8621,7 +8911,7 @@ dependencies = [ "serde_json", "smoldot", "smoldot-light", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", "tracing", @@ -8846,7 +9136,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +dependencies = [ + "thiserror-impl 2.0.7", ] [[package]] @@ -8860,6 +9159,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "thiserror-impl" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "thiserror-impl-no-std" version = "2.0.2" @@ -8959,6 +9269,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -9401,7 +9721,7 @@ dependencies = [ "log", "rand", "sha1", - "thiserror", + "thiserror 1.0.64", "url", "utf-8", ] @@ -9419,11 +9739,11 @@ dependencies = [ "md-5", "rand", "ring 0.17.8", - "stun 0.5.1", - "thiserror", + "stun", + "thiserror 1.0.64", "tokio", "tokio-util", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -9531,6 +9851,10 @@ 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" @@ -9567,6 +9891,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -9666,7 +10002,7 @@ dependencies = [ "rand_core", "sha2 0.10.8", "sha3 0.10.8", - "thiserror", + "thiserror 1.0.64", "zeroize", ] @@ -9913,7 +10249,7 @@ dependencies = [ "object 0.30.4", "serde", "target-lexicon", - "thiserror", + "thiserror 1.0.64", "wasmparser", "wasmtime-types", ] @@ -9993,7 +10329,7 @@ checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", - "thiserror", + "thiserror 1.0.64", "wasmparser", ] @@ -10058,8 +10394,8 @@ dependencies = [ "serde_json", "sha2 0.10.8", "smol_str", - "stun 0.5.1", - "thiserror", + "stun", + "thiserror 1.0.64", "time", "tokio", "turn", @@ -10072,7 +10408,7 @@ dependencies = [ "webrtc-media", "webrtc-sctp", "webrtc-srtp", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -10083,10 +10419,10 @@ checksum = "e8c08e648e10572b9edbe741074e0f4d3cb221aa7cdf9a814ee71606de312f33" dependencies = [ "bytes", "log", - "thiserror", + "thiserror 1.0.64", "tokio", "webrtc-sctp", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -10118,9 +10454,9 @@ dependencies = [ "sha1", "sha2 0.10.8", "subtle", - "thiserror", + "thiserror 1.0.64", "tokio", - "webrtc-util 0.8.1", + "webrtc-util", "x25519-dalek", "x509-parser 0.15.1", ] @@ -10138,15 +10474,15 @@ dependencies = [ "rand", "serde", "serde_json", - "stun 0.5.1", - "thiserror", + "stun", + "thiserror 1.0.64", "tokio", "turn", "url", "uuid", "waitgroup", "webrtc-mdns", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -10157,9 +10493,9 @@ checksum = "ce981f93104a8debb3563bb0cedfe4aa2f351fdf6b53f346ab50009424125c08" dependencies = [ "log", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.64", "tokio", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -10172,7 +10508,7 @@ dependencies = [ "bytes", "rand", "rtp 0.10.0", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -10187,9 +10523,9 @@ dependencies = [ "crc", "log", "rand", - "thiserror", + "thiserror 1.0.64", "tokio", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -10210,9 +10546,9 @@ dependencies = [ "rtp 0.9.0", "sha1", "subtle", - "thiserror", + "thiserror 1.0.64", "tokio", - "webrtc-util 0.8.1", + "webrtc-util", ] [[package]] @@ -10230,28 +10566,7 @@ dependencies = [ "log", "nix 0.26.4", "rand", - "thiserror", - "tokio", - "winapi", -] - -[[package]] -name = "webrtc-util" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc8d9bc631768958ed97b8d68b5d301e63054ae90b09083d43e2fefb939fd77e" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "ipnet", - "lazy_static", - "libc", - "log", - "nix 0.26.4", - "portable-atomic", - "rand", - "thiserror", + "thiserror 1.0.64", "tokio", "winapi", ] @@ -10607,6 +10922,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -10642,7 +10969,7 @@ dependencies = [ "oid-registry 0.6.1", "ring 0.16.20", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -10652,14 +10979,14 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs 0.6.1", + "asn1-rs 0.6.2", "data-encoding", "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry 0.7.0", + "oid-registry 0.7.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -10695,9 +11022,9 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" +checksum = "17610762a1207ee816c6fadc29220904753648aba0a9ed61c7b8336e80a559c4" dependencies = [ "futures", "log", @@ -10724,6 +11051,30 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -10744,6 +11095,27 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -10764,6 +11136,28 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "zstd-sys" version = "2.0.11+zstd.1.5.6" diff --git a/Cargo.toml b/Cargo.toml index 87ad90ae7..cc33d2df3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,9 +31,9 @@ confy = "0.5.1" hex = "0.4.3" rand = { version = "0.8.5", default-features = false } # TODO: Replace with released libp2p version once webrtc-websys compilation issue is resolved -libp2p = { git = "https://github.com/libp2p/rust-libp2p", rev = "aa9317fbdd88cc4c9a39ea608fa1d57e022297fc", features = ["kad", "identify", "ping", "mdns", "autonat", "relay", "dcutr", "upnp", "noise", "yamux", "dns", "metrics", "tokio", "macros", "tcp", "quic", "serde", "websocket"] } -libp2p-allow-block-list = { git = "https://github.com/libp2p/rust-libp2p", rev = "aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" } -libp2p-webrtc = { git = "https://github.com/libp2p/rust-libp2p", rev = "aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" } +libp2p = { version = "0.53.2", features = ["kad", "identify", "ping", "mdns", "autonat", "relay", "dcutr", "upnp", "noise", "yamux", "dns", "metrics", "tokio", "macros", "tcp", "quic", "serde", "websocket"] } +libp2p-allow-block-list = "0.3.0" +libp2p-webrtc = "=0.7.1-alpha" libp2p-webrtc-websys = { git = "https://github.com/libp2p/rust-libp2p", rev = "aa9317fbdd88cc4c9a39ea608fa1d57e022297fc" } multihash = { version = "0.14.0", default-features = false, features = ["blake3", "sha3"] } semver = "1.0.23" diff --git a/bootstrap/src/p2p.rs b/bootstrap/src/p2p.rs index 74c589d52..9ca52cc8e 100644 --- a/bootstrap/src/p2p.rs +++ b/bootstrap/src/p2p.rs @@ -24,7 +24,6 @@ pub use client::Client; use event_loop::EventLoop; use libp2p_allow_block_list as allow_block_list; use tracing::info; - #[derive(NetworkBehaviour)] pub struct Behaviour { kademlia: kad::Behaviour, @@ -72,10 +71,10 @@ pub async fn init( // create new Kademlia Memory Store let kad_store = MemoryStore::new(id_keys.public().to_peer_id()); // create Kademlia Config - let mut kad_cfg = kad::Config::new(cfg.kademlia.protocol_name.clone()); + let mut kad_cfg = kad::Config::default(); kad_cfg .set_query_timeout(cfg.kademlia.query_timeout) - .set_periodic_bootstrap_interval(Some(cfg.kademlia.bootstrap_interval)); + .set_protocol_names(vec![cfg.kademlia.protocol_name.clone()]); // build the Swarm, connecting the lower transport logic with the // higher layer network behaviour logic let tokio_swarm = SwarmBuilder::with_existing_identity(id_keys.clone()).with_tokio(); @@ -124,7 +123,7 @@ pub async fn init( Ok(( Client::new(command_sender), - EventLoop::new(swarm, command_receiver), + EventLoop::new(swarm, command_receiver, cfg.kademlia.bootstrap_interval), )) } diff --git a/bootstrap/src/p2p/event_loop.rs b/bootstrap/src/p2p/event_loop.rs index 90f44c7cf..6189794c5 100644 --- a/bootstrap/src/p2p/event_loop.rs +++ b/bootstrap/src/p2p/event_loop.rs @@ -11,8 +11,12 @@ use libp2p::{ use std::{ collections::{hash_map, HashMap}, str::FromStr, + time::Duration, +}; +use tokio::{ + sync::{mpsc, oneshot}, + time::{interval_at, Instant, Interval}, }; -use tokio::sync::{mpsc, oneshot}; use tracing::{debug, info, trace}; use crate::types::AgentVersion; @@ -26,20 +30,34 @@ enum SwarmChannel { Dial(oneshot::Sender>), } +// BootstrapState keeps track of all things bootstrap related +struct BootstrapState { + // timer that is responsible for firing periodic bootstraps + timer: Interval, +} + pub struct EventLoop { swarm: Swarm, command_receiver: mpsc::Receiver, pending_kad_routing: HashMap>>, pending_swarm_events: HashMap, + bootstrap: BootstrapState, } impl EventLoop { - pub fn new(swarm: Swarm, command_receiver: mpsc::Receiver) -> Self { + pub fn new( + swarm: Swarm, + command_receiver: mpsc::Receiver, + bootstrap_interval: Duration, + ) -> Self { Self { swarm, command_receiver, pending_kad_routing: Default::default(), pending_swarm_events: Default::default(), + bootstrap: BootstrapState { + timer: interval_at(Instant::now() + bootstrap_interval, bootstrap_interval), + }, } } @@ -53,6 +71,7 @@ impl EventLoop { // shutting down whole network event loop None => return, }, + _ = self.bootstrap.timer.tick() => self.handle_periodic_bootstraps(), } } } @@ -101,7 +120,6 @@ impl EventLoop { protocols, .. }, - connection_id: _, })) => { debug!("Identity Received from: {peer_id:?} on listen address: {listen_addrs:?}."); let incoming_peer_agent_version = match AgentVersion::from_str(&agent_version) { @@ -281,4 +299,9 @@ impl EventLoop { }, } } + + fn handle_periodic_bootstraps(&mut self) { + debug!("Starting periodic Bootstrap."); + _ = self.swarm.behaviour_mut().kademlia.bootstrap(); + } } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index e7b62fa03..061f49e48 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.1.0 +- Downgrade libp2p version to 0.53.3 - Update opentelemetry sdk version to 0.27.1 - Enable WASM compilation of the network, light_client and related mods diff --git a/core/Cargo.toml b/core/Cargo.toml index 0f7cedd05..8b29d0a1a 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -78,7 +78,8 @@ color-eyre = { workspace = true } ed25519-compact = "2.1.1" # NOTE: This is used due bug explained at: https://github.com/tomaka/wasm-timer/pull/13 fluvio-wasm-timer = "0.2.5" -libp2p = { workspace = true, features = ["wasm-bindgen"] } +libp2p = { workspace = true } +libp2p-allow-block-list = { workspace = true } libp2p-webrtc-websys = { workspace = true } rand = { workspace = true, features = ["std_rng"] } thiserror-no-std = "2.0.2" diff --git a/core/src/network/p2p.rs b/core/src/network/p2p.rs index 4cc8a1746..d04232807 100644 --- a/core/src/network/p2p.rs +++ b/core/src/network/p2p.rs @@ -5,7 +5,9 @@ use color_eyre::{ }; use configuration::{kad_config, LibP2PConfig}; use libp2p::{ - autonat, dcutr, identify, + autonat, + connection_limits::{self, ConnectionLimits}, + dcutr, identify, identity::{self, ed25519, Keypair}, kad::{self, Mode, PeerRecord, QueryStats, Record, RecordKey}, noise, ping, relay, @@ -181,6 +183,7 @@ type Command = Box Result<(), Report> + Send>; pub struct Behaviour { kademlia: kad::Behaviour, identify: identify::Behaviour, + connection_limits: connection_limits::Behaviour, ping: ping::Behaviour, #[cfg(not(target_arch = "wasm32"))] mdns: mdns::tokio::Behaviour, @@ -298,8 +301,17 @@ async fn build_swarm( let kad_cfg: kad::Config = kad_config(cfg, genesis_hash); + let connection_limits = ConnectionLimits::default() + .with_max_pending_incoming(Some(100)) + .with_max_pending_outgoing(Some(100)) + .with_max_established_incoming(Some(100)) + .with_max_established_outgoing(Some(100)) + .with_max_established_per_peer(Some(1)) + .with_max_established(Some(1000)); + let behaviour = |key: &identity::Keypair, relay_client| { Ok(Behaviour { + connection_limits: connection_limits::Behaviour::new(connection_limits), ping: ping::Behaviour::new(ping::Config::new()), identify: identify::Behaviour::new(identify_cfg), relay_client, @@ -324,7 +336,6 @@ async fn build_swarm( .build(); } - #[cfg(not(target_arch = "wasm32"))] if cfg.ws_transport_enable { swarm = tokio_swarm .with_websocket(noise::Config::new, yamux::Config::default) @@ -336,7 +347,7 @@ async fn build_swarm( } else { swarm = tokio_swarm .with_tcp( - tcp::Config::default().nodelay(false), + tcp::Config::default().port_reuse(false).nodelay(false), noise::Config::new, yamux::Config::default, )? diff --git a/core/src/network/p2p/client.rs b/core/src/network/p2p/client.rs index a14314ba5..ed0989269 100644 --- a/core/src/network/p2p/client.rs +++ b/core/src/network/p2p/client.rs @@ -143,7 +143,6 @@ impl Client { let opts = DialOpts::peer_id(peer_id) .addresses(peer_address) .condition(dial_condition) - .allocate_new_port() .build(); context.swarm.dial(opts)?; diff --git a/core/src/network/p2p/configuration.rs b/core/src/network/p2p/configuration.rs index f3e01e835..8dbf5a21d 100644 --- a/core/src/network/p2p/configuration.rs +++ b/core/src/network/p2p/configuration.rs @@ -199,9 +199,10 @@ impl LibP2PConfig { pub fn kad_config(cfg: &LibP2PConfig, genesis_hash: &str) -> kad::Config { // create Kademlia Config - let mut kad_cfg = kad::Config::new(protocol_name(genesis_hash)); + let mut kad_cfg = kad::Config::default(); kad_cfg .set_publication_interval(Some(cfg.kademlia.publication_interval)) + .set_protocol_names(vec![protocol_name(genesis_hash)]) .set_replication_interval(Some(cfg.kademlia.record_replication_interval)) .set_replication_factor(cfg.kademlia.record_replication_factor) .set_query_timeout(cfg.kademlia.query_timeout) @@ -210,8 +211,7 @@ pub fn kad_config(cfg: &LibP2PConfig, genesis_hash: &str) -> kad::Config { max_peers: cfg.kademlia.caching_max_peers, }) .disjoint_query_paths(cfg.kademlia.disjoint_query_paths) - .set_record_filtering(kad::StoreInserts::FilterBoth) - .set_periodic_bootstrap_interval(Some(cfg.kademlia.bootstrap_period)); + .set_record_filtering(kad::StoreInserts::FilterBoth); kad_cfg } diff --git a/core/src/network/p2p/event_loop.rs b/core/src/network/p2p/event_loop.rs index c539ecb4d..9c2586b21 100644 --- a/core/src/network/p2p/event_loop.rs +++ b/core/src/network/p2p/event_loop.rs @@ -31,6 +31,7 @@ use tokio::sync::{ }; #[cfg(not(target_arch = "wasm32"))] use tokio::time::{interval, Instant}; +use tokio::time::{interval_at, Interval}; #[cfg(target_arch = "wasm32")] use tokio_with_wasm::alias as tokio; use tracing::{debug, error, info, trace, warn}; @@ -77,6 +78,12 @@ impl RelayState { } } +// BootstrapState keeps track of all things bootstrap related +struct BootstrapState { + // timer that is responsible for firing periodic bootstraps + timer: Interval, +} + struct EventLoopConfig { // Used for checking protocol version is_fat_client: bool, @@ -133,6 +140,7 @@ pub struct EventLoop { pub pending_kad_queries: HashMap, // Tracking swarm events (i.e. peer dialing) pub pending_swarm_events: HashMap>>, + bootstrap: BootstrapState, relay: RelayState, shutdown: Controller, event_loop_config: EventLoopConfig, @@ -172,6 +180,7 @@ impl EventLoop { event_sender: UnboundedSender, shutdown: Controller, ) -> Self { + let bootstrap_interval = cfg.kademlia.bootstrap_period; let relay_nodes = cfg.relays.iter().map(Into::into).collect(); Self { @@ -191,6 +200,9 @@ impl EventLoop { is_fat_client, kad_record_ttl: TimeToLive(cfg.kademlia.kad_record_ttl), }, + bootstrap: BootstrapState { + timer: interval_at(Instant::now() + bootstrap_interval, bootstrap_interval), + }, kad_mode: cfg.kademlia.operation_mode.into(), } } @@ -225,6 +237,7 @@ impl EventLoop { break; }, }, + _ = self.bootstrap.timer.tick() => self.handle_periodic_bootstraps(), _ = report_timer.tick() => { debug!("Events per {}s: {:.2}", event_counter.duration_secs(), event_counter.count_events()); event_counter.reset_counter(); @@ -408,7 +421,6 @@ impl EventLoop { protocols, .. }, - connection_id: _, } => { trace!( "Identity Received from: {peer_id:?} on listen address: {listen_addrs:?}" @@ -446,20 +458,13 @@ impl EventLoop { self.swarm.behaviour_mut().kademlia.remove_peer(&peer_id); } }, - identify::Event::Sent { - peer_id, - connection_id: _, - } => { + identify::Event::Sent { peer_id } => { trace!("Identity Sent event to: {peer_id:?}"); }, identify::Event::Pushed { peer_id, .. } => { trace!("Identify Pushed event. PeerId: {peer_id:?}"); }, - identify::Event::Error { - peer_id, - error, - connection_id: _, - } => { + identify::Event::Error { peer_id, error } => { trace!("Identify Error event. PeerId: {peer_id:?}. Error: {error:?}"); }, }, @@ -654,6 +659,10 @@ impl EventLoop { } } + fn handle_periodic_bootstraps(&mut self) { + _ = self.swarm.behaviour_mut().kademlia.bootstrap(); + } + fn select_and_dial_relay(&mut self) { // select a random relay from the list of known ones self.relay.select_random(); diff --git a/core/src/network/p2p/kad_mem_store.rs b/core/src/network/p2p/kad_mem_store.rs index d95c3d144..b99cf9564 100644 --- a/core/src/network/p2p/kad_mem_store.rs +++ b/core/src/network/p2p/kad_mem_store.rs @@ -143,7 +143,7 @@ impl RecordStore for MemoryStore { } fn add_provider(&mut self, record: ProviderRecord) -> Result<()> { - self.providers.add_provider(self.local_key, record) + self.providers.add_provider(self.local_key.clone(), record) } fn providers(&self, key: &RecordKey) -> Vec { diff --git a/core/src/network/p2p/kad_rocksdb_store.rs b/core/src/network/p2p/kad_rocksdb_store.rs index b84d03bba..8ef9c53d4 100644 --- a/core/src/network/p2p/kad_rocksdb_store.rs +++ b/core/src/network/p2p/kad_rocksdb_store.rs @@ -227,7 +227,7 @@ impl RecordStore for RocksDBStore { } fn add_provider(&mut self, record: ProviderRecord) -> Result<()> { - self.providers.add_provider(self.local_key, record) + self.providers.add_provider(self.local_key.clone(), record) } fn providers(&self, key: &RecordKey) -> Vec { diff --git a/core/src/network/rpc/client.rs b/core/src/network/rpc/client.rs index 85a0e1c5a..ae3896da2 100644 --- a/core/src/network/rpc/client.rs +++ b/core/src/network/rpc/client.rs @@ -435,7 +435,6 @@ impl Client { } break; } - } Err(err) => { warn!(error = %err, "Failed to create RPC Subscription stream."); diff --git a/relay/src/main.rs b/relay/src/main.rs index 0e1350ad6..a11ad7618 100644 --- a/relay/src/main.rs +++ b/relay/src/main.rs @@ -214,7 +214,6 @@ async fn run() -> Result<()> { observed_addr, .. }, - connection_id: _, } => { debug!("Identity Received from: {peer_id:?} on listen address: {listen_addrs:?}"); @@ -228,10 +227,7 @@ async fn run() -> Result<()> { }; }, - identify::Event::Sent { - peer_id, - connection_id: _, - } => { + identify::Event::Sent { peer_id } => { debug!("Identity Sent event to: {peer_id:?}"); },