From 755281d340e8bb8f7152fe2e0acc5492bb58fab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:29:15 +0200 Subject: [PATCH 1/8] udp protocol: test that parsing slices of various lengths doesn't panic --- crates/udp_protocol/src/request.rs | 41 +++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/crates/udp_protocol/src/request.rs b/crates/udp_protocol/src/request.rs index 1b8cb430..0b85f38c 100644 --- a/crates/udp_protocol/src/request.rs +++ b/crates/udp_protocol/src/request.rs @@ -90,12 +90,22 @@ impl Request { let remaining_bytes = { let position = bytes.position() as usize; let inner = bytes.into_inner(); + + // Slice will be empty if position == inner.len() &inner[position..] }; + if remaining_bytes.is_empty() { + return Err(RequestParseError::sendable_text( + "Full scrapes are not allowed", + connection_id, + transaction_id, + )) + } + let info_hashes = FromBytes::slice_from(remaining_bytes).ok_or_else(|| { RequestParseError::sendable_text( - "Invalid info hash list. Note that full scrapes are not allowed", + "Invalid info hash list", connection_id, transaction_id, ) @@ -371,4 +381,33 @@ mod tests { TestResult::from_bool(same_after_conversion(request.into())) } + + #[test] + fn test_various_input_lengths() { + for action in 0i32..4 { + for max_scrape_torrents in 0..3 { + for num_bytes in 0..256 { + let mut request_bytes = ::std::iter::repeat(0).take(num_bytes).collect::>(); + + if let Some(action_bytes) = request_bytes.get_mut(8..12) { + action_bytes.copy_from_slice(&action.to_be_bytes()) + } + + // Should never panic + let _ = Request::parse_bytes(&request_bytes, max_scrape_torrents); + } + } + } + } + + #[test] + fn test_scrape_request_with_no_info_hashes() { + let mut request_bytes = Vec::new(); + + request_bytes.extend(0i64.to_be_bytes()); + request_bytes.extend(2i32.to_be_bytes()); + request_bytes.extend(0i32.to_be_bytes()); + + Request::parse_bytes(&request_bytes, 1).unwrap_err(); + } } From f061c47ef896d7eee6c77c628c940a760b8cf575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:30:23 +0200 Subject: [PATCH 2/8] Run cargo update Updating allocator-api2 v0.2.16 -> v0.2.18 Updating anstream v0.6.13 -> v0.6.14 Updating anstyle v1.0.6 -> v1.0.7 Updating anstyle-parse v0.2.3 -> v0.2.4 Updating anstyle-query v1.0.2 -> v1.0.3 Updating anstyle-wincon v3.0.2 -> v3.0.3 Updating anyhow v1.0.81 -> v1.0.82 Updating autocfg v1.2.0 -> v1.3.0 Updating aws-lc-rs v1.7.0 -> v1.7.1 Updating aws-lc-sys v0.15.0 -> v0.16.0 Updating base64 v0.22.0 -> v0.22.1 Updating cc v1.0.92 -> v1.0.96 Updating colorchoice v1.0.0 -> v1.0.1 Updating data-encoding v2.5.0 -> v2.6.0 Updating either v1.10.0 -> v1.11.0 Updating fastrand v2.0.2 -> v2.1.0 Updating flate2 v1.0.28 -> v1.0.30 Updating hashbrown v0.14.3 -> v0.14.5 Updating humanize-bytes v1.0.5 -> v1.0.6 Updating io-uring v0.6.3 -> v0.6.4 Adding is_terminal_polyfill v1.70.0 Updating libc v0.2.153 -> v0.2.154 Updating libmimalloc-sys v0.1.35 -> v0.1.37 Updating lock_api v0.4.11 -> v0.4.12 Updating mimalloc v0.1.39 -> v0.1.41 Updating parking_lot v0.12.1 -> v0.12.2 Updating parking_lot_core v0.9.9 -> v0.9.10 Updating quote v1.0.35 -> v1.0.36 Updating raw-cpuid v11.0.1 -> v11.0.2 Updating redox_syscall v0.4.1 -> v0.5.1 Updating rustix v0.38.32 -> v0.38.34 Updating rustls-pki-types v1.4.1 -> v1.5.0 Updating rustls-webpki v0.102.2 -> v0.102.3 Updating serde v1.0.197 -> v1.0.200 Updating serde_derive v1.0.197 -> v1.0.200 Updating serde_json v1.0.115 -> v1.0.116 Updating signal-hook-registry v1.4.1 -> v1.4.2 Updating simd-json v0.13.9 -> v0.13.10 Updating socket2 v0.5.6 -> v0.5.7 Updating thiserror v1.0.58 -> v1.0.59 Updating thiserror-impl v1.0.58 -> v1.0.59 Updating time v0.3.34 -> v0.3.36 Updating time-macros v0.2.17 -> v0.2.18 Updating toml_edit v0.22.9 -> v0.22.12 Updating winapi-util v0.1.6 -> v0.1.8 Updating windows-targets v0.52.4 -> v0.52.5 Updating windows_aarch64_gnullvm v0.52.4 -> v0.52.5 Updating windows_aarch64_msvc v0.52.4 -> v0.52.5 Updating windows_i686_gnu v0.52.4 -> v0.52.5 Adding windows_i686_gnullvm v0.52.5 Updating windows_i686_msvc v0.52.4 -> v0.52.5 Updating windows_x86_64_gnu v0.52.4 -> v0.52.5 Updating windows_x86_64_gnullvm v0.52.4 -> v0.52.5 Updating windows_x86_64_msvc v0.52.4 -> v0.52.5 Updating winnow v0.6.5 -> v0.6.7 --- Cargo.lock | 285 ++++++++++++++++++++++++++++------------------------- 1 file changed, 150 insertions(+), 135 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44c4de2c..35711459 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anes" @@ -64,47 +64,48 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -112,9 +113,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "aquatic" @@ -158,7 +159,7 @@ dependencies = [ "arc-swap", "duplicate", "git-testament", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hwloc", "indexmap 2.2.6", @@ -210,7 +211,7 @@ dependencies = [ "serde", "signal-hook", "slotmap", - "socket2 0.5.6", + "socket2 0.5.7", "thiserror", ] @@ -226,7 +227,7 @@ dependencies = [ "futures-lite", "futures-rustls", "glommio", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "log", "mimalloc", "quickcheck", @@ -305,7 +306,7 @@ dependencies = [ "crossbeam-channel", "crossbeam-utils", "getrandom", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hdrhistogram", "hex", "io-uring", @@ -322,7 +323,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2 0.5.6", + "socket2 0.5.7", "tempfile", "time", "tinytemplate", @@ -344,7 +345,7 @@ dependencies = [ "rand", "rand_distr", "serde", - "socket2 0.5.6", + "socket2 0.5.7", ] [[package]] @@ -376,7 +377,7 @@ dependencies = [ "futures-lite", "futures-rustls", "glommio", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "httparse", "indexmap 2.2.6", "log", @@ -393,7 +394,7 @@ dependencies = [ "signal-hook", "slab", "slotmap", - "socket2 0.5.6", + "socket2 0.5.7", "tungstenite", ] @@ -427,7 +428,7 @@ version = "0.8.0" dependencies = [ "anyhow", "criterion 0.5.1", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "quickcheck", "quickcheck_macros", "serde", @@ -480,15 +481,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-lc-rs" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5509d663b2c00ee421bda8d6a24d6c42e15970957de1701b8df9f6fbe5707df1" +checksum = "8487b59d62764df8231cb371c459314df895b41756df457a1fb1243d65c89195" dependencies = [ "aws-lc-sys", "mirai-annotations", @@ -498,9 +499,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5d317212c2a78d86ba6622e969413c38847b62f48111f8b763af3dac2f9840" +checksum = "c15eb61145320320eb919d9bab524617a7aa4216c78d342fae3a758bc33073e4" dependencies = [ "bindgen", "cc", @@ -534,9 +535,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bendy" @@ -666,12 +667,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.92" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -799,9 +801,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "compact_str" @@ -986,9 +988,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "deranged" @@ -1039,9 +1041,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "enclose" @@ -1113,15 +1115,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1412,7 +1414,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -1424,9 +1426,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -1537,9 +1539,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humanize-bytes" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8f5a0ffae64f844e5e311016d1d8184dd496c7136af420f665a877ac2f0681" +checksum = "0a92093c50b761e6ba595c797365301d3aaae67db1382ddf9d5d0092d98df799" dependencies = [ "smartstring", ] @@ -1593,7 +1595,7 @@ dependencies = [ "http-body", "hyper", "pin-project-lite", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tower", "tower-service", @@ -1627,7 +1629,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1656,9 +1658,9 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9febecd4aebbe9c7c23c8e536e966805fdf09944c8a915e7991ee51acb67087" +checksum = "595a0399f411a508feb2ec1e970a4a30c249351e30208960d58298de8660b0e5" dependencies = [ "bitflags 1.3.2", "libc", @@ -1681,6 +1683,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -1811,9 +1819,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libloading" @@ -1822,7 +1830,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1833,9 +1841,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libmimalloc-sys" -version = "0.1.35" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3979b5c37ece694f1f5e51e7ecc871fdb0f517ed04ee45f88d15d6d553cb9664" +checksum = "81eb4061c0582dedea1cbc7aff2240300dd6982e0239d1c99e65c1dbf4a30ba7" dependencies = [ "cc", "libc", @@ -1849,9 +1857,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1912,7 +1920,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d58e362dc7206e9456ddbcdbd53c71ba441020e62104703075a69151e38d85f" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "http-body-util", "hyper", "hyper-util", @@ -1935,7 +1943,7 @@ dependencies = [ "aho-corasick", "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "indexmap 2.2.6", "metrics", "num_cpus", @@ -1947,9 +1955,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.39" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa01922b5ea280a911e323e4d2fd24b7fe5cc4042e0d2cda3c40775cdc4bdc9c" +checksum = "9f41a2280ded0da56c8cf898babb86e8f10651a34adcfff190ae9a1159c6908d" dependencies = [ "libmimalloc-sys", ] @@ -2175,9 +2183,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -2185,15 +2193,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -2394,9 +2402,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2453,9 +2461,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" dependencies = [ "bitflags 2.5.0", ] @@ -2482,11 +2490,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] @@ -2576,9 +2584,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno 0.3.8", @@ -2608,21 +2616,21 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "aws-lc-rs", "ring", @@ -2665,9 +2673,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] @@ -2693,9 +2701,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", @@ -2704,9 +2712,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -2751,18 +2759,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "simd-json" -version = "0.13.9" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b84c23a1066e1d650ebc99aa8fb9f8ed0ab96fd36e2e836173c92fc9fb29bc" +checksum = "570c430b3d902ea083097e853263ae782dfe40857d93db019a12356c8e8143fa" dependencies = [ "getrandom", "halfbrown", @@ -2872,9 +2880,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2936,7 +2944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.2", + "fastrand 2.1.0", "rustix", "windows-sys 0.52.0", ] @@ -2958,18 +2966,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", @@ -2978,9 +2986,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -3001,9 +3009,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -3046,7 +3054,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.6", + "socket2 0.5.7", "windows-sys 0.48.0", ] @@ -3096,9 +3104,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" dependencies = [ "indexmap 2.2.6", "serde", @@ -3409,11 +3417,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] @@ -3437,7 +3445,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -3457,17 +3465,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -3478,9 +3487,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -3490,9 +3499,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -3502,9 +3511,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -3514,9 +3529,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -3526,9 +3541,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -3538,9 +3553,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -3550,15 +3565,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" dependencies = [ "memchr", ] From 7795a1a532c03e6e279667d364cc27755ddf2b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:38:25 +0200 Subject: [PATCH 3/8] Make mimalloc optional for udp and http --- crates/http/Cargo.toml | 10 ++++++++-- crates/http/src/main.rs | 1 + crates/udp/Cargo.toml | 10 ++++++++-- crates/udp/src/main.rs | 1 + crates/ws/Cargo.toml | 4 +++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/crates/http/Cargo.toml b/crates/http/Cargo.toml index 5cbd14d5..e1d7f4f6 100644 --- a/crates/http/Cargo.toml +++ b/crates/http/Cargo.toml @@ -18,9 +18,13 @@ name = "aquatic_http" name = "aquatic_http" [features] -default = ["prometheus"] +default = ["prometheus", "mimalloc"] prometheus = ["aquatic_common/prometheus", "metrics", "dep:metrics-util"] metrics = ["dep:metrics"] +# Use mimalloc allocator for much better performance. +# +# Requires cmake and a C compiler +mimalloc = ["dep:mimalloc"] [dependencies] aquatic_common = { workspace = true, features = ["rustls"] } @@ -40,7 +44,6 @@ httparse = "1" itoa = "1" libc = "0.2" log = "0.4" -mimalloc = { version = "0.1", default-features = false } memchr = "2" privdrop = "0.5" once_cell = "1" @@ -56,6 +59,9 @@ thiserror = "1" metrics = { version = "0.22", optional = true } metrics-util = { version = "0.16", optional = true } +# mimalloc feature +mimalloc = { version = "0.1", default-features = false, optional = true } + [dev-dependencies] quickcheck = "1" quickcheck_macros = "1" diff --git a/crates/http/src/main.rs b/crates/http/src/main.rs index 7f40c2c0..bbea5513 100644 --- a/crates/http/src/main.rs +++ b/crates/http/src/main.rs @@ -1,6 +1,7 @@ use aquatic_common::cli::run_app_with_cli_and_config; use aquatic_http::config::Config; +#[cfg(feature = "mimalloc")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/crates/udp/Cargo.toml b/crates/udp/Cargo.toml index 47cfa06e..d873087a 100644 --- a/crates/udp/Cargo.toml +++ b/crates/udp/Cargo.toml @@ -18,13 +18,17 @@ name = "aquatic_udp" name = "aquatic_udp" [features] -default = ["prometheus"] +default = ["prometheus", "mimalloc"] # Export prometheus metrics prometheus = ["metrics", "aquatic_common/prometheus"] # Experimental io_uring support (Linux 6.0 or later required) io-uring = ["dep:io-uring"] # Experimental CPU pinning support cpu-pinning = ["aquatic_common/cpu-pinning"] +# Use mimalloc allocator for much better performance. +# +# Requires cmake and a C compiler +mimalloc = ["dep:mimalloc"] [dependencies] aquatic_common.workspace = true @@ -45,7 +49,6 @@ hdrhistogram = "7" hex = "0.4" libc = "0.2" log = "0.4" -mimalloc = { version = "0.1", default-features = false } mio = { version = "0.8", features = ["net", "os-poll"] } num-format = "0.4" parking_lot = "0.12" @@ -63,6 +66,9 @@ metrics = { version = "0.22", optional = true } # io-uring feature io-uring = { version = "0.6", optional = true } +# mimalloc feature +mimalloc = { version = "0.1", default-features = false, optional = true } + [dev-dependencies] tempfile = "3" quickcheck = "1" diff --git a/crates/udp/src/main.rs b/crates/udp/src/main.rs index 9ec75cc8..7dab6646 100644 --- a/crates/udp/src/main.rs +++ b/crates/udp/src/main.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "mimalloc")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/crates/ws/Cargo.toml b/crates/ws/Cargo.toml index 59bb1bc4..064bea02 100644 --- a/crates/ws/Cargo.toml +++ b/crates/ws/Cargo.toml @@ -44,7 +44,6 @@ hashbrown = { version = "0.14", features = ["serde"] } httparse = "1" indexmap = "2" log = "0.4" -mimalloc = { version = "0.1", default-features = false, optional = true } privdrop = "0.5" rand = { version = "0.8", features = ["small_rng"] } rustls = "0.23" @@ -60,6 +59,9 @@ tungstenite = "0.21" metrics = { version = "0.22", optional = true } metrics-util = { version = "0.16", optional = true } +# mimalloc feature +mimalloc = { version = "0.1", default-features = false, optional = true } + [dev-dependencies] quickcheck = "1" quickcheck_macros = "1" From 215a22c95b995b6bcd7eb9694e02f75ba56b5733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:38:47 +0200 Subject: [PATCH 4/8] Run cargo fmt --- crates/udp_protocol/src/request.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/udp_protocol/src/request.rs b/crates/udp_protocol/src/request.rs index 0b85f38c..ad28a685 100644 --- a/crates/udp_protocol/src/request.rs +++ b/crates/udp_protocol/src/request.rs @@ -100,7 +100,7 @@ impl Request { "Full scrapes are not allowed", connection_id, transaction_id, - )) + )); } let info_hashes = FromBytes::slice_from(remaining_bytes).ok_or_else(|| { @@ -387,7 +387,8 @@ mod tests { for action in 0i32..4 { for max_scrape_torrents in 0..3 { for num_bytes in 0..256 { - let mut request_bytes = ::std::iter::repeat(0).take(num_bytes).collect::>(); + let mut request_bytes = + ::std::iter::repeat(0).take(num_bytes).collect::>(); if let Some(action_bytes) = request_bytes.get_mut(8..12) { action_bytes.copy_from_slice(&action.to_be_bytes()) From 19df20e03ffddcaa7473c05b092b074829bbc64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:49:20 +0200 Subject: [PATCH 5/8] Fully remove udp cpu pinning support --- crates/udp/Cargo.toml | 2 -- crates/udp_load_test/src/lib.rs | 18 ------------------ 2 files changed, 20 deletions(-) diff --git a/crates/udp/Cargo.toml b/crates/udp/Cargo.toml index d873087a..d6176c76 100644 --- a/crates/udp/Cargo.toml +++ b/crates/udp/Cargo.toml @@ -23,8 +23,6 @@ default = ["prometheus", "mimalloc"] prometheus = ["metrics", "aquatic_common/prometheus"] # Experimental io_uring support (Linux 6.0 or later required) io-uring = ["dep:io-uring"] -# Experimental CPU pinning support -cpu-pinning = ["aquatic_common/cpu-pinning"] # Use mimalloc allocator for much better performance. # # Requires cmake and a C compiler diff --git a/crates/udp_load_test/src/lib.rs b/crates/udp_load_test/src/lib.rs index fced2ca6..83fe463b 100644 --- a/crates/udp_load_test/src/lib.rs +++ b/crates/udp_load_test/src/lib.rs @@ -5,8 +5,6 @@ use std::sync::{atomic::Ordering, Arc}; use std::thread::{self, Builder}; use std::time::{Duration, Instant}; -#[cfg(feature = "cpu-pinning")] -use aquatic_common::cpu_pinning::{pin_current_if_configured_to, WorkerIndex}; use aquatic_common::IndexMap; use aquatic_udp_protocol::{InfoHash, Port}; use crossbeam_channel::{unbounded, Receiver}; @@ -67,26 +65,10 @@ pub fn run(config: Config) -> ::anyhow::Result<()> { let statistics_sender = statistics_sender.clone(); Builder::new().name("load-test".into()).spawn(move || { - #[cfg(feature = "cpu-pinning")] - pin_current_if_configured_to( - &config.cpu_pinning, - config.workers as usize, - 0, - WorkerIndex::SocketWorker(i as usize), - ); - Worker::run(config, state, statistics_sender, peers, addr) })?; } - #[cfg(feature = "cpu-pinning")] - pin_current_if_configured_to( - &config.cpu_pinning, - config.workers as usize, - 0, - WorkerIndex::Util, - ); - monitor_statistics(state, &config, statistics_receiver); Ok(()) From 67210fbb10fceabd9aa3e96ae794da4fbbdc98c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:51:19 +0200 Subject: [PATCH 6/8] Fix some README typos --- crates/http/README.md | 2 +- crates/udp/README.md | 2 +- crates/ws/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/http/README.md b/crates/http/README.md index 219792f9..8fa800e0 100644 --- a/crates/http/README.md +++ b/crates/http/README.md @@ -87,7 +87,7 @@ After starting the tracker, run the load tester: ```sh . ./scripts/env-native-cpu-without-avx-512 # Optional -cargo build --release -p aquatic_http_load_test -- --help +cargo run --release -p aquatic_http_load_test -- --help ``` ## Details diff --git a/crates/udp/README.md b/crates/udp/README.md index d8abbf93..39776fc4 100644 --- a/crates/udp/README.md +++ b/crates/udp/README.md @@ -76,7 +76,7 @@ After starting the tracker, run the load tester: ```sh . ./scripts/env-native-cpu-without-avx-512 # Optional -cargo build --release -p aquatic_udp_load_test -- --help +cargo run --release -p aquatic_udp_load_test -- --help ``` ## Details diff --git a/crates/ws/README.md b/crates/ws/README.md index ae5a34b9..6e718663 100644 --- a/crates/ws/README.md +++ b/crates/ws/README.md @@ -91,7 +91,7 @@ After starting the tracker, run the load tester: ```sh . ./scripts/env-native-cpu-without-avx-512 # Optional -cargo build --release -p aquatic_ws_load_test -- --help +cargo run --release -p aquatic_ws_load_test -- --help ``` ## Details From 9cd5b1bcc3ec48a187f83ae76bac42bfe67ededd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:54:36 +0200 Subject: [PATCH 7/8] Fix GitHub CI feature flag issue --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e45e1f92..91ffc693 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,15 +17,13 @@ jobs: - uses: actions/checkout@v3 - name: Install latest stable Rust uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install libhwloc-dev -y - name: Setup Rust dependency caching uses: Swatinem/rust-cache@v2 - name: Build run: | - cargo build --verbose -p aquatic_udp --features "cpu-pinning" + cargo build --verbose -p aquatic_udp cargo build --verbose -p aquatic_http - cargo build --verbose -p aquatic_ws --features "prometheus" + cargo build --verbose -p aquatic_ws build-macos: runs-on: macos-latest @@ -46,8 +44,6 @@ jobs: - uses: actions/checkout@v3 - name: Install latest stable Rust uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install libhwloc-dev -y - name: Setup Rust dependency caching uses: Swatinem/rust-cache@v2 - name: Run tests From 194169803749f2bd3cd617ff94b585ef0bb68883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 3 May 2024 22:55:01 +0200 Subject: [PATCH 8/8] Release v0.9.0 --- CHANGELOG.md | 2 +- Cargo.lock | 30 +++++++++++++++--------------- Cargo.toml | 24 ++++++++++++------------ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bbeec81..d1529bb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 0.9.0 - 2024-04-03 ### General diff --git a/Cargo.lock b/Cargo.lock index 35711459..8fbd2ef4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,7 +119,7 @@ checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "aquatic" -version = "0.8.0" +version = "0.9.0" dependencies = [ "aquatic_common", "aquatic_http", @@ -130,7 +130,7 @@ dependencies = [ [[package]] name = "aquatic_bencher" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_udp", @@ -151,7 +151,7 @@ dependencies = [ [[package]] name = "aquatic_common" -version = "0.8.0" +version = "0.9.0" dependencies = [ "ahash 0.8.11", "anyhow", @@ -180,7 +180,7 @@ dependencies = [ [[package]] name = "aquatic_http" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_common", @@ -217,7 +217,7 @@ dependencies = [ [[package]] name = "aquatic_http_load_test" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_common", @@ -240,7 +240,7 @@ dependencies = [ [[package]] name = "aquatic_http_protocol" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "bendy", @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "aquatic_peer_id" -version = "0.8.0" +version = "0.9.0" dependencies = [ "compact_str", "hex", @@ -272,7 +272,7 @@ dependencies = [ [[package]] name = "aquatic_toml_config" -version = "0.8.0" +version = "0.9.0" dependencies = [ "aquatic_toml_config_derive", "quickcheck", @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "aquatic_toml_config_derive" -version = "0.8.0" +version = "0.9.0" dependencies = [ "proc-macro2", "quote", @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "aquatic_udp" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_common", @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "aquatic_udp_load_test" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_common", @@ -350,7 +350,7 @@ dependencies = [ [[package]] name = "aquatic_udp_protocol" -version = "0.8.0" +version = "0.9.0" dependencies = [ "aquatic_peer_id", "byteorder", @@ -363,7 +363,7 @@ dependencies = [ [[package]] name = "aquatic_ws" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_common", @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "aquatic_ws_load_test" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "aquatic_common", @@ -424,7 +424,7 @@ dependencies = [ [[package]] name = "aquatic_ws_protocol" -version = "0.8.0" +version = "0.9.0" dependencies = [ "anyhow", "criterion 0.5.1", diff --git a/Cargo.toml b/Cargo.toml index fe59e92c..20c1bd6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.8.0" +version = "0.9.0" authors = ["Joakim FrostegÄrd "] edition = "2021" license = "Apache-2.0" @@ -28,17 +28,17 @@ readme = "./README.md" rust-version = "1.64" [workspace.dependencies] -aquatic_common = { version = "0.8.0", path = "./crates/common" } -aquatic_http_protocol = { version = "0.8.0", path = "./crates/http_protocol" } -aquatic_http = { version = "0.8.0", path = "./crates/http" } -aquatic_peer_id = { version = "0.8.0", path = "./crates/peer_id" } -aquatic_toml_config = { version = "0.8.0", path = "./crates/toml_config" } -aquatic_toml_config_derive = { version = "0.8.0", path = "./crates/toml_config_derive" } -aquatic_udp_protocol = { version = "0.8.0", path = "./crates/udp_protocol" } -aquatic_udp = { version = "0.8.0", path = "./crates/udp" } -aquatic_udp_load_test = { version = "0.8.0", path = "./crates/udp_load_test" } -aquatic_ws_protocol = { version = "0.8.0", path = "./crates/ws_protocol" } -aquatic_ws = { version = "0.8.0", path = "./crates/ws" } +aquatic_common = { version = "0.9.0", path = "./crates/common" } +aquatic_http_protocol = { version = "0.9.0", path = "./crates/http_protocol" } +aquatic_http = { version = "0.9.0", path = "./crates/http" } +aquatic_peer_id = { version = "0.9.0", path = "./crates/peer_id" } +aquatic_toml_config = { version = "0.9.0", path = "./crates/toml_config" } +aquatic_toml_config_derive = { version = "0.9.0", path = "./crates/toml_config_derive" } +aquatic_udp_protocol = { version = "0.9.0", path = "./crates/udp_protocol" } +aquatic_udp = { version = "0.9.0", path = "./crates/udp" } +aquatic_udp_load_test = { version = "0.9.0", path = "./crates/udp_load_test" } +aquatic_ws_protocol = { version = "0.9.0", path = "./crates/ws_protocol" } +aquatic_ws = { version = "0.9.0", path = "./crates/ws" } [profile.release] debug = false