diff --git a/CHANGELOG.md b/CHANGELOG.md index ec2cb49a3a9..a5d07418f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [2472](https://github.com/FuelLabs/fuel-core/pull/2472): Added the `amountU128` field to the `Balance` GraphQL schema, providing the total balance as a `U128`. The existing `amount` field clamps any balance exceeding `U64` to `u64::MAX`. - [2526](https://github.com/FuelLabs/fuel-core/pull/2526): Add possibility to not have any cache set for RocksDB. Add an option to either load the RocksDB columns families on creation of the database or when the column is used. - [2532](https://github.com/FuelLabs/fuel-core/pull/2532): Getters for inner rocksdb database handles. +- [2150](https://github.com/FuelLabs/fuel-core/pull/2150): Upgraded `libp2p` to `0.54.1` and introduced `ConnectionLimiter` to limit pending incoming/outgoing connections. ### Fixed - [2365](https://github.com/FuelLabs/fuel-core/pull/2365): Fixed the error during dry run in the case of race condition. diff --git a/Cargo.lock b/Cargo.lock index a797d35f850..f2a1c166694 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -242,7 +242,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -304,8 +304,8 @@ checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.3.0", - "futures-lite 2.5.0", + "fastrand", + "futures-lite", "slab", ] @@ -315,9 +315,9 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "async-lock 3.4.0", + "async-lock", "blocking", - "futures-lite 2.5.0", + "futures-lite", ] [[package]] @@ -328,10 +328,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.4.0", - "async-lock 3.4.0", + "async-io", + "async-lock", "blocking", - "futures-lite 2.5.0", + "futures-lite", "once_cell", ] @@ -381,7 +381,7 @@ dependencies = [ "proc-macro2", "quote", "strum 0.26.3", - "syn 2.0.95", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -409,54 +409,25 @@ dependencies = [ "serde_json", ] -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.28", - "slab", - "socket2 0.4.10", - "waker-fn", -] - [[package]] name = "async-io" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ - "async-lock 3.4.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.5.0", + "futures-lite", "parking", - "polling 3.7.4", - "rustix 0.38.43", + "polling", + "rustix", "slab", "tracing", "windows-sys 0.59.0", ] -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - [[package]] name = "async-lock" version = "3.4.0" @@ -474,9 +445,9 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 2.4.0", + "async-io", "blocking", - "futures-lite 2.5.0", + "futures-lite", ] [[package]] @@ -486,15 +457,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" dependencies = [ "async-channel 2.3.1", - "async-io 2.4.0", - "async-lock 3.4.0", + "async-io", + "async-lock", "async-signal", "async-task", "blocking", "cfg-if", "event-listener 5.4.0", - "futures-lite 2.5.0", - "rustix 0.38.43", + "futures-lite", + "rustix", "tracing", ] @@ -504,13 +475,13 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.4.0", - "async-lock 3.4.0", + "async-io", + "async-lock", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.43", + "rustix", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -524,13 +495,13 @@ checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" dependencies = [ "async-channel 1.9.0", "async-global-executor", - "async-io 2.4.0", - "async-lock 3.4.0", + "async-io", + "async-lock", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 2.5.0", + "futures-lite", "gloo-timers 0.3.0", "kv-log-macro", "log", @@ -561,7 +532,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -578,7 +549,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -663,7 +634,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -691,7 +662,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.3.0", + "fastrand", "hex", "http 0.2.12", "ring 0.17.8", @@ -729,14 +700,14 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.3.0", + "fastrand", "http 0.2.12", "http-body 0.4.6", "once_cell", "percent-encoding", "pin-project-lite", "tracing", - "uuid 1.11.0", + "uuid 1.11.1", ] [[package]] @@ -807,9 +778,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.54.0" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249b2acaa8e02fd4718705a9494e3eb633637139aa4bb09d70965b0448e865db" +checksum = "861d324ef69247c6f3c6823755f408a68877ffb1a9afaff6dd8b0057c760de60" dependencies = [ "aws-credential-types", "aws-runtime", @@ -912,7 +883,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.3.0", + "fastrand", "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", @@ -1225,7 +1196,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1282,9 +1253,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" dependencies = [ "serde", ] @@ -1337,7 +1308,7 @@ dependencies = [ "async-channel 2.3.1", "async-task", "futures-io", - "futures-lite 2.5.0", + "futures-lite", "piper", ] @@ -1460,9 +1431,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.7" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", @@ -1578,9 +1549,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.25" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95dca1b68188a08ca6af9d96a6576150f598824bdb528c1190460c2940a0b48" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -1588,9 +1559,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.25" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab52925392148efd3f7562f2136a81ffb778076bcc85727c6e020d6dd57cf15" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -1607,7 +1578,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2091,7 +2062,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "crossterm_winapi", "libc", "mio 0.8.11", @@ -2202,7 +2173,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2246,7 +2217,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.95", + "syn 2.0.96", "thiserror 1.0.69", ] @@ -2270,7 +2241,7 @@ dependencies = [ "cynic-codegen", "darling", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2294,7 +2265,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2305,7 +2276,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2340,7 +2311,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "uuid 1.11.0", + "uuid 1.11.1", ] [[package]] @@ -2398,7 +2369,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2418,7 +2389,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "unicode-xid", ] @@ -2535,7 +2506,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2638,7 +2609,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2729,7 +2700,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2749,7 +2720,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2769,7 +2740,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2924,7 +2895,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.95", + "syn 2.0.96", "toml 0.8.19", "walkdir", ] @@ -2942,7 +2913,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2968,7 +2939,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.95", + "syn 2.0.96", "tempfile", "thiserror 1.0.69", "tiny-keccak", @@ -3172,15 +3143,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -3305,7 +3267,7 @@ version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "122c27ab46707017063bf1c6e0b4f3de881e22e81b4059750a0dc95033d9cc26" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "fuel-types 0.56.0", "serde", "strum 0.24.1", @@ -3317,7 +3279,7 @@ version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "885617a606218680114122f4e1107ed5c9424e42dec05de84843e4a3a99e2cd7" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "fuel-types 0.59.1", "serde", "strum 0.24.1", @@ -3396,7 +3358,7 @@ dependencies = [ "tower 0.4.13", "tower-http 0.4.4", "tracing", - "uuid 1.11.0", + "uuid 1.11.1", ] [[package]] @@ -3724,7 +3686,7 @@ dependencies = [ "postcard", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "quick_cache", "rand", "rayon", @@ -4094,7 +4056,7 @@ checksum = "3f49fdbfc1615d88d2849650afc2b0ac2fecd69661ebadd31a073d8416747764" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -4106,7 +4068,7 @@ checksum = "8703ee10001e6a52ad9a0d8411ca5a92098de978ccfbdddd0ba185f3a7405b4c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -4181,7 +4143,7 @@ version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13aae44611588d199dd119e4a0ebd8eb7ae4cde6bf8b4d12715610b1f5e5b731" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "derivative", "derive_more 0.99.18", "fuel-asm 0.56.0", @@ -4203,7 +4165,7 @@ version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "806498d953bc989995425f1bb7c17890f5538a3664c6ec3b5d8a77c63d617421" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "derive_more 1.0.0", "educe", "fuel-asm 0.59.1", @@ -4251,7 +4213,7 @@ checksum = "64fc4695efac9207276f6229f2dd9811848b328a13604a698f7bce1d452bd986" dependencies = [ "async-trait", "backtrace", - "bitflags 2.6.0", + "bitflags 2.7.0", "derivative", "derive_more 0.99.18", "ethnum", @@ -4283,7 +4245,7 @@ dependencies = [ "anyhow", "async-trait", "backtrace", - "bitflags 2.6.0", + "bitflags 2.7.0", "derive_more 0.99.18", "educe", "ethnum", @@ -4377,26 +4339,11 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ - "fastrand 2.3.0", + "fastrand", "futures-core", "futures-io", "parking", @@ -4421,7 +4368,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4431,7 +4378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", ] @@ -4783,7 +4730,7 @@ dependencies = [ "ipnet", "once_cell", "rand", - "socket2 0.5.8", + "socket2", "thiserror 1.0.69", "tinyvec", "tokio", @@ -4978,7 +4925,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.8", + "socket2", "tokio", "tower-service", "tracing", @@ -5033,7 +4980,7 @@ dependencies = [ "http 1.2.0", "hyper 1.5.2", "hyper-util", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -5079,7 +5026,7 @@ dependencies = [ "http-body 1.0.1", "hyper 1.5.2", "pin-project-lite", - "socket2 0.5.8", + "socket2", "tokio", "tower-service", "tracing", @@ -5223,7 +5170,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5275,7 +5222,7 @@ version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ - "async-io 2.4.0", + "async-io", "core-foundation", "fnv", "futures", @@ -5348,7 +5295,7 @@ dependencies = [ "autocfg", "impl-tools-lib", "proc-macro-error2", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5360,7 +5307,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5371,7 +5318,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5451,17 +5398,6 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ip_network" version = "0.4.1" @@ -5474,7 +5410,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.8", + "socket2", "widestring", "windows-sys 0.48.0", "winreg", @@ -5556,9 +5492,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -5714,19 +5650,18 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libp2p" -version = "0.53.2" +version = "0.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" dependencies = [ "bytes", "either", "futures", "futures-timer", "getrandom", - "instant", "libp2p-allow-block-list", "libp2p-connection-limits", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-dns", "libp2p-gossipsub", "libp2p-identify", @@ -5750,11 +5685,11 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" dependencies = [ - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "void", @@ -5762,11 +5697,11 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" dependencies = [ - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "void", @@ -5800,16 +5735,44 @@ dependencies = [ "web-time", ] +[[package]] +name = "libp2p-core" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-identity", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot", + "pin-project", + "quick-protobuf", + "rand", + "rw-stream-sink", + "smallvec", + "thiserror 1.0.69", + "tracing", + "unsigned-varint 0.8.0", + "void", + "web-time", +] + [[package]] name = "libp2p-dns" -version = "0.41.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" +checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", "hickory-resolver", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "parking_lot", "smallvec", @@ -5818,12 +5781,12 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" +checksum = "b4e830fdf24ac8c444c12415903174d506e1e077fbe3875c404a78c5935a8543" dependencies = [ "asynchronous-codec 0.7.0", - "base64 0.21.7", + "base64 0.22.1", "byteorder", "bytes", "either", @@ -5832,38 +5795,38 @@ dependencies = [ "futures-ticker", "getrandom", "hex_fmt", - "instant", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand", "regex", "sha2 0.10.8", "smallvec", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-identify" -version = "0.44.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" +checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" dependencies = [ "asynchronous-codec 0.7.0", "either", "futures", "futures-bounded", "futures-timer", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "lru", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "smallvec", "thiserror 1.0.69", "tracing", @@ -5892,9 +5855,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.45.3" +version = "0.46.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" +checksum = "ced237d0bd84bbebb7c2cad4c073160dacb4fe40534963c32ed6d4c6bb7702a3" dependencies = [ "arrayvec", "asynchronous-codec 0.7.0", @@ -5904,12 +5867,11 @@ dependencies = [ "futures", "futures-bounded", "futures-timer", - "instant", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand", "sha2 0.10.8", "smallvec", @@ -5917,24 +5879,25 @@ dependencies = [ "tracing", "uint", "void", + "web-time", ] [[package]] name = "libp2p-mdns" -version = "0.45.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", "hickory-proto", "if-watch", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "rand", "smallvec", - "socket2 0.5.8", + "socket2", "tokio", "tracing", "void", @@ -5942,13 +5905,12 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" +checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" dependencies = [ "futures", - "instant", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-gossipsub", "libp2p-identify", "libp2p-identity", @@ -5956,6 +5918,7 @@ dependencies = [ "libp2p-swarm", "pin-project", "prometheus-client", + "web-time", ] [[package]] @@ -5967,7 +5930,7 @@ dependencies = [ "asynchronous-codec 0.6.2", "bytes", "futures", - "libp2p-core", + "libp2p-core 0.41.3", "libp2p-identity", "nohash-hasher", "parking_lot", @@ -5979,15 +5942,15 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +checksum = "36b137cb1ae86ee39f8e5d6245a296518912014eaa87427d24e6ff58cfc1b28c" dependencies = [ "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek", "futures", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "multiaddr", "multihash", @@ -6005,39 +5968,39 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67330af40b67217e746d42551913cfb7ad04c74fa300fb329660a56318590b3f" +checksum = "5b63d926c6be56a2489e0e7316b17fe95a70bc5c4f3e85740bb3e67c0f3c6a44" dependencies = [ - "asynchronous-codec 0.6.2", + "asynchronous-codec 0.7.0", "bytes", "futures", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "quick-protobuf", - "quick-protobuf-codec 0.2.0", + "quick-protobuf-codec", "tracing", ] [[package]] name = "libp2p-quic" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" +checksum = "46352ac5cd040c70e88e7ff8257a2ae2f891a4076abad2c439584a31c15fd24e" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-tls", "parking_lot", "quinn", "rand", "ring 0.17.8", - "rustls 0.23.20", - "socket2 0.5.8", + "rustls 0.23.21", + "socket2", "thiserror 1.0.69", "tokio", "tracing", @@ -6045,37 +6008,36 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.26.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" +checksum = "1356c9e376a94a75ae830c42cdaea3d4fe1290ba409a22c809033d1b7dcab0a6" dependencies = [ "async-trait", "futures", "futures-bounded", "futures-timer", - "instant", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm", "rand", "smallvec", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm" -version = "0.44.2" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" dependencies = [ "async-std", "either", "fnv", "futures", "futures-timer", - "instant", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-swarm-derive", "lru", @@ -6086,30 +6048,31 @@ dependencies = [ "tokio", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.34.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" +checksum = "206e0aa0ebe004d778d79fb0966aa0de996c19894e2c0605ba2f8524dd4443d8" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] name = "libp2p-swarm-test" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a73027f1bdabd15d08b2c7954911cd56a6265c476763b2ceb10d9dc5ea4366b2" +checksum = "ea4e1d1d92421dc4c90cad42e3cd24f50fd210191c9f126d41bd483a09567f67" dependencies = [ "async-trait", "futures", "futures-timer", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "libp2p-plaintext", "libp2p-swarm", @@ -6121,35 +6084,35 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +checksum = "ad964f312c59dcfcac840acd8c555de8403e295d39edf96f5240048b5fcaa314" dependencies = [ - "async-io 1.13.0", + "async-io", "futures", "futures-timer", "if-watch", "libc", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", - "socket2 0.5.8", + "socket2", "tokio", "tracing", ] [[package]] name = "libp2p-tls" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" +checksum = "47b23dddc2b9c355f73c1e36eb0c3ae86f7dc964a3715f0731cfad352db4d847" dependencies = [ "futures", "futures-rustls", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "rcgen", "ring 0.17.8", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-webpki 0.101.7", "thiserror 1.0.69", "x509-parser", @@ -6158,14 +6121,14 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" +checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" dependencies = [ "futures", "futures-timer", "igd-next", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-swarm", "tokio", "tracing", @@ -6174,14 +6137,14 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.43.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b953b6803a1f3161a989538974d72511c4e48a4af355337b6fb90723c56c05" +checksum = "888b2ff2e5d8dcef97283daab35ad1043d18952b65e05279eecbe02af4c6e347" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core", + "libp2p-core 0.42.0", "libp2p-identity", "parking_lot", "pin-project-lite", @@ -6195,13 +6158,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.45.2" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" +checksum = "788b61c80789dba9760d8c669a5bedb642c8267555c803fabd8396e4ca5c5882" dependencies = [ "either", "futures", - "libp2p-core", + "libp2p-core 0.42.0", "thiserror 1.0.69", "tracing", "yamux 0.12.1", @@ -6214,7 +6177,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", "redox_syscall 0.4.1", ] @@ -6225,7 +6188,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", ] @@ -6321,12 +6284,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -6385,7 +6342,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.8.5", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6483,7 +6440,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.43", + "rustix", ] [[package]] @@ -6704,7 +6661,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ - "async-io 2.4.0", + "async-io", "bytes", "futures", "libc", @@ -6735,7 +6692,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "libc", ] @@ -6746,7 +6703,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "cfg_aliases", "libc", @@ -6890,7 +6847,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -6992,9 +6949,9 @@ dependencies = [ [[package]] name = "ouroboros" -version = "0.18.4" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "944fa20996a25aded6b4795c6d63f10014a7a83f8be9828a11860b08c5fc4a67" +checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59" dependencies = [ "aliasable", "ouroboros_macro", @@ -7003,16 +6960,15 @@ dependencies = [ [[package]] name = "ouroboros_macro" -version = "0.18.4" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39b0deead1528fd0e5947a8546a9642a9777c25f6e1e26f34c97b204bbb465bd" +checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0" dependencies = [ "heck 0.4.1", - "itertools 0.12.1", "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7223,7 +7179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.10", + "thiserror 2.0.11", "ucd-trie", ] @@ -7247,7 +7203,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7311,7 +7267,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7349,7 +7305,7 @@ checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7371,7 +7327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.3.0", + "fastrand", "futures-io", ] @@ -7419,22 +7375,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - [[package]] name = "polling" version = "3.7.4" @@ -7445,7 +7385,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.43", + "rustix", "tracing", "windows-sys 0.59.0", ] @@ -7515,7 +7455,7 @@ dependencies = [ "smallvec", "symbolic-demangle", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -7586,12 +7526,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7649,9 +7589,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -7664,7 +7604,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "version_check", "yansi 1.0.1", ] @@ -7689,7 +7629,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7700,7 +7640,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set 0.8.0", "bit-vec 0.8.0", - "bitflags 2.6.0", + "bitflags 2.7.0", "lazy_static", "num-traits", "rand", @@ -7765,7 +7705,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7778,7 +7718,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -7875,19 +7815,6 @@ 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.69", - "unsigned-varint 0.7.2", -] - [[package]] name = "quick-protobuf-codec" version = "0.3.1" @@ -7925,9 +7852,9 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.0", - "rustls 0.23.20", - "socket2 0.5.8", - "thiserror 2.0.10", + "rustls 0.23.21", + "socket2", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -7943,10 +7870,10 @@ dependencies = [ "rand", "ring 0.17.8", "rustc-hash 2.1.0", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "slab", - "thiserror 2.0.10", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -7961,7 +7888,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.8", + "socket2", "tracing", "windows-sys 0.59.0", ] @@ -8026,7 +7953,7 @@ version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -8076,7 +8003,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -8113,7 +8040,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -8248,7 +8175,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -8459,30 +8386,16 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.37.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519165d378b97752ca44bbe15047d5d3409e875f39327546b42ac81d7e18c1b6" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", - "linux-raw-sys 0.4.15", + "linux-raw-sys", "windows-sys 0.59.0", ] @@ -8500,9 +8413,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "once_cell", "ring 0.17.8", @@ -8646,7 +8559,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -8760,7 +8673,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation", "core-foundation-sys", "libc", @@ -8830,7 +8743,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -8853,7 +8766,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -8904,7 +8817,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9028,13 +8941,13 @@ checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint", "num-traits", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", ] @@ -9083,12 +8996,12 @@ dependencies = [ "async-channel 2.3.1", "async-executor", "async-fs", - "async-io 2.4.0", - "async-lock 3.4.0", + "async-io", + "async-lock", "async-net", "async-process", "blocking", - "futures-lite 2.5.0", + "futures-lite", ] [[package]] @@ -9108,16 +9021,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.8" @@ -9240,7 +9143,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9251,7 +9154,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9304,7 +9207,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9317,7 +9220,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9383,7 +9286,7 @@ dependencies = [ "debugid", "memmap2", "stable_deref_trait", - "uuid 1.11.0", + "uuid 1.11.1", ] [[package]] @@ -9410,9 +9313,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -9442,7 +9345,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9462,7 +9365,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation", "system-configuration-sys 0.6.0", ] @@ -9515,10 +9418,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", - "fastrand 2.3.0", + "fastrand", "getrandom", "once_cell", - "rustix 0.38.43", + "rustix", "windows-sys 0.59.0", ] @@ -9655,7 +9558,7 @@ dependencies = [ "tokio", "tracing", "url", - "uuid 1.11.0", + "uuid 1.11.1", "walkdir", ] @@ -9715,7 +9618,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9726,7 +9629,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "test-case-core", ] @@ -9763,7 +9666,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9777,11 +9680,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.10", + "thiserror-impl 2.0.11", ] [[package]] @@ -9792,18 +9695,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9944,7 +9847,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.8", + "socket2", "tokio-macros", "windows-sys 0.52.0", ] @@ -9967,7 +9870,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -9996,7 +9899,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.20", + "rustls 0.23.21", "tokio", ] @@ -10131,7 +10034,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.13.4", - "socket2 0.5.8", + "socket2", "tokio", "tokio-stream", "tower 0.4.13", @@ -10200,7 +10103,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "futures-core", "futures-util", @@ -10258,7 +10161,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -10506,9 +10409,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" dependencies = [ "getrandom", ] @@ -10558,12 +10461,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -10591,34 +10488,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -10629,9 +10527,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10639,22 +10537,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-encoder" @@ -10672,7 +10573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ "ahash", - "bitflags 2.6.0", + "bitflags 2.7.0", "hashbrown 0.14.5", "indexmap 2.7.0", "semver", @@ -10697,7 +10598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe501caefeb9f7b15360bdd7e47ad96e20223846f1c7db485ae5820ba5acc3d2" dependencies = [ "anyhow", - "bitflags 2.6.0", + "bitflags 2.7.0", "bumpalo", "cc", "cfg-if", @@ -10714,7 +10615,7 @@ dependencies = [ "postcard", "psm", "rayon", - "rustix 0.38.43", + "rustix", "serde", "serde_derive", "smallvec", @@ -10752,7 +10653,7 @@ dependencies = [ "directories-next", "log", "postcard", - "rustix 0.38.43", + "rustix", "serde", "serde_derive", "sha2 0.10.8", @@ -10770,7 +10671,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -10869,7 +10770,7 @@ checksum = "a2bde986038b819bc43a21fef0610aeb47aabfe3ea09ca3533a7b81023b84ec6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -10886,9 +10787,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -11174,9 +11075,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -11379,7 +11280,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -11401,7 +11302,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -11421,7 +11322,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -11442,7 +11343,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -11464,7 +11365,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] diff --git a/bin/fuel-core/src/cli/run/p2p.rs b/bin/fuel-core/src/cli/run/p2p.rs index 98a9a33759c..2fbc660f442 100644 --- a/bin/fuel-core/src/cli/run/p2p.rs +++ b/bin/fuel-core/src/cli/run/p2p.rs @@ -321,8 +321,9 @@ impl P2PArgs { reserved_nodes: self.reserved_nodes, reserved_nodes_only_mode: self.reserved_nodes_only_mode, enable_mdns: self.enable_mdns, - max_peers_connected: self.max_peers_connected, - max_connections_per_peer: self.max_connections_per_peer, + max_discovery_peers_connected: self.max_peers_connected, + max_gossipsub_peers_connected: 100, + max_request_response_peers_connected: 100, allow_private_addresses: self.allow_private_addresses, random_walk, connection_idle_timeout: Some(Duration::from_secs( diff --git a/crates/keygen/Cargo.toml b/crates/keygen/Cargo.toml index a18a98e4fe0..2ab255389b9 100644 --- a/crates/keygen/Cargo.toml +++ b/crates/keygen/Cargo.toml @@ -14,5 +14,5 @@ description = "Create to create command line utilities for fuel-core key managem anyhow = { workspace = true } clap = { workspace = true, features = ["derive", "env"] } fuel-core-types = { workspace = true, features = ["alloc", "serde", "random"] } -libp2p-identity = { version = "0.2.4", features = ["secp256k1", "peerid"] } +libp2p-identity = { version = "0.2.9", features = ["secp256k1", "peerid"] } serde = { workspace = true, features = ["derive"] } diff --git a/crates/services/p2p/Cargo.toml b/crates/services/p2p/Cargo.toml index 158f16f836f..a4b2aed62b7 100644 --- a/crates/services/p2p/Cargo.toml +++ b/crates/services/p2p/Cargo.toml @@ -22,7 +22,7 @@ futures = { workspace = true } hex = { workspace = true } hickory-resolver = "0.24.1" ip_network = "0.4" -libp2p = { version = "0.53.2", default-features = false, features = [ +libp2p = { version = "0.54.1", default-features = false, features = [ "dns", "gossipsub", "identify", @@ -68,7 +68,7 @@ tracing-attributes = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } [dev-dependencies.libp2p-swarm-test] -version = "0.3.0" +version = "0.4.0" [features] test-helpers = ["fuel-core-types/test-helpers"] diff --git a/crates/services/p2p/src/behavior.rs b/crates/services/p2p/src/behavior.rs index 9fe58c5dec5..0a771d805c3 100644 --- a/crates/services/p2p/src/behavior.rs +++ b/crates/services/p2p/src/behavior.rs @@ -16,6 +16,10 @@ use crate::{ use fuel_core_types::fuel_types::BlockHeight; use libp2p::{ allow_block_list, + connection_limits::{ + self, + ConnectionLimits, + }, gossipsub::{ self, MessageAcceptance, @@ -35,6 +39,10 @@ use libp2p::{ PeerId, }; +const MAX_PENDING_INCOMING_CONNECTIONS: u32 = 100; +const MAX_PENDING_OUTGOING_CONNECTIONS: u32 = 100; +const MAX_ESTABLISHED_CONNECTIONS: u32 = 1000; + /// Handles all p2p protocols needed for Fuel. #[derive(NetworkBehaviour)] pub struct FuelBehaviour { @@ -60,10 +68,16 @@ pub struct FuelBehaviour { /// RequestResponse protocol request_response: request_response::Behaviour, + + /// The Behaviour to manage connection limits. + connection_limits: connection_limits::Behaviour, } impl FuelBehaviour { - pub(crate) fn new(p2p_config: &Config, codec: PostcardCodec) -> anyhow::Result { + pub(crate) fn new( + p2p_config: &Config, + codec: PostcardCodec, + ) -> anyhow::Result { let local_public_key = p2p_config.keypair.public(); let local_peer_id = PeerId::from_public_key(&local_public_key); @@ -73,7 +87,7 @@ impl FuelBehaviour { discovery_config .enable_mdns(p2p_config.enable_mdns) - .max_peers_connected(p2p_config.max_peers_connected as usize) + .max_peers_connected(p2p_config.max_discovery_peers_connected as usize) .with_bootstrap_nodes(p2p_config.bootstrap_nodes.clone()) .with_reserved_nodes(p2p_config.reserved_nodes.clone()) .enable_reserved_nodes_only_mode(p2p_config.reserved_nodes_only_mode); @@ -110,6 +124,13 @@ impl FuelBehaviour { BlockHeight::default(), ); + let connection_limits = connection_limits::Behaviour::new( + ConnectionLimits::default() + .with_max_pending_incoming(Some(MAX_PENDING_INCOMING_CONNECTIONS)) + .with_max_pending_outgoing(Some(MAX_PENDING_OUTGOING_CONNECTIONS)) + .with_max_established(Some(MAX_ESTABLISHED_CONNECTIONS)), + ); + let req_res_protocol = codec .get_req_res_protocols() .map(|protocol| (protocol, ProtocolSupport::Full)); @@ -133,6 +154,7 @@ impl FuelBehaviour { blocked_peer: Default::default(), identify, heartbeat, + connection_limits, }) } diff --git a/crates/services/p2p/src/config.rs b/crates/services/p2p/src/config.rs index 0cfad8c3647..a1c3b146362 100644 --- a/crates/services/p2p/src/config.rs +++ b/crates/services/p2p/src/config.rs @@ -96,10 +96,14 @@ pub struct Config { /// Max number of unique peers connected /// This number should be at least number of `mesh_n` from `Gossipsub` configuration. /// The total number of connections will be `(max_peers_connected + reserved_nodes.len()) * max_connections_per_peer` - pub max_peers_connected: u32, - /// Max number of connections per single peer - /// The total number of connections will be `(max_peers_connected + reserved_nodes.len()) * max_connections_per_peer` - pub max_connections_per_peer: u32, + pub max_discovery_peers_connected: u32, + + /// Max number of gossipsub peers + pub max_gossipsub_peers_connected: u32, + + /// Max number of request/response peers + pub max_request_response_peers_connected: u32, + /// The interval at which identification requests are sent to /// the remote on established connections after the first request pub identify_interval: Option, @@ -166,8 +170,10 @@ impl Config { max_txs_per_request: self.max_txs_per_request, bootstrap_nodes: self.bootstrap_nodes, enable_mdns: self.enable_mdns, - max_peers_connected: self.max_peers_connected, - max_connections_per_peer: self.max_connections_per_peer, + max_discovery_peers_connected: self.max_discovery_peers_connected, + max_gossipsub_peers_connected: self.max_gossipsub_peers_connected, + max_request_response_peers_connected: self + .max_request_response_peers_connected, allow_private_addresses: self.allow_private_addresses, random_walk: self.random_walk, connection_idle_timeout: self.connection_idle_timeout, @@ -218,8 +224,9 @@ impl Config { max_txs_per_request: MAX_TXS_PER_REQUEST, bootstrap_nodes: vec![], enable_mdns: false, - max_peers_connected: 50, - max_connections_per_peer: 3, + max_discovery_peers_connected: 50, + max_gossipsub_peers_connected: 50, + max_request_response_peers_connected: 50, allow_private_addresses: true, random_walk: Some(Duration::from_millis(500)), connection_idle_timeout: Some(Duration::from_secs(120)), diff --git a/crates/services/p2p/src/discovery.rs b/crates/services/p2p/src/discovery.rs index e41d228883d..db6e594a2a0 100644 --- a/crates/services/p2p/src/discovery.rs +++ b/crates/services/p2p/src/discovery.rs @@ -1,7 +1,10 @@ use self::mdns_wrapper::MdnsWrapper; use futures::FutureExt; use libp2p::{ - core::Endpoint, + core::{ + transport::PortUse, + Endpoint, + }, kad::{ self, store::MemoryStore, @@ -125,12 +128,14 @@ impl NetworkBehaviour for Behaviour { peer: PeerId, addr: &Multiaddr, role_override: Endpoint, + port_use: PortUse, ) -> Result, ConnectionDenied> { self.kademlia.handle_established_outbound_connection( connection_id, peer, addr, role_override, + port_use, ) } diff --git a/crates/services/p2p/src/discovery/discovery_config.rs b/crates/services/p2p/src/discovery/discovery_config.rs index 3500938f4d1..0f54a2a57ed 100644 --- a/crates/services/p2p/src/discovery/discovery_config.rs +++ b/crates/services/p2p/src/discovery/discovery_config.rs @@ -113,10 +113,10 @@ impl Config { // kademlia setup let memory_store = MemoryStore::new(local_peer_id.to_owned()); - let mut kademlia_config = kad::Config::default(); let network = format!("/fuel/kad/{network_name}/kad/1.0.0"); - kademlia_config - .set_protocol_names(vec![StreamProtocol::try_from_owned(network)?]); + let kademlia_config = kad::Config::new( + StreamProtocol::try_from_owned(network).expect("Invalid kad protocol"), + ); let mut kademlia = kad::Behaviour::with_config(local_peer_id, memory_store, kademlia_config); diff --git a/crates/services/p2p/src/discovery/mdns_wrapper.rs b/crates/services/p2p/src/discovery/mdns_wrapper.rs index 2b38b703759..af2a440ba40 100644 --- a/crates/services/p2p/src/discovery/mdns_wrapper.rs +++ b/crates/services/p2p/src/discovery/mdns_wrapper.rs @@ -1,6 +1,9 @@ use crate::Multiaddr; use libp2p::{ - core::Endpoint, + core::{ + transport::PortUse, + Endpoint, + }, mdns::{ self, tokio::Behaviour as TokioMdns, @@ -107,6 +110,7 @@ impl NetworkBehaviour for MdnsWrapper { peer: PeerId, addr: &Multiaddr, role_override: Endpoint, + port_use: PortUse, ) -> Result, ConnectionDenied> { match self { MdnsWrapper::Ready(mdns) => mdns.handle_established_outbound_connection( @@ -114,6 +118,7 @@ impl NetworkBehaviour for MdnsWrapper { peer, addr, role_override, + port_use, ), MdnsWrapper::Disabled => Ok(dummy::ConnectionHandler), } diff --git a/crates/services/p2p/src/heartbeat.rs b/crates/services/p2p/src/heartbeat.rs index 5e0f4d4544a..e38ea87099d 100644 --- a/crates/services/p2p/src/heartbeat.rs +++ b/crates/services/p2p/src/heartbeat.rs @@ -7,7 +7,10 @@ use handler::{ HeartbeatOutEvent, }; use libp2p::{ - core::Endpoint, + core::{ + transport::PortUse, + Endpoint, + }, swarm::{ derive_prelude::ConnectionId, ConnectionDenied, @@ -104,6 +107,7 @@ impl NetworkBehaviour for Behaviour { _peer: PeerId, _addr: &Multiaddr, _role_override: Endpoint, + _port_use: PortUse, ) -> Result, ConnectionDenied> { Ok(HeartbeatHandler::new(self.config.clone())) } diff --git a/crates/services/p2p/src/lib.rs b/crates/services/p2p/src/lib.rs index 375eeb7351c..a4c923ff223 100644 --- a/crates/services/p2p/src/lib.rs +++ b/crates/services/p2p/src/lib.rs @@ -17,6 +17,7 @@ pub mod service; mod utils; mod cached_view; +pub mod sized_hashset; pub use gossipsub::config as gossipsub_config; pub use heartbeat::Config; diff --git a/crates/services/p2p/src/p2p_service.rs b/crates/services/p2p/src/p2p_service.rs index 5de17783af6..8750bcd369f 100644 --- a/crates/services/p2p/src/p2p_service.rs +++ b/crates/services/p2p/src/p2p_service.rs @@ -34,6 +34,7 @@ use crate::{ ResponseSender, V2ResponseMessage, }, + sized_hashset::SizedHashset, TryPeerId, }; use fuel_core_metrics::{ @@ -121,10 +122,10 @@ pub struct FuelP2PService { /// to the peer that requested it. inbound_requests_table: HashMap>, - /// NetworkCodec used as `` for encoding and decoding of Gossipsub messages + /// NetworkCodec used as `` for encoding and decoding of Gossipsub messages network_codec: PostcardCodec, - /// Stores additional p2p network info + /// Stores additional p2p network info network_metadata: NetworkMetadata, /// Whether or not metrics collection is enabled @@ -135,6 +136,12 @@ pub struct FuelP2PService { /// Holds peers' information, and manages existing connections peer_manager: PeerManager, + + /// Connection Limiter for gossipsub + gossipsub_peer_limiter: SizedHashset, + + /// Connection Limiter for request_response + request_response_peer_limiter: SizedHashset, } #[derive(Debug)] @@ -226,7 +233,7 @@ impl FuelP2PService { // configure and build P2P Service let (transport_function, connection_state) = build_transport_function(&config); - let tcp_config = tcp::Config::new().port_reuse(true); + let tcp_config = tcp::Config::new(); let behaviour = FuelBehaviour::new(&config, codec.clone())?; let swarm_builder = SwarmBuilder::with_existing_identity(config.keypair.clone()) @@ -290,6 +297,12 @@ impl FuelP2PService { network_codec: codec, outbound_requests_table: HashMap::default(), inbound_requests_table: HashMap::default(), + gossipsub_peer_limiter: SizedHashset::new( + config.max_gossipsub_peers_connected as usize, + ), + request_response_peer_limiter: SizedHashset::new( + config.max_request_response_peers_connected as usize, + ), network_metadata, metrics, libp2p_metrics_registry, @@ -297,7 +310,7 @@ impl FuelP2PService { reserved_peers_updates, reserved_peers, connection_state, - config.max_peers_connected as usize, + config.max_discovery_peers_connected as usize, ), }) } @@ -534,6 +547,12 @@ impl FuelP2PService { ); None } + SwarmEvent::ConnectionClosed { peer_id, .. } => { + // clean up the peer from the limiters + self.gossipsub_peer_limiter.remove(peer_id); + self.request_response_peer_limiter.remove(peer_id); + None + } _ => { self.update_libp2p_metrics(&event); None @@ -593,6 +612,10 @@ impl FuelP2PService { message, message_id, } => { + if !self.gossipsub_peer_limiter.insert(propagation_source) { + return None; + } + let correct_topic = self.get_topic_tag(&message.topic)?; match self.network_codec.decode(&message.data, correct_topic) { Ok(decoded_message) => Some(FuelP2PEvent::GossipsubMessage { @@ -614,9 +637,16 @@ impl FuelP2PService { } } gossipsub::Event::Subscribed { peer_id, topic } => { + if !self.gossipsub_peer_limiter.insert(peer_id) { + return None; + } let tag = self.get_topic_tag(&topic)?; Some(FuelP2PEvent::NewSubscription { peer_id, tag }) } + gossipsub::Event::Unsubscribed { peer_id, .. } => { + self.gossipsub_peer_limiter.remove(peer_id); + None + } _ => None, } } @@ -649,99 +679,117 @@ impl FuelP2PService { event: request_response::Event, ) -> Option { match event { - request_response::Event::Message { peer, message } => match message { - request_response::Message::Request { - request, - channel, - request_id, - } => { - self.inbound_requests_table.insert(request_id, channel); - - return Some(FuelP2PEvent::InboundRequestMessage { - request_id, - request_message: request, - }); + request_response::Event::Message { peer, message } => { + // We only clean up the limiter *after* the peer disconnects + // This is to ensure that the req/res protocol has a stable + // connection to the peer for the duration of the connection + // If a peer receives None, it will try a different peer for the same request + if !self.request_response_peer_limiter.insert(peer) { + return None; } - request_response::Message::Response { - request_id, - response, - } => { - let Some(channel) = self.outbound_requests_table.remove(&request_id) - else { - debug!("Send channel not found for {:?}", request_id); - return None; - }; - let send_ok = match channel { - ResponseSender::SealedHeaders(c) => match response { - V2ResponseMessage::SealedHeaders(v) => { - c.send(Ok((peer, Ok(v)))).is_ok() - } - _ => { - warn!( - "Invalid response type received for request {:?}", - request_id - ); - c.send(Ok((peer, Err(ResponseError::TypeMismatch)))) - .is_ok() - } - }, - ResponseSender::Transactions(c) => match response { - V2ResponseMessage::Transactions(v) => { - c.send(Ok((peer, Ok(v)))).is_ok() - } - _ => { - warn!( - "Invalid response type received for request {:?}", - request_id - ); - c.send(Ok((peer, Err(ResponseError::TypeMismatch)))) - .is_ok() - } - }, - ResponseSender::TransactionsFromPeer(c) => match response { - V2ResponseMessage::Transactions(v) => { - c.send((peer, Ok(v))).is_ok() - } - _ => { - warn!( - "Invalid response type received for request {:?}", - request_id - ); - c.send((peer, Err(ResponseError::TypeMismatch))).is_ok() - } - }, - ResponseSender::TxPoolAllTransactionsIds(c) => match response { - V2ResponseMessage::TxPoolAllTransactionsIds(v) => { - c.send((peer, Ok(v))).is_ok() - } - _ => { - warn!( - "Invalid response type received for request {:?}", - request_id - ); - c.send((peer, Err(ResponseError::TypeMismatch))).is_ok() - } - }, - ResponseSender::TxPoolFullTransactions(c) => match response { - V2ResponseMessage::TxPoolFullTransactions(v) => { - c.send((peer, Ok(v))).is_ok() - } - _ => { - warn!( - "Invalid response type received for request {:?}", - request_id - ); - c.send((peer, Err(ResponseError::TypeMismatch))).is_ok() - } - }, - }; + match message { + request_response::Message::Request { + request, + channel, + request_id, + } => { + self.inbound_requests_table.insert(request_id, channel); - if !send_ok { - warn!("Failed to send through the channel for {:?}", request_id); + return Some(FuelP2PEvent::InboundRequestMessage { + request_id, + request_message: request, + }); + } + request_response::Message::Response { + request_id, + response, + } => { + let Some(channel) = + self.outbound_requests_table.remove(&request_id) + else { + debug!("Send channel not found for {:?}", request_id); + return None; + }; + + let send_ok = match channel { + ResponseSender::SealedHeaders(c) => match response { + V2ResponseMessage::SealedHeaders(v) => { + c.send(Ok((peer, Ok(v)))).is_ok() + } + _ => { + warn!( + "Invalid response type received for request {:?}", + request_id + ); + c.send(Ok((peer, Err(ResponseError::TypeMismatch)))) + .is_ok() + } + }, + ResponseSender::Transactions(c) => match response { + V2ResponseMessage::Transactions(v) => { + c.send(Ok((peer, Ok(v)))).is_ok() + } + _ => { + warn!( + "Invalid response type received for request {:?}", + request_id + ); + c.send(Ok((peer, Err(ResponseError::TypeMismatch)))) + .is_ok() + } + }, + ResponseSender::TransactionsFromPeer(c) => match response { + V2ResponseMessage::Transactions(v) => { + c.send((peer, Ok(v))).is_ok() + } + _ => { + warn!( + "Invalid response type received for request {:?}", + request_id + ); + c.send((peer, Err(ResponseError::TypeMismatch))) + .is_ok() + } + }, + ResponseSender::TxPoolAllTransactionsIds(c) => match response + { + V2ResponseMessage::TxPoolAllTransactionsIds(v) => { + c.send((peer, Ok(v))).is_ok() + } + _ => { + warn!( + "Invalid response type received for request {:?}", + request_id + ); + c.send((peer, Err(ResponseError::TypeMismatch))) + .is_ok() + } + }, + ResponseSender::TxPoolFullTransactions(c) => match response { + V2ResponseMessage::TxPoolFullTransactions(v) => { + c.send((peer, Ok(v))).is_ok() + } + _ => { + warn!( + "Invalid response type received for request {:?}", + request_id + ); + c.send((peer, Err(ResponseError::TypeMismatch))) + .is_ok() + } + }, + }; + + if !send_ok { + warn!( + "Failed to send through the channel for {:?}", + request_id + ); + } } } - }, + } request_response::Event::InboundFailure { peer, error, @@ -786,7 +834,7 @@ impl FuelP2PService { fn handle_identify_event(&mut self, event: identify::Event) -> Option { match event { - identify::Event::Received { peer_id, info } => { + identify::Event::Received { peer_id, info, .. } => { self.update_metrics(increment_unique_peers); let mut addresses = info.listen_addrs; @@ -814,8 +862,12 @@ impl FuelP2PService { } identify::Event::Sent { .. } => {} identify::Event::Pushed { .. } => {} - identify::Event::Error { peer_id, error } => { - debug!(target: "fuel-p2p", "Identification with peer {:?} failed => {}", peer_id, error); + identify::Event::Error { + connection_id, + peer_id, + error, + } => { + debug!(target: "fuel-p2p", "Identification with peer {:?} with connection id {:?} failed => {}", peer_id, connection_id, error); } } None @@ -994,7 +1046,7 @@ mod tests { let mut sentry_node = { let mut p2p_config = p2p_config.clone(); - p2p_config.max_peers_connected = max_peers_allowed as u32; + p2p_config.max_discovery_peers_connected = max_peers_allowed as u32; p2p_config.bootstrap_nodes = bootstrap_multiaddrs; @@ -1109,7 +1161,7 @@ mod tests { // this node is allowed to only connect to `node_a_max_peers_allowed` other nodes let mut node_a = { let mut p2p_config = p2p_config.clone(); - p2p_config.max_peers_connected = node_a_max_peers_allowed as u32; + p2p_config.max_discovery_peers_connected = node_a_max_peers_allowed as u32; // it still tries to dial all nodes! p2p_config.bootstrap_nodes.clone_from(&nodes_multiaddrs); @@ -1119,7 +1171,7 @@ mod tests { // this node is allowed to only connect to `node_b_max_peers_allowed` other nodes let mut node_b = { let mut p2p_config = p2p_config.clone(); - p2p_config.max_peers_connected = node_b_max_peers_allowed as u32; + p2p_config.max_discovery_peers_connected = node_b_max_peers_allowed as u32; // it still tries to dial all nodes! p2p_config.bootstrap_nodes.clone_from(&nodes_multiaddrs); @@ -1432,6 +1484,7 @@ mod tests { Transaction::default_test_tx(), )), GossipsubMessageAcceptance::Accept, + None, ), ) .await @@ -1450,6 +1503,7 @@ mod tests { Transaction::default_test_tx(), )), GossipsubMessageAcceptance::Reject, + None, ), ) .await @@ -1581,9 +1635,14 @@ mod tests { async fn gossipsub_broadcast( broadcast_request: GossipsubBroadcastRequest, acceptance: GossipsubMessageAcceptance, + connection_limit: Option, ) { let mut p2p_config = Config::default_initialized("gossipsub_exchanges_messages"); + if let Some(connection_limit) = connection_limit { + p2p_config.max_gossipsub_peers_connected = connection_limit; + } + let selected_topic: Sha256Topic = { let topic = match broadcast_request { GossipsubBroadcastRequest::NewTx(_) => NEW_TX_GOSSIP_TOPIC, @@ -1717,9 +1776,16 @@ mod tests { && a.entity.consensus() == b.entity.consensus() } - async fn request_response_works_with(request_msg: RequestMessage) { + async fn request_response_works_with( + request_msg: RequestMessage, + connection_limit: Option, + ) { let mut p2p_config = Config::default_initialized("request_response_works_with"); + if let Some(connection_limit) = connection_limit { + p2p_config.max_request_response_peers_connected = connection_limit; + } + // Node A let mut node_a = build_service_from_config(p2p_config.clone()).await; @@ -1902,20 +1968,22 @@ mod tests { #[instrument] async fn request_response_works_with_transactions() { let arbitrary_range = 2..6; - request_response_works_with(RequestMessage::Transactions(arbitrary_range)).await + request_response_works_with(RequestMessage::Transactions(arbitrary_range), None) + .await } #[tokio::test] #[instrument] async fn request_response_works_with_sealed_headers_range_inclusive() { let arbitrary_range = 2..6; - request_response_works_with(RequestMessage::SealedHeaders(arbitrary_range)).await + request_response_works_with(RequestMessage::SealedHeaders(arbitrary_range), None) + .await } #[tokio::test] #[instrument] async fn request_response_works_with_transactions_ids() { - request_response_works_with(RequestMessage::TxPoolAllTransactionsIds).await + request_response_works_with(RequestMessage::TxPoolAllTransactionsIds, None).await } #[tokio::test] @@ -1924,7 +1992,8 @@ mod tests { let tx_ids = (0..10) .map(|_| Transaction::default_test_tx().id(&ChainId::new(1))) .collect(); - request_response_works_with(RequestMessage::TxPoolFullTransactions(tx_ids)).await + request_response_works_with(RequestMessage::TxPoolFullTransactions(tx_ids), None) + .await } /// We send a request for transactions, but it's responded by only headers @@ -2103,4 +2172,35 @@ mod tests { }; } } + + #[tokio::test] + async fn gossipsub_peer_limit_works() { + tokio::time::timeout( + Duration::from_secs(5), + gossipsub_broadcast( + GossipsubBroadcastRequest::NewTx(Arc::new( + Transaction::default_test_tx(), + )), + GossipsubMessageAcceptance::Accept, + Some(1) // limit to 1 peer, therefore the function will timeout, as it will not be able to propagate the message + ), + ) + .await.expect_err("Should have timed out"); + } + + #[tokio::test] + async fn request_response_peer_limit_works() { + let handle = tokio::spawn(async { + let arbitrary_range = 2..6; + + request_response_works_with( + RequestMessage::Transactions(arbitrary_range), + Some(0), // limit to 0 peers, + ) + .await; + }); + + let result = handle.await; + assert!(result.is_err()); + } } diff --git a/crates/services/p2p/src/peer_report.rs b/crates/services/p2p/src/peer_report.rs index 00442db3151..6aa0c1dfaa0 100644 --- a/crates/services/p2p/src/peer_report.rs +++ b/crates/services/p2p/src/peer_report.rs @@ -4,7 +4,10 @@ use crate::{ }; use libp2p::{ self, - core::Endpoint, + core::{ + transport::PortUse, + Endpoint, + }, swarm::{ derive_prelude::{ ConnectionClosed, @@ -128,6 +131,7 @@ impl NetworkBehaviour for Behaviour { _peer: PeerId, _addr: &Multiaddr, _role_override: Endpoint, + _port_use: PortUse, ) -> Result, ConnectionDenied> { Ok(dummy::ConnectionHandler) } diff --git a/crates/services/p2p/src/sized_hashset.rs b/crates/services/p2p/src/sized_hashset.rs new file mode 100644 index 00000000000..d5edd96371d --- /dev/null +++ b/crates/services/p2p/src/sized_hashset.rs @@ -0,0 +1,34 @@ +use std::{ + collections::HashSet, + hash::Hash, +}; + +pub struct SizedHashset { + capacity: usize, + inner: HashSet, +} + +impl SizedHashset +where + T: Eq + Hash, +{ + pub fn new(capacity: usize) -> Self { + Self { + capacity, + inner: HashSet::new(), + } + } + + pub fn insert(&mut self, k: T) -> bool { + if self.inner.len() >= self.capacity && !self.inner.contains(&k) { + false + } else { + self.inner.insert(k); + true + } + } + + pub fn remove(&mut self, k: T) { + self.inner.remove(&k); + } +} diff --git a/version-compatibility/forkless-upgrade/Cargo.toml b/version-compatibility/forkless-upgrade/Cargo.toml index 0792f3c6fc7..835ffcd7859 100644 --- a/version-compatibility/forkless-upgrade/Cargo.toml +++ b/version-compatibility/forkless-upgrade/Cargo.toml @@ -9,7 +9,7 @@ build = "build.rs" [dev-dependencies] anyhow = "1.0" clap = "4.4" -libp2p = "0.53.2" +libp2p = "0.54.1" hex = "0.4.3" rand = "0.8" tempfile = "3.4"