diff --git a/Cargo.Bazel.lock b/Cargo.Bazel.lock index 0ed5dd7f1..284416da0 100644 --- a/Cargo.Bazel.lock +++ b/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "7a9aa96b6d31f919eab3d394e6a709320b6fc922ef8948a393e4af1a40bc3cbb", + "checksum": "f489637eb29f8ee955d6f7a7b93fccf6d868effc11c11a3eed989ac48731dcc3", "crates": { "actix-codec 0.5.2": { "name": "actix-codec", @@ -2558,6 +2558,13 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "default", + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -7475,10 +7482,37 @@ ], "crate_features": { "common": [ - "default", "std" ], - "selects": {} + "selects": { + "aarch64-unknown-linux-gnu": [ + "default" + ], + "arm-unknown-linux-gnueabi": [ + "default" + ], + "armv7-unknown-linux-gnueabi": [ + "default" + ], + "i686-unknown-freebsd": [ + "default" + ], + "i686-unknown-linux-gnu": [ + "default" + ], + "powerpc-unknown-linux-gnu": [ + "default" + ], + "s390x-unknown-linux-gnu": [ + "default" + ], + "x86_64-unknown-freebsd": [ + "default" + ], + "x86_64-unknown-linux-gnu": [ + "default" + ] + } }, "deps": { "common": [ @@ -9751,7 +9785,7 @@ "target": "ic_base_types" }, { - "id": "itertools 0.12.1", + "id": "itertools 0.13.0", "target": "itertools" }, { @@ -11304,7 +11338,7 @@ "target": "ic_types" }, { - "id": "itertools 0.12.1", + "id": "itertools 0.13.0", "target": "itertools" }, { @@ -12660,6 +12694,13 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "parking", + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -12767,6 +12808,12 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "std" + ], + "selects": {} + }, "deps": { "common": [ { @@ -16925,13 +16972,13 @@ }, "license": null }, - "ic-agent 0.34.0": { + "ic-agent 0.35.0": { "name": "ic-agent", - "version": "0.34.0", + "version": "0.35.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/ic-agent/0.34.0/download", - "sha256": "555eda283b8ba1a996d44d80b6c9a6d38a6cbb81797a7b7bbee134fdde64ce48" + "url": "https://static.crates.io/crates/ic-agent/0.35.0/download", + "sha256": "8f08d1b54f1834fb9637a57855f1d87bb9dbec7a9dec09499737580692829cb0" } }, "targets": [ @@ -16960,6 +17007,10 @@ }, "deps": { "common": [ + { + "id": "async-lock 3.3.0", + "target": "async_lock" + }, { "id": "backoff 0.4.0", "target": "backoff" @@ -16997,7 +17048,7 @@ "target": "ic_certification" }, { - "id": "ic-transport-types 0.34.0", + "id": "ic-transport-types 0.35.0", "target": "ic_transport_types" }, { @@ -17033,7 +17084,7 @@ "target": "rangemap" }, { - "id": "reqwest 0.11.27", + "id": "reqwest 0.12.4", "target": "reqwest" }, { @@ -17100,7 +17151,7 @@ ], "selects": {} }, - "version": "0.34.0" + "version": "0.35.0" }, "license": "Apache-2.0" }, @@ -17675,7 +17726,7 @@ "target": "hex" }, { - "id": "ic-agent 0.34.0", + "id": "ic-agent 0.35.0", "target": "ic_agent" }, { @@ -17719,7 +17770,7 @@ "target": "ic_sys" }, { - "id": "ic-utils 0.34.0", + "id": "ic-utils 0.35.0", "target": "ic_utils" }, { @@ -17734,6 +17785,10 @@ "id": "prost 0.12.6", "target": "prost" }, + { + "id": "reqwest 0.12.4", + "target": "reqwest" + }, { "id": "serde 1.0.203", "target": "serde" @@ -21407,7 +21462,7 @@ "target": "hyper" }, { - "id": "ic-agent 0.34.0", + "id": "ic-agent 0.35.0", "target": "ic_agent" }, { @@ -21471,7 +21526,7 @@ "target": "ic_types" }, { - "id": "itertools 0.12.1", + "id": "itertools 0.13.0", "target": "itertools" }, { @@ -25668,13 +25723,13 @@ }, "license": null }, - "ic-transport-types 0.34.0": { + "ic-transport-types 0.35.0": { "name": "ic-transport-types", - "version": "0.34.0", + "version": "0.35.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/ic-transport-types/0.34.0/download", - "sha256": "7c06d3c1292368c813f8104d9d8294bda5577ea6fe4501a65997d0b7f155f15f" + "url": "https://static.crates.io/crates/ic-transport-types/0.35.0/download", + "sha256": "c1c68959f501cfcb79319b6720fd1903a661d77b503e6128bfce31f91ad87aca" } }, "targets": [ @@ -25740,7 +25795,7 @@ ], "selects": {} }, - "version": "0.34.0" + "version": "0.35.0" }, "license": "Apache-2.0" }, @@ -25902,13 +25957,13 @@ }, "license": null }, - "ic-utils 0.34.0": { + "ic-utils 0.35.0": { "name": "ic-utils", - "version": "0.34.0", + "version": "0.35.0", "repository": { "Http": { - "url": "https://static.crates.io/crates/ic-utils/0.34.0/download", - "sha256": "c83e1b5aea342fd6209b2de903eaf11c98f9724131f906da090cc14ec8329d0e" + "url": "https://static.crates.io/crates/ic-utils/0.35.0/download", + "sha256": "61fd20379ac2d86f85e177e75e72b27eaa595a9561891d5be0e7d0ca37604bbb" } }, "targets": [ @@ -25938,7 +25993,7 @@ "target": "futures_util" }, { - "id": "ic-agent 0.34.0", + "id": "ic-agent 0.35.0", "target": "ic_agent" }, { @@ -25972,6 +26027,10 @@ { "id": "time 0.3.36", "target": "time" + }, + { + "id": "tokio 1.37.0", + "target": "tokio" } ], "selects": {} @@ -25990,7 +26049,7 @@ ], "selects": {} }, - "version": "0.34.0" + "version": "0.35.0" }, "license": "Apache-2.0" }, @@ -27638,6 +27697,53 @@ }, "license": "MIT OR Apache-2.0" }, + "itertools 0.13.0": { + "name": "itertools", + "version": "0.13.0", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/itertools/0.13.0/download", + "sha256": "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" + } + }, + "targets": [ + { + "Library": { + "crate_name": "itertools", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "itertools", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "use_alloc", + "use_std" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "either 1.12.0", + "target": "either" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.13.0" + }, + "license": "MIT OR Apache-2.0" + }, "itoa 1.0.11": { "name": "itoa", "version": "1.0.11", @@ -30508,7 +30614,7 @@ "target": "humantime" }, { - "id": "ic-agent 0.34.0", + "id": "ic-agent 0.35.0", "target": "ic_agent" }, { @@ -31563,13 +31669,17 @@ "target": "candid" }, { - "id": "ic-agent 0.34.0", + "id": "ic-agent 0.35.0", "target": "ic_agent" }, { "id": "rand 0.8.5", "target": "rand" }, + { + "id": "reqwest 0.12.4", + "target": "reqwest" + }, { "id": "serde 1.0.203", "target": "serde" @@ -37327,24 +37437,13 @@ ], "crate_features": { "common": [ - "__rustls", "__tls", "blocking", "default", "default-tls", - "hyper-rustls", "hyper-tls", - "json", "native-tls-crate", - "rustls", - "rustls-tls-webpki-roots", - "serde_json", - "stream", - "tokio-native-tls", - "tokio-rustls", - "tokio-util", - "wasm-streams", - "webpki-roots" + "tokio-native-tls" ], "selects": {} }, @@ -37374,10 +37473,6 @@ "id": "serde 1.0.203", "target": "serde" }, - { - "id": "serde_json 1.0.117", - "target": "serde_json" - }, { "id": "serde_urlencoded 0.7.1", "target": "serde_urlencoded" @@ -37413,10 +37508,6 @@ "id": "hyper 0.14.28", "target": "hyper" }, - { - "id": "hyper-rustls 0.24.2", - "target": "hyper_rustls" - }, { "id": "hyper-tls 0.5.0", "target": "hyper_tls" @@ -37450,10 +37541,6 @@ "id": "pin-project-lite 0.2.14", "target": "pin_project_lite" }, - { - "id": "rustls 0.21.12", - "target": "rustls" - }, { "id": "rustls-pemfile 1.0.4", "target": "rustls_pemfile" @@ -37465,18 +37552,6 @@ { "id": "tokio-native-tls 0.3.1", "target": "tokio_native_tls" - }, - { - "id": "tokio-rustls 0.24.1", - "target": "tokio_rustls" - }, - { - "id": "tokio-util 0.7.11", - "target": "tokio_util" - }, - { - "id": "webpki-roots 0.25.4", - "target": "webpki_roots" } ], "cfg(target_arch = \"wasm32\")": [ @@ -37484,6 +37559,10 @@ "id": "js-sys 0.3.69", "target": "js_sys" }, + { + "id": "serde_json 1.0.117", + "target": "serde_json" + }, { "id": "wasm-bindgen 0.2.92", "target": "wasm_bindgen" @@ -37492,10 +37571,6 @@ "id": "wasm-bindgen-futures 0.4.42", "target": "wasm_bindgen_futures" }, - { - "id": "wasm-streams 0.4.0", - "target": "wasm_streams" - }, { "id": "web-sys 0.3.69", "target": "web_sys" @@ -37558,7 +37633,8 @@ "json", "macos-system-configuration", "rustls-pki-types", - "rustls-tls-webpki-roots" + "rustls-tls-webpki-roots", + "stream" ], "selects": { "aarch64-apple-darwin": [ @@ -37788,6 +37864,10 @@ "id": "tokio-rustls 0.25.0", "target": "tokio_rustls" }, + { + "id": "tokio-util 0.7.11", + "target": "tokio_util" + }, { "id": "webpki-roots 0.26.1", "target": "webpki_roots" @@ -37806,6 +37886,10 @@ "id": "wasm-bindgen-futures 0.4.42", "target": "wasm_bindgen_futures" }, + { + "id": "wasm-streams 0.4.0", + "target": "wasm_streams" + }, { "id": "web-sys 0.3.69", "target": "web_sys" @@ -38226,7 +38310,7 @@ "target": "ic_base_types" }, { - "id": "itertools 0.12.1", + "id": "itertools 0.13.0", "target": "itertools" }, { @@ -41155,7 +41239,7 @@ "deps_dev": { "common": [ { - "id": "itertools 0.12.1", + "id": "itertools 0.13.0", "target": "itertools" } ], @@ -41699,7 +41783,7 @@ "target": "futures" }, { - "id": "ic-agent 0.34.0", + "id": "ic-agent 0.35.0", "target": "ic_agent" }, { @@ -41715,7 +41799,7 @@ "target": "ic_nns_governance" }, { - "id": "itertools 0.12.1", + "id": "itertools 0.13.0", "target": "itertools" }, { @@ -44967,95 +45051,7 @@ "logging", "tls12" ], - "selects": { - "aarch64-apple-darwin": [ - "default" - ], - "aarch64-apple-ios": [ - "default" - ], - "aarch64-apple-ios-sim": [ - "default" - ], - "aarch64-fuchsia": [ - "default" - ], - "aarch64-linux-android": [ - "default" - ], - "aarch64-pc-windows-msvc": [ - "default" - ], - "aarch64-unknown-linux-gnu": [ - "default" - ], - "arm-unknown-linux-gnueabi": [ - "default" - ], - "armv7-linux-androideabi": [ - "default" - ], - "armv7-unknown-linux-gnueabi": [ - "default" - ], - "i686-apple-darwin": [ - "default" - ], - "i686-linux-android": [ - "default" - ], - "i686-pc-windows-msvc": [ - "default" - ], - "i686-unknown-freebsd": [ - "default" - ], - "i686-unknown-linux-gnu": [ - "default" - ], - "powerpc-unknown-linux-gnu": [ - "default" - ], - "riscv32imc-unknown-none-elf": [ - "default" - ], - "riscv64gc-unknown-none-elf": [ - "default" - ], - "s390x-unknown-linux-gnu": [ - "default" - ], - "thumbv7em-none-eabi": [ - "default" - ], - "thumbv8m.main-none-eabi": [ - "default" - ], - "x86_64-apple-darwin": [ - "default" - ], - "x86_64-apple-ios": [ - "default" - ], - "x86_64-fuchsia": [ - "default" - ], - "x86_64-linux-android": [ - "default" - ], - "x86_64-pc-windows-msvc": [ - "default" - ], - "x86_64-unknown-freebsd": [ - "default" - ], - "x86_64-unknown-linux-gnu": [ - "default" - ], - "x86_64-unknown-none": [ - "default" - ] - } + "selects": {} }, "deps": { "common": [ @@ -48001,36 +47997,6 @@ }, "license": "MIT OR Apache-2.0" }, - "webpki-roots 0.25.4": { - "name": "webpki-roots", - "version": "0.25.4", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/webpki-roots/0.25.4/download", - "sha256": "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - } - }, - "targets": [ - { - "Library": { - "crate_name": "webpki_roots", - "crate_root": "src/lib.rs", - "srcs": [ - "**/*.rs" - ] - } - } - ], - "library_target_name": "webpki_roots", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "edition": "2018", - "version": "0.25.4" - }, - "license": "MPL-2.0" - }, "webpki-roots 0.26.1": { "name": "webpki-roots", "version": "0.26.1", diff --git a/Cargo.lock b/Cargo.lock index cff83736f..888eb8960 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1937,7 +1937,7 @@ dependencies = [ "ic-base-types", "ic-management-types", "include_dir", - "itertools 0.12.1", + "itertools 0.13.0", "log", "rand", "rand_seeder", @@ -2251,7 +2251,7 @@ dependencies = [ "ic-sns-wasm", "ic-sys", "ic-types", - "itertools 0.12.1", + "itertools 0.13.0", "keyring", "log", "pretty_env_logger", @@ -3370,10 +3370,11 @@ dependencies = [ [[package]] name = "ic-agent" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555eda283b8ba1a996d44d80b6c9a6d38a6cbb81797a7b7bbee134fdde64ce48" +checksum = "8f08d1b54f1834fb9637a57855f1d87bb9dbec7a9dec09499737580692829cb0" dependencies = [ + "async-lock 3.3.0", "backoff", "cached 0.46.1", "candid", @@ -3392,7 +3393,7 @@ dependencies = [ "pkcs8", "rand", "rangemap", - "reqwest 0.11.27", + "reqwest 0.12.4", "ring", "rustls-webpki 0.101.7", "sec1", @@ -3540,10 +3541,11 @@ dependencies = [ "ic-protobuf", "ic-registry-transport", "ic-sys", - "ic-utils 0.34.0", + "ic-utils 0.35.0", "log", "pkcs11", "prost", + "reqwest 0.12.4", "serde", "sha2 0.10.8", "simple_asn1", @@ -4331,7 +4333,7 @@ dependencies = [ "ic-registry-nns-data-provider", "ic-registry-subnet-type", "ic-types", - "itertools 0.12.1", + "itertools 0.13.0", "lazy_static", "log", "octocrab", @@ -5200,9 +5202,9 @@ dependencies = [ [[package]] name = "ic-transport-types" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c06d3c1292368c813f8104d9d8294bda5577ea6fe4501a65997d0b7f155f15f" +checksum = "c1c68959f501cfcb79319b6720fd1903a661d77b503e6128bfce31f91ad87aca" dependencies = [ "candid", "hex", @@ -5264,9 +5266,9 @@ dependencies = [ [[package]] name = "ic-utils" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83e1b5aea342fd6209b2de903eaf11c98f9724131f906da090cc14ec8329d0e" +checksum = "61fd20379ac2d86f85e177e75e72b27eaa595a9561891d5be0e7d0ca37604bbb" dependencies = [ "async-trait", "candid", @@ -5281,6 +5283,7 @@ dependencies = [ "strum_macros 0.24.3", "thiserror", "time", + "tokio", ] [[package]] @@ -5600,6 +5603,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -6338,6 +6350,7 @@ dependencies = [ "candid", "ic-agent", "rand", + "reqwest 0.12.4", "serde", "url", ] @@ -7446,7 +7459,6 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", - "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -7456,7 +7468,6 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -7465,15 +7476,11 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", - "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", - "webpki-roots 0.25.4", "winreg 0.50.0", ] @@ -7516,12 +7523,14 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls 0.25.0", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots", "winreg 0.52.0", ] @@ -7609,7 +7618,7 @@ dependencies = [ "ic-base-types", "ic-management-backend", "ic-management-types", - "itertools 0.12.1", + "itertools 0.13.0", "pretty_assertions", "prometheus-http-query", "registry-canister", @@ -8134,7 +8143,7 @@ dependencies = [ "ic-registry-local-store-artifacts", "ic-registry-nns-data-provider", "ic-sys", - "itertools 0.12.1", + "itertools 0.13.0", "prometheus", "regex", "registry-canister", @@ -8258,7 +8267,7 @@ dependencies = [ "ic-nns-common", "ic-nns-constants", "ic-nns-governance", - "itertools 0.12.1", + "itertools 0.13.0", "lazy_static", "log", "regex", @@ -9436,12 +9445,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.1" diff --git a/Cargo.toml b/Cargo.toml index 788cfd076..01119df05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,17 +93,17 @@ humantime = "2.1.0" humantime-serde = "1.1.1" hyper = { version = "1.3.1" } hyper-tls = "0.6.0" -ic-agent = "0.34.0" +ic-agent = "0.35.0" ic-async-utils = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-base-types = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-canister-client = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-canister-client-sender = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-canisters = { path = "rs/ic-canisters" } -ic-cdk = "0.13.1" +ic-cdk = "0.14.0" ic-config = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-crypto-utils-threshold-sig-der = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-http-endpoints-metrics = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } -ic-identity-hsm = "0.34.0" +ic-identity-hsm = "0.35.0" ic-interfaces = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-interfaces-registry = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-management-backend = { path = "rs/ic-management-backend" } @@ -131,9 +131,9 @@ ic-nervous-system-root = { git = "https://github.com/dfinity/ic.git", rev = "5ba ic-nervous-system-clients = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } ic-sns-wasm = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } cycles-minting-canister = { git = "https://github.com/dfinity/ic.git", rev = "5ba1412f9175d987661ae3c0d8dbd1ac3e092b7d" } -ic-utils = "0.34.0" +ic-utils = "0.35.0" include_dir = "0.7.3" -itertools = "0.12.0" +itertools = "0.13.0" keyring = "2.0.2" lazy_static = "1.4.0" log = "0.4.21" diff --git a/rs/ic-canisters/Cargo.toml b/rs/ic-canisters/Cargo.toml index 829d5e97e..343ed24ab 100644 --- a/rs/ic-canisters/Cargo.toml +++ b/rs/ic-canisters/Cargo.toml @@ -26,6 +26,7 @@ ic-utils = { workspace = true } log = { workspace = true } pkcs11 = { workspace = true } prost = { workspace = true } +reqwest = { workspace = true } serde = { workspace = true } sha2 = { workspace = true } simple_asn1 = { workspace = true } diff --git a/rs/ic-canisters/src/governance.rs b/rs/ic-canisters/src/governance.rs index 682504390..f5fc4ea8a 100644 --- a/rs/ic-canisters/src/governance.rs +++ b/rs/ic-canisters/src/governance.rs @@ -1,4 +1,5 @@ use candid::Decode; +use ic_agent::agent::http_transport::ReqwestTransport; use ic_agent::Agent; use ic_nns_common::pb::v1::NeuronId; use ic_nns_common::pb::v1::ProposalId; @@ -12,6 +13,7 @@ use ic_nns_governance::pb::v1::ProposalInfo; use log::warn; use serde::{self, Serialize}; use std::str::FromStr; +use std::time::Duration; use url::Url; use crate::CanisterClient; @@ -23,10 +25,13 @@ pub struct GovernanceCanisterVersion { } pub async fn governance_canister_version(nns_urls: &[Url]) -> Result { + let client = reqwest::Client::builder() + .use_rustls_tls() + .timeout(Duration::from_secs(30)) + .build() + .expect("Could not create HTTP client."); let canister_agent = Agent::builder() - .with_transport(ic_agent::agent::http_transport::reqwest_transport::ReqwestHttpReplicaV2Transport::create( - nns_urls[0].clone(), - )?) + .with_transport(ReqwestTransport::create_with_client(nns_urls[0].clone(), client)?) .with_verify_query_signatures(false) .build()?; diff --git a/rs/ic-canisters/src/lib.rs b/rs/ic-canisters/src/lib.rs index 2fcdb51ca..123f6e08a 100644 --- a/rs/ic-canisters/src/lib.rs +++ b/rs/ic-canisters/src/lib.rs @@ -15,6 +15,7 @@ use serde::Deserialize; use std::path::PathBuf; use std::str::FromStr; use std::sync::Mutex; +use std::time::Duration; use url::Url; pub mod governance; @@ -83,13 +84,17 @@ impl IcAgentCanisterClient { } fn build_agent(url: Url, identity: Box) -> anyhow::Result { - Ok(Self { - agent: Agent::builder() - .with_identity(identity) - .with_transport(ReqwestTransport::create(url)?) - .with_verify_query_signatures(false) - .build()?, - }) + let client = reqwest::Client::builder() + .use_rustls_tls() + .timeout(Duration::from_secs(30)) + .build() + .expect("Could not create HTTP client."); + let agent = Agent::builder() + .with_identity(identity) + .with_transport(ReqwestTransport::create_with_client(url, client)?) + .with_verify_query_signatures(false) + .build()?; + Ok(Self { agent }) } } diff --git a/rs/ic-management-backend/src/proposal.rs b/rs/ic-management-backend/src/proposal.rs index 89b71e569..774682984 100644 --- a/rs/ic-management-backend/src/proposal.rs +++ b/rs/ic-management-backend/src/proposal.rs @@ -1,10 +1,12 @@ +use std::time::Duration; + use anyhow::Result; use backon::ExponentialBuilder; use backon::Retryable; use candid::{Decode, Encode}; use futures_util::future::try_join_all; -use ic_agent::agent::http_transport::reqwest_transport::ReqwestHttpReplicaV2Transport; +use ic_agent::agent::http_transport::ReqwestTransport; use ic_agent::Agent; use ic_management_types::UpdateElectedHostosVersionsProposal; use ic_management_types::UpdateElectedReplicaVersionsProposal; @@ -85,11 +87,17 @@ pub struct UpdateUnassignedNodesProposal { #[allow(dead_code)] impl ProposalAgent { pub fn new(nns_urls: &[Url]) -> Self { + let client = reqwest::Client::builder() + .use_rustls_tls() + .timeout(Duration::from_secs(30)) + .build() + .expect("Could not create HTTP client."); let agent = Agent::builder() - .with_transport(ReqwestHttpReplicaV2Transport::create(nns_urls[0].clone()).expect("failed to create transport")) + .with_transport(ReqwestTransport::create_with_client(nns_urls[0].clone(), client).expect("Failed to create transport")) .with_verify_query_signatures(false) .build() .expect("failed to build the agent"); + Self { agent } } diff --git a/rs/ic-observability/obs-canister-clients/Cargo.toml b/rs/ic-observability/obs-canister-clients/Cargo.toml index ed33bc0f3..af8ba4163 100644 --- a/rs/ic-observability/obs-canister-clients/Cargo.toml +++ b/rs/ic-observability/obs-canister-clients/Cargo.toml @@ -10,4 +10,5 @@ ic-agent = { workspace = true } candid = { workspace = true } serde = { workspace = true } rand = { workspace = true } +reqwest = { workspace = true } url = { workspace = true } diff --git a/rs/ic-observability/obs-canister-clients/src/node_status_canister_client.rs b/rs/ic-observability/obs-canister-clients/src/node_status_canister_client.rs index a8e1cbe13..a7de03377 100644 --- a/rs/ic-observability/obs-canister-clients/src/node_status_canister_client.rs +++ b/rs/ic-observability/obs-canister-clients/src/node_status_canister_client.rs @@ -1,4 +1,7 @@ +use std::time::Duration; + use candid::{CandidType, Decode, Encode}; +use ic_agent::agent::http_transport::ReqwestTransport; use ic_agent::{export::Principal, identity::AnonymousIdentity, Agent}; use rand::seq::SliceRandom; use serde::Deserialize; @@ -45,12 +48,17 @@ impl NodeStatusCanister { agent: url .iter() .map(|url| { + let client = reqwest::Client::builder() + .use_rustls_tls() + .timeout(Duration::from_secs(30)) + .build() + .expect("Could not create HTTP client."); Agent::builder() - .with_url(url.as_str()) + .with_transport(ReqwestTransport::create_with_client(url.as_str(), client).expect("Failed to create transport")) .with_identity(AnonymousIdentity) .with_verify_query_signatures(false) .build() - .unwrap() + .expect("Failed to build agent") }) .collect(), } diff --git a/rs/slack-notifications/src/main.rs b/rs/slack-notifications/src/main.rs index 064340a9d..6c2d90b4e 100644 --- a/rs/slack-notifications/src/main.rs +++ b/rs/slack-notifications/src/main.rs @@ -3,7 +3,7 @@ use ic_nns_governance::pb::v1::{ListProposalInfo, ListProposalInfoResponse, Prop use anyhow::Result; use candid::Decode; -use ic_agent::agent::http_transport::reqwest_transport::ReqwestHttpReplicaV2Transport; +use ic_agent::agent::http_transport::reqwest_transport::ReqwestTransport; use ic_agent::Agent; use log::{info, warn}; use serde::{Deserialize, Serialize}; @@ -108,8 +108,13 @@ struct ProposalPoller { impl ProposalPoller { fn new(target_network: Network) -> Self { let nns_url = target_network.get_nns_urls()[0].clone(); + let client = reqwest::Client::builder() + .use_rustls_tls() + .timeout(Duration::from_secs(30)) + .build() + .expect("Could not create HTTP client."); let agent = Agent::builder() - .with_transport(ReqwestHttpReplicaV2Transport::create(nns_url).expect("failed to create transport")) + .with_transport(ReqwestTransport::create_with_client(nns_url, client).expect("failed to create transport")) .build() .expect("failed to build the agent"); Self { agent } diff --git a/rs/slack-notifications/src/slack.rs b/rs/slack-notifications/src/slack.rs index 5367eb17e..78c55ea24 100644 --- a/rs/slack-notifications/src/slack.rs +++ b/rs/slack-notifications/src/slack.rs @@ -218,7 +218,7 @@ impl TryFrom> for MessageGroups { fn try_from(proposals: Vec) -> Result { let message_groups = proposals .into_iter() - .group_by(|p| { + .chunk_by(|p| { ( slack_channel_for_proposal(p), alert_mention(p.proposer.as_ref().expect("No NeuronId in the proposal")),