Skip to content

Commit

Permalink
Update crate versions
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed Jan 4, 2025
1 parent 74bc4ed commit 984b7af
Show file tree
Hide file tree
Showing 24 changed files with 2,441 additions and 3,270 deletions.
2,772 changes: 989 additions & 1,783 deletions Cargo.Bazel.json.lock

Large diffs are not rendered by default.

303 changes: 151 additions & 152 deletions Cargo.Bazel.toml.lock

Large diffs are not rendered by default.

2,339 changes: 1,167 additions & 1,172 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 10 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -558,26 +558,23 @@ hyper-rustls = { version = "0.27.3", default-features = false, features = [
] }
hyper-socks2 = { version = "0.9.1", default-features = false }
hyper-util = { version = "0.1.10", features = ["full"] }
ic-agent = { version = "0.37.1", features = [
"experimental_sync_call",
"hyper",
"reqwest",
"pem",
] }
ic-agent = { version = "0.39.2", features = ["pem", "ring"] }
ic-bn-lib = { git = "https://github.com/dfinity/ic-bn-lib", rev = "d74a6527fbaf8a2c1a7076983cc84f5c5a727923" }
ic-btc-interface = "0.2.2"
ic-cbor = "2.6.0"
ic-canister-sig-creation = { git = "https://github.com/dfinity/ic-canister-sig-creation", rev = "7f9e931954637526295269155881207f6c832d6d" }
ic-cbor = "3"
ic-cdk = "0.16.0"
ic-cdk-macros = "0.9.0"
ic-cdk-timers = "0.7.0"
ic-certificate-verification = "2.6.0"
ic-certification = "2.6.0"
ic-http-certification = "2.6.0"
ic-response-verification = "2.6.0"
ic-certificate-verification = "3"
ic-certification = "3"
ic-http-certification = "3"
ic-http-gateway = "0.1"
ic-response-verification = "3"
ic-sha3 = "1.0.0"
ic-stable-structures = "0.6.5"
ic-transport-types = { version = "0.37.1" }
ic-utils = { version = "0.37.0", features = ["raw"] }
ic-transport-types = { version = "0.39.2" }
ic-utils = { version = "0.39", features = ["raw"] }
ic_bls12_381 = { version = "0.10.0", default-features = false, features = [
"groups",
"pairings",
Expand Down
29 changes: 12 additions & 17 deletions bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,8 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^0.18.11",
),
"ic-agent": crate.spec(
version = "^0.37.1",
features = [
"experimental_sync_call",
"hyper",
"reqwest",
"pem",
],
version = "^0.39.2",
features = ["pem", "ring"],
),
"ic-bn-lib": crate.spec(
git = "https://github.com/dfinity/ic-bn-lib",
Expand All @@ -588,10 +583,11 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^0.2.0",
),
"ic-canister-sig-creation": crate.spec(
version = "^1.0.1",
git = "https://github.com/dfinity/ic-canister-sig-creation",
rev = "7f9e931954637526295269155881207f6c832d6d",
),
"ic-cbor": crate.spec(
version = "2.6.0",
version = "3.0.2",
),
"ic-cdk": crate.spec(
version = "^0.16.0",
Expand All @@ -606,17 +602,16 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^0.3.1",
),
"ic-certification": crate.spec(
version = "2.6.0",
version = "3.0.2",
),
"ic-certificate-verification": crate.spec(
version = "2.6.0",
version = "3.0.2",
),
"ic-http-certification": crate.spec(
version = "2.6.0",
version = "3.0.2",
),
"ic-http-gateway": crate.spec(
git = "https://github.com/dfinity/http-gateway",
tag = "0.1.0-b0",
version = "0.1.0",
),
"ic-metrics-encoder": crate.spec(
version = "^1.1.1",
Expand All @@ -626,7 +621,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
default_features = False,
),
"ic-response-verification": crate.spec(
version = "2.6.0",
version = "3.0.2",
),
"ic-sha3": crate.spec(
version = "^1.0.0",
Expand All @@ -646,10 +641,10 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^3.0.0",
),
"ic-transport-types": crate.spec(
version = "^0.37.1",
version = "^0.39.2",
),
"ic-utils": crate.spec(
version = "^0.37.0",
version = "^0.39.0",
features = ["raw"],
),
"ic-verify-bls-signature": crate.spec(
Expand Down
2 changes: 1 addition & 1 deletion packages/ic-signature-verification/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation = "https://docs.rs/ic-signature-verification"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ic-canister-sig-creation = "1.0"
ic-canister-sig-creation = { workspace = true }
ic-certification = { workspace = true }
ic-verify-bls-signature = { version = "0.6", default-features = false, features = [
"alloc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,10 @@ impl Check for Checker {
})?;

// Phase 4 - Ensure canister mentions known domain.
let request = HttpRequest {
method: String::from("GET"),
url: String::from("/.well-known/ic-domains"),
headers: vec![],
body: vec![],
};
let request = HttpRequest::get("/.well-known/ic-domains").build();

let (response,) = HttpRequestCanister::create(&self.agent, canister_id)
.http_request(&request.method, &request.url, vec![], vec![], None)
.http_request(&request.method(), &request.url(), vec![], vec![], None)
.call()
.await
.map_err(|_| CheckError::KnownDomainsUnavailable {
Expand All @@ -197,16 +192,18 @@ impl Check for Checker {
}?;

// Check response certification
let response_for_verification = HttpResponse {
status_code: response.status_code,
headers: response
let response_for_verification = HttpResponse::ok(
// body
response.body.clone(),
// headers
response
.headers
.iter()
.map(|field| (field.0.to_string(), field.1.to_string()))
.collect::<Vec<(String, String)>>(),
body: response.body.clone(),
upgrade: response.upgrade,
};
)
.with_upgrade(response.upgrade.unwrap_or_default())
.build();
let max_cert_time_offset_ns = 300_000_000_000;
let current_time_ns = SystemTime::now()
.duration_since(UNIX_EPOCH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ use axum::{
use candid::{DecoderConfig, Principal};
use chacha20poly1305::{KeyInit, XChaCha20Poly1305};
use clap::Parser;
use ic_agent::{
agent::http_transport::reqwest_transport::ReqwestTransport, identity::Secp256k1Identity, Agent,
};
use ic_agent::{identity::Secp256k1Identity, Agent};
use instant_acme::{Account, AccountCredentials, NewAccount};
use opentelemetry::{
metrics::{Counter, Histogram, MeterProvider as _},
Expand Down Expand Up @@ -198,15 +196,13 @@ async fn main() -> Result<(), Error> {
static USER_AGENT: &str = "Ic-Certificate-Issuer";
let client = reqwest::Client::builder().user_agent(USER_AGENT).build()?;

let transport =
ReqwestTransport::create_with_client(cli.orchestrator_uri.to_string(), client)?;

let f = File::open(cli.identity_path).context("failed to open identity file")?;
let identity = Secp256k1Identity::from_pem(f).context("failed to create basic identity")?;

let agent = Agent::builder()
.with_identity(identity)
.with_transport(transport)
.with_url(cli.orchestrator_uri.to_string())
.with_http_client(client)
.build()?;

let root_key = cli
Expand Down
10 changes: 3 additions & 7 deletions rs/http_endpoints/fuzz/fuzz_targets/execute_call_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ use axum::body::Body;
use bytes::Bytes;
use http_body_util::Full;
use hyper::{Method, Request, Response};
use ic_agent::{
agent::{http_transport::reqwest_transport::ReqwestTransport, UpdateBuilder},
export::Principal,
identity::AnonymousIdentity,
Agent,
};
use ic_agent::{agent::UpdateBuilder, export::Principal, identity::AnonymousIdentity, Agent};
use ic_config::http_handler::Config;
use ic_error_types::{ErrorCode, UserError};
use ic_http_endpoints_public::{call_v2, IngressValidatorBuilder};
Expand Down Expand Up @@ -166,7 +161,8 @@ fn new_update_call(
) -> Vec<u8> {
let agent = Agent::builder()
.with_identity(AnonymousIdentity)
.with_transport(ReqwestTransport::create(format!("http://{}", addr)).unwrap())
.with_url(format!("http://{}", addr))
.with_http_client(reqwest::Client::new())
.build()
.unwrap();
let update = UpdateBuilder::new(&agent, effective_canister_id, content.method_name)
Expand Down
13 changes: 5 additions & 8 deletions rs/monitoring/tracing/jaeger_exporter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ pub fn jaeger_exporter(
.build()?;

let tracer = sdk_trace::TracerProvider::builder()
.with_config(
sdk_trace::Config::default()
.with_sampler(sdk_trace::Sampler::TraceIdRatioBased(0.01))
.with_resource(Resource::new(vec![KeyValue::new(
"service.name",
service_name,
)])),
)
.with_sampler(sdk_trace::Sampler::TraceIdRatioBased(0.01))
.with_resource(Resource::new(vec![KeyValue::new(
"service.name",
service_name,
)]))
.with_batch_exporter(span_exporter, sdk_runtime::Tokio)
.build();

Expand Down
5 changes: 3 additions & 2 deletions rs/nervous_system/agent/src/agent_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ impl CallCanisters for Agent {
.with_arg(request_bytes)
.call()
.await?;
match request {
let (response, _cert) = match request {
ic_agent::agent::CallResponse::Response(response) => response,
ic_agent::agent::CallResponse::Poll(request_id) => {
self.wait(&request_id, canister_id).await?
}
}
};
response
} else {
self.query(&canister_id, request.method())
.with_arg(request_bytes)
Expand Down
2 changes: 1 addition & 1 deletion rs/pocket_ic_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ic-crypto-iccsa = { path = "../crypto/iccsa" }
ic-crypto-sha2 = { path = "../crypto/sha2" }
ic-crypto-utils-threshold-sig-der = { path = "../crypto/utils/threshold_sig_der" }
ic-error-types = { path = "../types/error_types" }
ic-http-gateway = { git = "https://github.com/dfinity/http-gateway", tag = "0.1.0-b0" }
ic-http-gateway = { workspace = true }
ic-http-endpoints-public = { path = "../http_endpoints/public" }
ic-https-outcalls-adapter = { path = "../https_outcalls/adapter" }
ic-https-outcalls-adapter-client = { path = "../https_outcalls/client" }
Expand Down
3 changes: 1 addition & 2 deletions rs/pocket_ic_server/src/state_api/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,7 @@ async fn handler(
|_| ErrorCause::RequestTooLarge,
)
})?
.to_bytes()
.to_vec();
.to_bytes();

let args = HttpGatewayRequestArgs {
canister_request: CanisterRequest::from_parts(parts, body),
Expand Down
73 changes: 37 additions & 36 deletions rs/pocket_ic_server/tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use candid::{Encode, Principal};
use ic_agent::agent::{http_transport::ReqwestTransport, CallResponse};
use ic_agent::agent::CallResponse;
use ic_cdk::api::management_canister::main::CanisterIdRecord;
use ic_cdk::api::management_canister::provisional::ProvisionalCreateCanisterWithCyclesArgument;
use ic_interfaces_registry::{
Expand Down Expand Up @@ -291,36 +291,35 @@ async fn test_gateway(server_url: Url, https: bool) {
assert_eq!(http_gateway_details.https_config, https_config);

// create a non-blocking reqwest client resolving localhost/example.com and <canister-id>.(raw.)localhost/example.com to 127.0.0.1
let mut builder = NonblockingClient::builder();
for domain in [
localhost,
sub_localhost,
sub_raw_localhost,
alt_domain,
sub_alt_domain,
sub_raw_alt_domain,
] {
builder = builder.resolve(
domain,
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port),
);
}
// add a custom root certificate
if https {
builder = builder.add_root_certificate(
reqwest::Certificate::from_pem(root_cert.pem().as_bytes()).unwrap(),
);
}
let client = builder.build().unwrap();
let create_client = || {
let mut builder = NonblockingClient::builder();
for domain in [
localhost,
sub_localhost,
sub_raw_localhost,
alt_domain,
sub_alt_domain,
sub_raw_alt_domain,
] {
builder = builder.resolve(
domain,
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port),
);
}
// add a custom root certificate
if https {
builder = builder.add_root_certificate(
reqwest::Certificate::from_pem(root_cert.pem().as_bytes()).unwrap(),
);
}
builder.build().unwrap()
};
let client = create_client();

// create agent with custom transport
let transport = ReqwestTransport::create_with_client(
format!("{}://{}:{}", proto, localhost, port),
client.clone(),
)
.unwrap();
// create agent
let agent = ic_agent::Agent::builder()
.with_transport(transport)
.with_url(format!("{}://{}:{}", proto, localhost, port))
.with_http_client(client)
.build()
.unwrap();
agent.fetch_root_key().await.unwrap();
Expand Down Expand Up @@ -380,7 +379,7 @@ async fn test_gateway(server_url: Url, https: bool) {
test_urls.push(canister_url.clone());

for url in test_urls {
let res = client.get(url).send().await.unwrap();
let res = create_client().get(url).send().await.unwrap();
let page = String::from_utf8(res.bytes().await.unwrap().to_vec()).unwrap();
assert!(page.contains("<title>Internet Identity</title>"));
}
Expand All @@ -390,7 +389,12 @@ async fn test_gateway(server_url: Url, https: bool) {

// HTTP gateway should eventually stop and requests to it fail
loop {
if client.get(canister_url.clone()).send().await.is_err() {
if create_client()
.get(canister_url.clone())
.send()
.await
.is_err()
{
break;
}
std::thread::sleep(Duration::from_millis(20));
Expand Down Expand Up @@ -897,12 +901,9 @@ fn test_specified_id_call_v3() {
.build()
.unwrap();
rt.block_on(async {
let transport = ReqwestTransport::create(endpoint.clone())
.unwrap()
.with_use_call_v3_endpoint();

let agent = ic_agent::Agent::builder()
.with_transport(transport)
.with_url(endpoint)
.with_http_client(reqwest::Client::new())
.build()
.unwrap();
agent.fetch_root_key().await.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DEPENDENCIES = [
"@crate_index//:chrono",
"@crate_index//:ciborium",
"@crate_index//:ic-agent",
"@crate_index//:reqwest",
"@crate_index//:rusqlite",
"@crate_index//:serde",
"@crate_index//:tokio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ic-ledger-hash-of = { path = "../../../../packages/ic-ledger-hash-of" }
ic-types = { path = "../../../types/types" }
icp-ledger = { path = "../../../ledger_suite/icp" }
on_wire = { path = "../../../rust_canisters/on_wire" }
reqwest = { workspace = true }
rusqlite = { version = "~0.28.0", features = ["bundled"] }
serde = { workspace = true }
tokio = { workspace = true }
Expand Down
Loading

0 comments on commit 984b7af

Please sign in to comment.