From 69a9e6b17dc38a8f054dfc691cd4341243aae161 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jul 2024 14:39:14 -0500 Subject: [PATCH] chore: update anemo and quinn (#18800) --- Cargo.lock | 145 ++++++++---------- Cargo.toml | 17 +- .../core/src/network/connection_monitor.rs | 4 +- crates/sui-network/src/state_sync/server.rs | 4 +- narwhal/network/src/connectivity.rs | 4 +- scripts/simtest/cargo-simtest | 4 +- scripts/simtest/config-patch | 4 +- 7 files changed, 84 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ca737b463380..3d2e77e5b25e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,7 +160,7 @@ dependencies = [ [[package]] name = "anemo" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ "anyhow", "async-trait", @@ -169,17 +169,17 @@ dependencies = [ "ed25519 1.5.3", "futures", "hex", - "http 0.2.9", + "http 1.1.0", "matchit 0.5.0", "pin-project-lite", "pkcs8 0.9.0", - "quinn 0.10.1", - "quinn-proto 0.10.5", + "quinn", + "quinn-proto", "rand 0.8.5", - "rcgen", - "ring 0.16.20", - "rustls 0.21.12", - "rustls-webpki 0.101.7", + "rcgen 0.13.1", + "ring 0.17.3", + "rustls 0.23.12", + "rustls-webpki 0.102.6", "serde", "serde_json", "socket2 0.5.6", @@ -208,18 +208,18 @@ dependencies = [ [[package]] name = "anemo-build" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ - "prettyplease 0.1.25", + "prettyplease 0.2.17", "proc-macro2 1.0.78", "quote 1.0.35", - "syn 1.0.107", + "syn 2.0.48", ] [[package]] name = "anemo-cli" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ "anemo", "anemo-tower", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "anemo-tower" version = "0.0.0" -source = "git+https://github.com/mystenlabs/anemo.git?rev=26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7#26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" +source = "git+https://github.com/mystenlabs/anemo.git?rev=dbb5a074c2d25660525ab5d36d65ff0cb8051949#dbb5a074c2d25660525ab5d36d65ff0cb8051949" dependencies = [ "anemo", "bytes", @@ -1855,7 +1855,7 @@ dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.48", ] @@ -2668,7 +2668,7 @@ dependencies = [ "parking_lot 0.12.1", "prometheus", "prost 0.12.3", - "quinn-proto 0.10.5", + "quinn-proto", "rand 0.8.5", "rstest", "rustls 0.21.12", @@ -6114,7 +6114,7 @@ dependencies = [ "jsonrpsee-types", "parking_lot 0.12.1", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "soketto", @@ -6133,7 +6133,7 @@ dependencies = [ "hyper-rustls 0.23.2", "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "thiserror", @@ -6205,7 +6205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.2", - "pem", + "pem 1.1.0", "ring 0.16.20", "serde", "serde_json", @@ -7543,7 +7543,7 @@ dependencies = [ [[package]] name = "msim" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=291cebe772727338f474a020e094b4ecb7ba1fe9#291cebe772727338f474a020e094b4ecb7ba1fe9" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=220f52a15804a768610ac0ae3b8da7de4a5c4d2b#220f52a15804a768610ac0ae3b8da7de4a5c4d2b" dependencies = [ "ahash 0.7.6", "async-task", @@ -7572,7 +7572,7 @@ dependencies = [ [[package]] name = "msim-macros" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=291cebe772727338f474a020e094b4ecb7ba1fe9#291cebe772727338f474a020e094b4ecb7ba1fe9" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=220f52a15804a768610ac0ae3b8da7de4a5c4d2b#220f52a15804a768610ac0ae3b8da7de4a5c4d2b" dependencies = [ "darling 0.14.2", "proc-macro2 1.0.78", @@ -7873,7 +7873,7 @@ dependencies = [ "narwhal-types", "parking_lot 0.12.1", "prometheus", - "quinn-proto 0.10.5", + "quinn-proto", "rand 0.8.5", "sui-macros", "tokio", @@ -9168,6 +9168,16 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.6.0" @@ -9896,24 +9906,6 @@ dependencies = [ "serde", ] -[[package]] -name = "quinn" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21252f1c0fc131f1b69182db8f34837e8a69737b8251dff75636a9be0518c324" -dependencies = [ - "bytes", - "futures-io", - "pin-project-lite", - "quinn-proto 0.10.5", - "quinn-udp 0.4.0", - "rustc-hash", - "rustls 0.21.12", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "quinn" version = "0.11.2" @@ -9921,43 +9913,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", + "futures-io", "pin-project-lite", - "quinn-proto 0.11.3", - "quinn-udp 0.5.4", - "rustc-hash", + "quinn-proto", + "quinn-udp", + "rustc-hash 1.1.0", "rustls 0.23.12", "thiserror", "tokio", "tracing", ] -[[package]] -name = "quinn-proto" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.12", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - [[package]] name = "quinn-proto" version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +source = "git+https://github.com/quinn-rs/quinn.git?rev=f0fa66f871b80b9d2d7075d76967c649aecc0b77#f0fa66f871b80b9d2d7075d76967c649aecc0b77" dependencies = [ "bytes", "rand 0.8.5", "ring 0.17.3", - "rustc-hash", + "rustc-hash 2.0.0", "rustls 0.23.12", "slab", "thiserror", @@ -9965,19 +9940,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "quinn-udp" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df19e284d93757a9fb91d63672f7741b129246a669db09d1c0063071debc0c0" -dependencies = [ - "bytes", - "libc", - "socket2 0.5.6", - "tracing", - "windows-sys 0.48.0", -] - [[package]] name = "quinn-udp" version = "0.5.4" @@ -10167,12 +10129,25 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ - "pem", + "pem 1.1.0", "ring 0.16.20", "time", "yasna", ] +[[package]] +name = "rcgen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +dependencies = [ + "pem 3.0.4", + "ring 0.17.3", + "rustls-pki-types", + "time", + "yasna", +] + [[package]] name = "readonly" version = "0.2.3" @@ -10363,7 +10338,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn 0.11.2", + "quinn", "rustls 0.23.12", "rustls-native-certs 0.7.1", "rustls-pemfile 2.1.2", @@ -10799,6 +10774,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -14499,7 +14480,7 @@ dependencies = [ "fastcrypto", "pkcs8 0.9.0", "rand 0.8.5", - "rcgen", + "rcgen 0.9.3", "reqwest 0.12.5", "rustls 0.21.12", "rustls-webpki 0.101.7", @@ -15328,7 +15309,7 @@ dependencies = [ "once_cell", "pbkdf2 0.11.0", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "sha2 0.10.6", "thiserror", "unicode-normalization", @@ -16015,7 +15996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -16990,9 +16971,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yasna" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ "bit-vec", "num-bigint 0.4.4", diff --git a/Cargo.toml b/Cargo.toml index 6d46fb2c803e0..eae984ca47082 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -377,8 +377,8 @@ moka = { version = "0.12", default-features = false, features = [ "atomic64", ] } more-asserts = "0.3.1" -msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9", package = "msim" } -msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9", package = "msim-macros" } +msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b", package = "msim" } +msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b", package = "msim-macros" } multiaddr = "0.17.0" nexlint = { git = "https://github.com/nextest-rs/nexlint.git", rev = "94da5c787636dad779c340affa65219134d127f5" } nexlint-lints = { git = "https://github.com/nextest-rs/nexlint.git", rev = "94da5c787636dad779c340affa65219134d127f5" } @@ -409,7 +409,7 @@ prost = "0.12.3" prost-build = "0.12.3" protobuf = { version = "2.28", features = ["with-bytes"] } protobuf-src = "1.1.0" -quinn-proto = "^0.10.5" +quinn-proto = "0.11" quote = "1.0.23" rand = "0.8.5" rayon = "1.5.3" @@ -577,10 +577,10 @@ coset = "0.3" p256 = { version = "0.13.2", features = ["ecdsa"] } # anemo dependencies -anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } -anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } -anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } -anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" } +anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-build = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-cli = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } +anemo-tower = { git = "https://github.com/mystenlabs/anemo.git", rev = "dbb5a074c2d25660525ab5d36d65ff0cb8051949" } # core-types with json format for REST api sui-sdk2 = { package = "sui-sdk", git = "https://github.com/mystenlabs/sui-rust-sdk.git", rev = "9a125ed5764fb5bcc1acb6074064bc8f9ea85b38", features = ["hash", "serde", "schemars"] } @@ -703,3 +703,6 @@ field_names = "0.2.0" semver = "1.0.16" spinners = "4.1.0" include_dir = "0.7.3" + +[patch.crates-io] +quinn-proto = { git = "https://github.com/quinn-rs/quinn.git", rev = "f0fa66f871b80b9d2d7075d76967c649aecc0b77" } diff --git a/consensus/core/src/network/connection_monitor.rs b/consensus/core/src/network/connection_monitor.rs index 2baa3f46044cf..928fc8b41a040 100644 --- a/consensus/core/src/network/connection_monitor.rs +++ b/consensus/core/src/network/connection_monitor.rs @@ -248,11 +248,11 @@ impl AnemoConnectionMonitor { self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, hostname, "transmitted"]) - .set(stats.udp_tx.transmits as i64); + .set(stats.udp_tx.ios as i64); self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, hostname, "received"]) - .set(stats.udp_rx.transmits as i64); + .set(stats.udp_rx.ios as i64); } } diff --git a/crates/sui-network/src/state_sync/server.rs b/crates/sui-network/src/state_sync/server.rs index 03288d04ba1db..f7e24b5a5202f 100644 --- a/crates/sui-network/src/state_sync/server.rs +++ b/crates/sui-network/src/state_sync/server.rs @@ -224,7 +224,9 @@ where struct SemaphoreExtension(OwnedSemaphorePermit); inner.call(req).await.map(move |mut response| { // Insert permit as extension so it's not dropped until the response is sent. - response.extensions_mut().insert(SemaphoreExtension(permit)); + response + .extensions_mut() + .insert(Arc::new(SemaphoreExtension(permit))); response }) }; diff --git a/narwhal/network/src/connectivity.rs b/narwhal/network/src/connectivity.rs index 1304840004c48..dbd9e9526f8bb 100644 --- a/narwhal/network/src/connectivity.rs +++ b/narwhal/network/src/connectivity.rs @@ -243,11 +243,11 @@ impl ConnectionMonitor { self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, "transmitted"]) - .set(stats.udp_tx.transmits as i64); + .set(stats.udp_tx.ios as i64); self.connection_metrics .network_peer_udp_transmits .with_label_values(&[peer_id, "received"]) - .set(stats.udp_rx.transmits as i64); + .set(stats.udp_rx.ios as i64); } } diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index 836f5c71e6e0b..2c591c251d653 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -54,9 +54,9 @@ if [ -n "$LOCAL_MSIM_PATH" ]; then else cargo_patch_args=( --config 'patch.crates-io.tokio.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.tokio.rev = "291cebe772727338f474a020e094b4ecb7ba1fe9"' + --config 'patch.crates-io.tokio.rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b"' --config 'patch.crates-io.futures-timer.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.futures-timer.rev = "291cebe772727338f474a020e094b4ecb7ba1fe9"' + --config 'patch.crates-io.futures-timer.rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b"' ) fi diff --git a/scripts/simtest/config-patch b/scripts/simtest/config-patch index 97e158ea047a3..e4dfa3c59b31a 100644 --- a/scripts/simtest/config-patch +++ b/scripts/simtest/config-patch @@ -18,5 +18,5 @@ index c0829bc1b6..4007f97d66 100644 include_dir = "0.7.3" + +[patch.crates-io] -+tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9" } -+futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "291cebe772727338f474a020e094b4ecb7ba1fe9" } ++tokio = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b" } ++futures-timer = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "220f52a15804a768610ac0ae3b8da7de4a5c4d2b" }