Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
4,514 changes: 3,452 additions & 1,062 deletions Cargo.Bazel.json.lock

Large diffs are not rendered by default.

786 changes: 575 additions & 211 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.

25 changes: 12 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ assert_matches = "1.5.0"
async-recursion = "1.0.5"
async-stream = "0.3.6"
async-trait = "0.1.89"
axum = { version = "0.8.4", features = ["ws"] }
axum = { version = "0.8.9", features = ["ws"] }
axum-extra = { version = "0.10.1", features = ["typed-header"] }
axum-server = { version = "0.7.2", features = ["tls-rustls-no-provider"] }
backoff = "0.4"
Expand Down 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
93 changes: 82 additions & 11 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 @@ -109,7 +113,7 @@ crate.spec(
crate.spec(
features = ["ws"],
package = "axum",
version = "^0.8.4",
version = "^0.8.9",
)
crate.spec(
features = ["typed-header"],
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 @@ -506,6 +511,67 @@ crate.spec(
package = "getrandom",
version = "^0.2",
)

# ring 0.17.x declares `wasm32_unknown_unknown_js = ["getrandom/js"]`, which causes
# cargo-bazel to enable wasm-bindgen in getrandom 0.2.x for wasm32-unknown-unknown —
# even for canister targets that never depend on ring. We override the getrandom lib
# target with an identical copy that simply omits the wasm-bindgen deps/features on
# wasm32, bypassing the lock-file feature resolution entirely.
crate.annotation(
additive_build_file_content = """\
load("@rules_rust//rust:defs.bzl", "rust_library")

rust_library(
name = "getrandom_no_wasm_bindgen",
srcs = glob(
allow_empty = True,
include = ["**/*.rs"],
),
compile_data = glob(
allow_empty = True,
include = ["**"],
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = ["custom", "std"],
crate_name = "getrandom",
crate_root = "src/lib.rs",
deps = [
"@crate_index__cfg-if-1.0.0//:cfg_if",
] + select({
"@rules_rust//rust/platform:aarch64-apple-darwin": ["@crate_index__libc-0.2.177//:libc"],
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": ["@crate_index__libc-0.2.177//:libc"],
"@rules_rust//rust/platform:wasm32-unknown-unknown": [],
"@rules_rust//rust/platform:x86_64-apple-darwin": ["@crate_index__libc-0.2.177//:libc"],
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": ["@crate_index__libc-0.2.177//:libc"],
"//conditions:default": [],
}),
edition = "2018",
rustc_env_files = [":cargo_toml_env_vars"],
rustc_flags = ["--cap-lints=allow"],
tags = ["cargo-bazel", "crate-name=getrandom", "manual", "noclippy", "norustfmt"],
target_compatible_with = select({
"@rules_rust//rust/platform:aarch64-apple-darwin": [],
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [],
"@rules_rust//rust/platform:wasm32-unknown-unknown": [],
"@rules_rust//rust/platform:x86_64-apple-darwin": [],
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
version = "0.2.10",
visibility = ["//visibility:public"],
)
""",
crate = "getrandom",
override_target_lib = "@@rules_rust++crate+crate_index__getrandom-0.2.10//:getrandom_no_wasm_bindgen",
version = "^0.2",
)
crate.spec(
package = "gpt",
version = "4.1",
Expand Down Expand Up @@ -609,9 +675,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 @@ -677,7 +745,7 @@ crate.spec(
default_features = False,
git = "https://github.com/dfinity/ic-gateway",
package = "ic-gateway",
rev = "f33afac2aa47b8760090c93823b7fa7f5ba67dc4",
rev = "49424ec2dffee8d6c1e4cffc31fd9f518793c01b",
)
crate.spec(
package = "ic-custom-domains-backend",
Expand All @@ -696,8 +764,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 +779,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 +813,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 +1350,12 @@ crate.spec(
"http2",
"json",
"multipart",
"rustls-tls",
"rustls-tls-native-roots",
"rustls",
Comment thread
lwshang marked this conversation as resolved.
"socks",
"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/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ LIB_DEPENDENCIES = [
"//rs/validator/http_request_test_utils",
"//rs/validator/ingress_message",
"@crate_index//:aide",
"@crate_index//:arc-swap",
"@crate_index//:askama",
"@crate_index//:axum",
"@crate_index//:axum-extra",
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
Loading
Loading