Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(BOUN-1360): make ic-gateway a monorepo dependency #4216

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
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
3,683 changes: 2,734 additions & 949 deletions Cargo.Bazel.Fuzzing.json.lock

Large diffs are not rendered by default.

483 changes: 429 additions & 54 deletions Cargo.Bazel.Fuzzing.toml.lock

Large diffs are not rendered by default.

3,715 changes: 2,750 additions & 965 deletions Cargo.Bazel.json.lock

Large diffs are not rendered by default.

487 changes: 431 additions & 56 deletions Cargo.Bazel.toml.lock

Large diffs are not rendered by default.

435 changes: 401 additions & 34 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ 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.39.2", features = ["pem", "ring"] }
ic-bn-lib = { git = "https://github.com/dfinity/ic-bn-lib", rev = "d74a6527fbaf8a2c1a7076983cc84f5c5a727923" }
ic-bn-lib = { git = "https://github.com/dfinity/ic-bn-lib", rev = "530f8e8ea577740213aff4b6dfa7a49cc32bae4a" }
ic-btc-interface = "0.2.2"
ic-canister-sig-creation = { git = "https://github.com/dfinity/ic-canister-sig-creation", rev = "7f9e931954637526295269155881207f6c832d6d" }
ic-cbor = "3"
Expand All @@ -573,8 +573,9 @@ ic-cdk-macros = "0.17.0"
ic-cdk-timers = "0.11.0"
ic-certificate-verification = "3"
ic-certification = "3"
ic-http-certification = "3"
ic-http-gateway = "0.1"
ic-gateway = { git = "https://github.com/dfinity/ic-gateway", rev = "8590b8e9f0af4cdc3b95cd09a0c7a89037b3c038" }
ic-http-certification = "3.0.3"
ic-http-gateway = "0.2.0"
ic-management-canister-types = "0.2.1"
ic-response-verification = "3"
ic-sha3 = "1.0.0"
Expand Down Expand Up @@ -664,7 +665,7 @@ rand_chacha = "0.3.1"
rayon = "1.10.0"
rcgen = { version = "0.13.1", features = ["zeroize"] }
regex = "1.11.0"
reqwest = { version = "0.12.8", default-features = false, features = [
reqwest = { version = "0.12.12", default-features = false, features = [
"blocking",
"http2",
"json",
Expand Down Expand Up @@ -714,6 +715,8 @@ tar = "0.4.39"
tempfile = "3.12.0"
thiserror = "2.0.3"
threadpool = "1.8.1"
tikv-jemalloc-ctl = { version = "0.6", features = ["stats"] }
tikv-jemallocator = "0.6"
time = { version = "0.3.36", features = ["formatting"] }
tracing-flame = "0.2.0"
tokio = { version = "1.42.0", features = ["full"] }
Expand Down
15 changes: 10 additions & 5 deletions bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
),
"ic-bn-lib": crate.spec(
git = "https://github.com/dfinity/ic-bn-lib",
rev = "d74a6527fbaf8a2c1a7076983cc84f5c5a727923",
rev = "530f8e8ea577740213aff4b6dfa7a49cc32bae4a",
),
"ic-btc-interface": crate.spec(
version = "^0.2.2",
Expand Down Expand Up @@ -623,6 +623,10 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
"ic-certificate-verification": crate.spec(
version = "3.0.3",
),
"ic-gateway": crate.spec(
git = "https://github.com/dfinity/ic-gateway",
rev = "8590b8e9f0af4cdc3b95cd09a0c7a89037b3c038",
),
"ic-http-certification": crate.spec(
version = "3.0.3",
),
Expand Down Expand Up @@ -660,7 +664,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^3.0.0",
),
"ic-transport-types": crate.spec(
version = "^0.39.2",
version = "^0.39.3",
),
"ic-utils": crate.spec(
version = "^0.39.0",
Expand Down Expand Up @@ -1060,7 +1064,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^1.11.0",
),
"reqwest": crate.spec(
version = "^0.12.8",
version = "^0.12.12",
default_features = False,
features = [
"blocking",
Expand Down Expand Up @@ -1316,10 +1320,11 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^1.8.1",
),
"tikv-jemalloc-ctl": crate.spec(
version = "^0.5",
version = "^0.6",
features = ["stats"],
),
"tikv-jemallocator": crate.spec(
version = "^0.5",
version = "^0.6",
),
"time": crate.spec(
version = "^0.3.36",
Expand Down
4 changes: 2 additions & 2 deletions rs/boundary_node/ic_boundary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ simple_moving_average = "1.0.2"
slog = { workspace = true }
strum = { workspace = true }
thiserror = { workspace = true }
tikv-jemalloc-ctl = "0.5"
tikv-jemallocator = "0.5"
tikv-jemalloc-ctl = { workspace = true }
tikv-jemallocator = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
tower = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions rs/pocket_ic_server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ TEST_DEPENDENCIES = [
"@crate_index//:ic-agent",
"@crate_index//:ic-btc-interface",
"@crate_index//:ic-cdk",
"@crate_index//:ic-gateway",
"@crate_index//:ic-utils",
"@crate_index//:nix",
"@crate_index//:prometheus",
"@crate_index//:rcgen",
"@crate_index//:reqwest",
"@crate_index//:rustls",
"@crate_index//:serde",
"@crate_index//:serde_json",
"@crate_index//:slog",
Expand Down
3 changes: 3 additions & 0 deletions rs/pocket_ic_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ wat = { workspace = true }
bitcoincore-rpc = { workspace = true }
ic-btc-interface = { workspace = true }
ic-config = { path = "../config" }
ic-gateway = { workspace = true }
ic-registry-transport = { path = "../registry/transport" }
ic-interfaces-registry = { path = "../interfaces/registry" }
ic-nns-constants = { path = "../nns/constants" }
nix = { version = "0.29.0" }
prometheus = { workspace = true }
rcgen = { workspace = true }
registry-canister = { path = "../registry/canister" }
reqwest = { workspace = true }
rustls = { workspace = true }
serde_json = { workspace = true }
spec-compliance = { path = "../tests/research/spec_compliance" }
45 changes: 45 additions & 0 deletions rs/pocket_ic_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,48 @@ impl BlobStore for InMemoryBlobStore {
m.get(&blob_id).cloned()
}
}

#[cfg(test)]
mod test {
use std::sync::Arc;

use clap::Parser;
use ic_agent::agent::route_provider::RoundRobinRouteProvider;
use ic_bn_lib::tls::prepare_client_config;
use ic_gateway::{setup_router, Cli};

#[test]
fn test_setup_router() {
let args = vec!["", "--domain", "ic0.app"];
let cli = Cli::parse_from(args);

rustls::crypto::ring::default_provider()
.install_default()
.unwrap();

let mut http_client_opts: ic_bn_lib::http::client::Options<ic_bn_lib::http::dns::Resolver> =
(&cli.http_client).into();
http_client_opts.tls_config = Some(prepare_client_config(&[
&rustls::version::TLS13,
&rustls::version::TLS12,
]));
let http_client =
Arc::new(ic_bn_lib::http::ReqwestClient::new(http_client_opts.clone()).unwrap());

let route_provider = RoundRobinRouteProvider::new(vec!["https://icp-api.io"]).unwrap();

let mut tasks = ic_bn_lib::tasks::TaskManager::new();

let _ = setup_router(
&cli,
vec![],
&mut tasks,
http_client,
Arc::new(route_provider),
&prometheus::Registry::new(),
None,
None,
)
.unwrap();
}
}
4 changes: 2 additions & 2 deletions rs/replica/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ rand = { workspace = true }
regex = { workspace = true }
slog = { workspace = true }
tempfile = { workspace = true }
tikv-jemalloc-ctl = "0.5"
tikv-jemallocator = "0.5"
tikv-jemalloc-ctl = { workspace = true }
tikv-jemallocator = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ pub fn legacy_asset_canister_test(env: TestEnv) {
.to_vec();

if res != hello_world_gzip {
bail!("gzipped hello world response did not match uploaded content")
bail!("gzipped hello world response did not match uploaded content (got {res:?}, expected {hello_world_gzip:?}")
}

Ok(())
Expand Down