Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,565 changes: 2,040 additions & 525 deletions Cargo.Bazel.json.lock

Large diffs are not rendered by default.

390 changes: 303 additions & 87 deletions Cargo.Bazel.toml.lock

Large diffs are not rendered by default.

893 changes: 609 additions & 284 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ curve25519-dalek = { version = "4.1.3", features = [
der = { version = "0.7", default-features = false, features = ["derive"] }
derive-new = "0.7.0"
devicemapper = "0.34"
dfx-core = { version = "0.3.0" }
dfx-core = { git = "https://github.com/dfinity/sdk", rev = "fbd3a78eb1d16c1e21531e16d1020ba917c8d9aa" }
ed25519-dalek = { version = "2.2.0", features = [
"std",
"zeroize",
Expand Down Expand Up @@ -684,9 +684,9 @@ hyper-rustls = { version = "0.27.5", default-features = false, features = [
hyper-socks2 = { version = "0.9.1", default-features = false }
hyper-util = { version = "0.1.12", features = ["full"] }
ic0 = "1.0.0"
ic-agent = { version = "0.45.0", features = ["pem", "ring"] }
ic-bn-lib = { version = "0.1.14", features = ["acme-alpn"] }
ic-bn-lib-common = "0.1.4"
ic-agent = { git = "https://github.com/dfinity/agent-rs", rev = "01b6b2ce96ceb44871b2a4273166e8d1cd5440ca", features = ["pem", "ring", "tls-ring"] }
ic-bn-lib = { version = "0.1.19", features = ["acme-alpn"] }
ic-bn-lib-common = "0.1.8"
ic-btc-interface = "0.4.0"
ic-canister-runtime = "0.2.0"
ic-canister-sig-creation = "1.3.1"
Expand All @@ -696,15 +696,15 @@ ic-cdk-timers = "1.0.0"
ic-certificate-verification = "3.0.3"
ic-certification = "3"
ic-doge-interface = "0.3.0"
ic-gateway = { git = "https://github.com/dfinity/ic-gateway", rev = "f33afac2aa47b8760090c93823b7fa7f5ba67dc4", default-features = false }
ic-gateway = { git = "https://github.com/dfinity/ic-gateway", rev = "49424ec2dffee8d6c1e4cffc31fd9f518793c01b", default-features = false }
ic-http-certification = "3.0.3"
ic-identity-hsm = "0.45.0"
ic-identity-hsm = { git = "https://github.com/dfinity/agent-rs", rev = "01b6b2ce96ceb44871b2a4273166e8d1cd5440ca" }
ic-management-canister-types = "0.5.0"
ic-response-verification = "3.1.0"
ic-sha3 = "1.0.0"
ic-stable-structures = "0.6.8"
ic-transport-types = { version = "0.45.0" }
ic-utils = { version = "0.45.0", features = ["raw"] }
ic-transport-types = { git = "https://github.com/dfinity/agent-rs", rev = "01b6b2ce96ceb44871b2a4273166e8d1cd5440ca" }
ic-utils = { git = "https://github.com/dfinity/agent-rs", rev = "01b6b2ce96ceb44871b2a4273166e8d1cd5440ca", features = ["raw"] }
ic-vetkeys = "0.6.0"
ic-xrc-types = "1.2.0"
ic_bls12_381 = { version = "0.10.1", default-features = false, features = [
Expand All @@ -714,7 +714,7 @@ ic_bls12_381 = { version = "0.10.1", default-features = false, features = [
"experimental",
"zeroize",
] }
ic_principal = { version = "0.1.1", default-features = false }
ic_principal = { version = "0.1.2", default-features = false }
idna = "1.0.2"
indexmap = "2.10.0"
indoc = "1.0.9"
Expand Down Expand Up @@ -806,13 +806,12 @@ rcgen = { version = "0.13.1", features = ["zeroize"] }
regex = "1.11.0"
regex-lite = "0.1.8"
rexpect = "0.6"
reqwest = { version = "0.12.24", default-features = false, features = [
reqwest = { version = "0.13.3", default-features = false, features = [
"blocking",
"http2",
"json",
"multipart",
"rustls-tls",
"rustls-tls-native-roots",
"rustls",
"socks",
"stream",
] }
Expand Down
27 changes: 18 additions & 9 deletions bazel/rust.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ ICRC_1_REV = "26a80d777e079644cd69e883e18dad1a201f5b1a"

BUILD_INFO_REV = "701a696844fba5c87df162fbbc1ccef96f27c9d7"

IC_AGENT_REV = "01b6b2ce96ceb44871b2a4273166e8d1cd5440ca"

DFX_CORE_REV = "fbd3a78eb1d16c1e21531e16d1020ba917c8d9aa"

Comment thread
lwshang marked this conversation as resolved.
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")

# Rust crates.
Expand Down Expand Up @@ -401,8 +405,9 @@ crate.spec(
version = "0.34",
)
crate.spec(
git = "https://github.com/dfinity/sdk",
package = "dfx-core",
version = "^0.3.0",
rev = DFX_CORE_REV,
)
crate.spec(
package = "dyn-clone",
Expand Down Expand Up @@ -609,9 +614,11 @@ crate.spec(
features = [
"pem",
"ring",
"tls-ring",
],
git = "https://github.com/dfinity/agent-rs",
package = "ic-agent",
version = "^0.45.0",
rev = IC_AGENT_REV,
)
crate.spec(
features = [
Expand Down Expand Up @@ -696,8 +703,9 @@ crate.spec(
version = "3.0.3",
)
crate.spec(
git = "https://github.com/dfinity/agent-rs",
package = "ic-identity-hsm",
version = "^0.45.0",
rev = IC_AGENT_REV,
)
crate.spec(
package = "ic-metrics-encoder",
Expand All @@ -710,7 +718,7 @@ crate.spec(
crate.spec(
default_features = False,
package = "ic_principal",
version = "^0.1.1",
version = "^0.1.2",
Comment thread
lwshang marked this conversation as resolved.
)
crate.spec(
package = "ic-response-verification",
Expand Down Expand Up @@ -744,13 +752,15 @@ crate.spec(
version = "^3.0.0",
)
crate.spec(
git = "https://github.com/dfinity/agent-rs",
package = "ic-transport-types",
version = "^0.45.0",
rev = IC_AGENT_REV,
)
crate.spec(
features = ["raw"],
git = "https://github.com/dfinity/agent-rs",
package = "ic-utils",
version = "^0.45.0",
rev = IC_AGENT_REV,
)
crate.spec(
default_features = False,
Expand Down Expand Up @@ -1279,12 +1289,11 @@ crate.spec(
"http2",
"json",
"multipart",
"rustls-tls",
"rustls-tls-native-roots",
"rustls",
Comment thread
lwshang marked this conversation as resolved.
"stream",
],
package = "reqwest",
version = "^0.12.24",
version = "^0.13.3",
)
crate.spec(
package = "rexpect",
Expand Down
1 change: 1 addition & 0 deletions packages/pocket-ic/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2422,6 +2422,7 @@ fn call_request(
canister_id,
method_name: "whoami".to_string(),
arg: Encode!(&()).unwrap(),
sender_info: None,
};
let envelope = Envelope {
content: std::borrow::Cow::Borrowed(&content),
Expand Down
1 change: 1 addition & 0 deletions rs/boundary_node/ic_boundary/src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use candid::Principal;
use derive_new::new;
use http::Method;
use ic_agent::Agent;
use ic_bn_lib::reqwest;
use ic_bn_lib_common::traits::{Run, http::Client};
use ic_types::messages::{HttpStatusResponse, ReplicaHealthStatus};
use mockall::automock;
Expand Down
4 changes: 2 additions & 2 deletions rs/boundary_node/ic_boundary/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::{net::SocketAddr, sync::Arc};

use arc_swap::ArcSwapOption;
use futures_util::future::ready;
use ic_bn_lib::reqwest::dns::{Addrs, Name, Resolve, Resolving};
use ic_bn_lib_common::traits::dns::CloneableDnsResolver;
use reqwest::dns::{Addrs, Name, Resolve, Resolving};

use crate::snapshot::RegistrySnapshot;

Expand Down Expand Up @@ -71,7 +71,7 @@ mod test {
// Check that resolver yields correct IPs
#[tokio::test]
async fn test_resolve() -> Result<(), Error> {
use reqwest::dns::Name;
use ic_bn_lib::reqwest::dns::Name;

let (reg, nodes, _) = create_fake_registry_client(4, 1, None);
let reg = Arc::new(reg);
Expand Down
2 changes: 1 addition & 1 deletion rs/boundary_node/ic_boundary/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use async_trait::async_trait;
use axum::Router;
use clap::Parser;
use ic_base_types::NodeId;
use ic_bn_lib::prometheus::Registry;
use ic_bn_lib::{prometheus::Registry, reqwest};
use ic_bn_lib_common::{traits::http::Client as HttpClient, types::http::ConnInfo};
use ic_certification_test_utils::CertificateBuilder;
use ic_certification_test_utils::CertificateData::*;
Expand Down
1 change: 1 addition & 0 deletions rs/migration_canister/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ async fn call_request(
canister_id,
method_name: "update".to_string(),
arg: wasm().reply().build(),
sender_info: None,
};
let envelope = Envelope {
content: std::borrow::Cow::Borrowed(&content),
Expand Down
1 change: 1 addition & 0 deletions rs/pocket_ic_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true

[dependencies]
aide = { workspace = true }
arc-swap = { workspace = true }
askama = { workspace = true }
async-trait = { workspace = true }
axum = { workspace = true }
Expand Down
15 changes: 11 additions & 4 deletions rs/pocket_ic_server/src/state_api/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::pocket_ic::{
SetCertifiedTime,
};
use crate::{InstanceId, OpId, Operation};
use arc_swap::ArcSwapOption;
use async_trait::async_trait;
Comment thread
lwshang marked this conversation as resolved.
use axum::{
Router,
Expand All @@ -31,6 +32,7 @@ use ic_bn_lib_common::{
traits::http::Client,
types::http::{ClientOptions, ConnInfo},
};
use ic_gateway::ic_bn_lib::reqwest as ic_bn_reqwest;
use ic_gateway::{
Cli, ProvidesCustomDomains,
ic_bn_lib::{
Expand All @@ -43,6 +45,7 @@ use ic_gateway::{
ic_agent::agent::route_provider::RoundRobinRouteProvider,
utils::health_manager::HealthManager,
},
routing::ic::subnets_info::SubnetsInfo,
setup_router,
};
use ic_types::{CanisterId, NodeId, PrincipalId, SubnetId, canister_http::CanisterHttpRequestId};
Expand Down Expand Up @@ -494,17 +497,20 @@ impl IntoResponse for ErrorCause {
}

#[derive(Debug)]
struct ReqwestClient(reqwest::Client);
struct ReqwestClient(ic_bn_reqwest::Client);

impl ReqwestClient {
pub fn new(client: reqwest::Client) -> Self {
pub fn new(client: ic_bn_reqwest::Client) -> Self {
Self(client)
}
}

#[async_trait]
impl Client for ReqwestClient {
async fn execute(&self, req: reqwest::Request) -> Result<reqwest::Response, reqwest::Error> {
async fn execute(
&self,
req: ic_bn_reqwest::Request,
) -> Result<ic_bn_reqwest::Response, ic_bn_reqwest::Error> {
self.0.execute(req).await
}
}
Expand Down Expand Up @@ -864,13 +870,14 @@ impl ApiState {
None,
None,
None,
Arc::new(ArcSwapOption::<SubnetsInfo>::const_empty()),
)
.await
.unwrap();

tasks.start();

let backend_client = Arc::new(ReqwestClient::new(reqwest::Client::new()));
let backend_client = Arc::new(ReqwestClient::new(ic_bn_reqwest::Client::new()));
let cors_get = layer(&[Method::HEAD, Method::GET]);
Router::new()
.nest(
Expand Down
1 change: 1 addition & 0 deletions rs/rosetta-api/icrc1/src/construction_api/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ pub fn handle_construction_payloads(
nonce: Some(nonce.to_ne_bytes().to_vec()),
sender: caller,
ingress_expiry: *ingress_expiry,
sender_info: None,
};

// For every operation we create a call envelope
Expand Down
2 changes: 2 additions & 0 deletions rs/tests/boundary_nodes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ system_test_nns(
"@crate_index//:rand",
"@crate_index//:rand_chacha",
"@crate_index//:regex",
"@crate_index//:reqwest",
"@crate_index//:slog",
"@crate_index//:tokio",
"@crate_index//:wat",
Expand Down Expand Up @@ -194,6 +195,7 @@ system_test_nns(
"@crate_index//:ic-agent",
"@crate_index//:itertools",
"@crate_index//:k256",
"@crate_index//:reqwest",
"@crate_index//:slog",
"@crate_index//:tokio",
"@crate_index//:wat",
Expand Down
1 change: 1 addition & 0 deletions rs/tests/boundary_nodes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ k256 = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
rate-limits-api = { path = "../../boundary_node/rate_limits/api" }
reqwest = { workspace = true }
salt-sharing-api = { path = "../../boundary_node/salt_sharing/api" }
regex = { workspace = true }
registry-canister = { path = "../../registry/canister" }
Expand Down
7 changes: 2 additions & 5 deletions rs/tests/boundary_nodes/api_bn_decentralization_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ use registry_canister::mutations::{

use ic_agent::{
Agent,
agent::{
ApiBoundaryNode,
http_transport::reqwest_transport::reqwest::{Client, ClientBuilder, redirect::Policy},
route_provider::RouteProvider,
},
agent::{ApiBoundaryNode, route_provider::RouteProvider},
export::Principal,
identity::{AnonymousIdentity, Secp256k1Identity},
};
Expand All @@ -50,6 +46,7 @@ use ic_boundary_nodes_system_test_utils::{
},
setup::{TEST_PRIVATE_KEY, setup_ic},
};
use reqwest::{Client, ClientBuilder, redirect::Policy};

const CANISTER_RETRY_TIMEOUT: Duration = Duration::from_secs(30);
const CANISTER_RETRY_BACKOFF: Duration = Duration::from_secs(2);
Expand Down
7 changes: 2 additions & 5 deletions rs/tests/boundary_nodes/rate_limit_canister_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ use std::{net::SocketAddr, sync::Arc, time::Duration};
use tokio::runtime::Runtime;

use bytes::Bytes;
use ic_agent::{
Agent, AgentError, Identity,
agent::{HttpService, http_transport::reqwest_transport::reqwest::Client},
identity::Secp256k1Identity,
};
use ic_agent::{Agent, AgentError, Identity, agent::HttpService, identity::Secp256k1Identity};
use ic_registry_subnet_type::SubnetType;
use ic_system_test_driver::{
driver::{
Expand All @@ -64,6 +60,7 @@ use rate_limits_api::{
AddConfigResponse, InitArg, InputConfig, InputRule,
v1::{Action, RateLimitRule},
};
use reqwest::Client;

const RATE_LIMIT_CANISTER_ID: &str = "u637p-5aaaa-aaaaq-qaaca-cai";

Expand Down
2 changes: 1 addition & 1 deletion rs/tests/consensus/upgrade/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ rust_library(
"//rs/tests/driver:ic-system-test-driver",
"//rs/types/management_canister_types",
"//rs/types/types",
"@@rules_rust++crate+crate_index__ic-management-canister-types-0.7.1//:ic_management_canister_types",
"@crate_index//:anyhow",
"@crate_index//:candid",
"@crate_index//:ic-agent",
"@crate_index//:ic-management-canister-types",
"@crate_index//:ic-utils",
"@crate_index//:regex",
"@crate_index//:slog",
Expand Down
2 changes: 1 addition & 1 deletion rs/tests/consensus/upgrade/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ anyhow = { workspace = true }
candid = { workspace = true }
futures = { workspace = true }
ic-agent = { workspace = true }
ic-management-canister-types = { workspace = true }
ic-management-canister-types = "0.7.1"
ic-system-test-driver = { path = "../../driver" }
ic-types = { path = "../../../types/types" }
ic-management-canister-types-private = { path = "../../../types/management_canister_types" }
Expand Down
6 changes: 3 additions & 3 deletions rs/tests/consensus/upgrade/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ pub fn upgrade(
let snapshot_args = TakeCanisterSnapshotArgs {
canister_id: CanisterId::from(can_id),
replace_snapshot: None,
uninstall_code: None,
sender_canister_version: None,
};
mgr.take_canister_snapshot(&can_id, &snapshot_args)
.await
.unwrap();
mgr.take_canister_snapshot(&snapshot_args).await.unwrap();
});

info!(logger, "Stopping faulty node {} ...", faulty_node.node_id);
Expand Down
2 changes: 1 addition & 1 deletion rs/tests/consensus/utils/src/rw_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub fn get_cert_time(url: &url::Url, effective_canister_id: PrincipalId) -> Resu
let paths = vec![path.clone()];
let agent = assert_create_agent(url.as_str()).await;
match agent
.read_state_raw(paths.clone(), effective_canister_id.into())
.read_state_raw(paths.clone(), Principal::from(effective_canister_id))
.await
{
Ok(cert) => match lookup_value(&cert, path.clone()) {
Expand Down
Loading
Loading