Skip to content

Commit

Permalink
Merge branch 'franzstefan-rm-unused-deps-in-crypto' into 'master'
Browse files Browse the repository at this point in the history
build(crypto): CRP-2375 remove unused dependencies in crypto code

Removes some of the unused dependencies found with [cargo machete](https://github.com/bnjbvr/cargo-machete). There were also several false positives that could not be removed (e.g., serde, serde_bytes, slog, etc.). 

See merge request dfinity-lab/public/ic!17246
  • Loading branch information
fspreiss committed Jan 25, 2024
2 parents 953586a + 7a512af commit a3b6beb
Show file tree
Hide file tree
Showing 35 changed files with 3 additions and 150 deletions.
48 changes: 0 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions rs/crypto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ DEPENDENCIES = [
"//rs/config",
"//rs/crypto/interfaces/sig_verification",
"//rs/crypto/internal/crypto_lib/basic_sig/ed25519",
"//rs/crypto/internal/crypto_lib/basic_sig/iccsa",
"//rs/crypto/internal/crypto_lib/seed",
"//rs/crypto/internal/crypto_lib/threshold_sig/bls12_381",
"//rs/crypto/internal/crypto_lib/threshold_sig/tecdsa",
Expand Down Expand Up @@ -38,7 +37,6 @@ DEPENDENCIES = [
"@crate_index//:hex",
"@crate_index//:parking_lot",
"@crate_index//:serde",
"@crate_index//:serde_bytes",
"@crate_index//:slog",
"@crate_index//:strum",
"@crate_index//:tempfile",
Expand Down
2 changes: 0 additions & 2 deletions rs/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ic-crypto-internal-logmon = { path = "internal/logmon" }
ic-crypto-internal-seed = { path = "internal/crypto_lib/seed" }
ic-crypto-internal-threshold-sig-bls12381 = { path = "internal/crypto_lib/threshold_sig/bls12_381" }
ic-crypto-internal-threshold-sig-ecdsa = { path = "internal/crypto_lib/threshold_sig/tecdsa" }
ic-crypto-internal-basic-sig-iccsa = { path = "internal/crypto_lib/basic_sig/iccsa" }
ic-crypto-internal-types = { path = "internal/crypto_lib/types" }
ic-crypto-standalone-sig-verifier = { path = "standalone-sig-verifier" }
ic-crypto-tls-cert-validation = { path = "node_key_validation/tls_cert_validation" }
Expand All @@ -45,7 +44,6 @@ ic-registry-proto-data-provider = { path = "../registry/proto_data_provider" }
ic-types = { path = "../types/types" }
parking_lot = "0.12.1"
serde = { workspace = true }
serde_bytes = { workspace = true }
slog = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ DEPENDENCIES = [
"@crate_index//:lazy_static",
"@crate_index//:p256",
"@crate_index//:rand",
"@crate_index//:rand_chacha",
"@crate_index//:serde",
"@crate_index//:serde_bytes",
"@crate_index//:serde_cbor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ k256 = { workspace = true }
p256 = { workspace = true }
zeroize = { version = "1.4.3", features = ["zeroize_derive"] }
rand = "0.8"
rand_chacha = "0.3"
hex = "0.4"
hex-literal = "0.4.1"
paste = "1.0.0"
Expand Down
3 changes: 0 additions & 3 deletions rs/crypto/internal/crypto_service_provider/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ DEPENDENCIES = [
"@crate_index//:rand",
"@crate_index//:rand_chacha",
"@crate_index//:rayon",
"@crate_index//:rcgen",
"@crate_index//:serde",
"@crate_index//:serde_bytes",
"@crate_index//:serde_cbor",
"@crate_index//:simple_asn1",
"@crate_index//:slog",
"@crate_index//:strum",
"@crate_index//:stubborn-io",
Expand Down Expand Up @@ -89,7 +87,6 @@ DEV_DEPENDENCIES = [
]

MACRO_DEPENDENCIES = [
"@crate_index//:async-trait",
"@crate_index//:strum_macros",
"@crate_index//:educe",
]
Expand Down
3 changes: 0 additions & 3 deletions rs/crypto/internal/crypto_service_provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition.workspace = true
documentation.workspace = true

[dependencies]
async-trait = "0.1.41"
base64 = { workspace = true }
bincode = "1.2"
bytes = { workspace = true }
Expand Down Expand Up @@ -44,11 +43,9 @@ prost = { workspace = true }
rand = "0.8"
rand_chacha = "0.3"
rayon = "1.8"
rcgen = { workspace = true }
serde = { workspace = true }
serde_bytes = { workspace = true }
serde_cbor = { workspace = true }
simple_asn1 = { workspace = true }
slog = { workspace = true }
stubborn-io = "0.3.2"
strum = { workspace = true }
Expand Down
6 changes: 0 additions & 6 deletions rs/crypto/internal/csp_test_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ rust_library(
deps = [
"//rs/crypto/internal/crypto_lib/basic_sig/ed25519",
"//rs/crypto/internal/crypto_lib/multi_sig/bls12_381",
"//rs/crypto/internal/crypto_lib/types",
"//rs/crypto/internal/crypto_service_provider",
"//rs/crypto/internal/logmon",
"//rs/crypto/internal/test_vectors",
"//rs/monitoring/logger",
"//rs/protobuf",
"//rs/types/types",
"@crate_index//:rand",
"@crate_index//:rand_chacha",
"@crate_index//:serde",
"@crate_index//:serde_bytes",
"@crate_index//:serde_cbor",
"@crate_index//:tempfile",
"@crate_index//:tokio",
Expand Down
6 changes: 0 additions & 6 deletions rs/crypto/internal/csp_test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ documentation.workspace = true
ic-crypto-internal-basic-sig-ed25519 = { path = "../crypto_lib/basic_sig/ed25519" }
ic-crypto-internal-multi-sig-bls12381 = { path = "../crypto_lib/multi_sig/bls12_381" }
ic-crypto-internal-csp = { path = "../crypto_service_provider" }
ic-crypto-internal-logmon = { path = "../logmon" }
ic-crypto-internal-test-vectors = { path = "../test_vectors" }
ic-crypto-internal-types = { path = "../crypto_lib/types" }
ic-logger = { path = "../../../monitoring/logger" }
ic-protobuf = { path = "../../../protobuf" }
ic-types = { path = "../../../types/types" } # Would like to get rid of this but as long as the CSP depends on ic-types we can't really.
serde = { workspace = true }
serde_bytes = { workspace = true }
# No other ic-dependencies are allowed.

rand = "0.8"
rand_chacha = "0.3"
serde_cbor = { workspace = true }
tempfile = "3.1.0"
tokio = { workspace = true }
1 change: 0 additions & 1 deletion rs/crypto/internal/test_vectors/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rust_library(
version = "0.9.0",
visibility = ["//rs/crypto:__subpackages__"],
deps = [
"@crate_index//:base64",
"@crate_index//:hex",
"@crate_index//:strum",
],
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/internal/test_vectors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ documentation.workspace = true

[dependencies]
# NO ic-* dependencies are allowed here
base64 = { workspace = true }
hex = "0.4.2"
strum = { workspace = true }
strum_macros = { workspace = true }
1 change: 0 additions & 1 deletion rs/crypto/node_key_generation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ DEPENDENCIES = [
"//rs/crypto/tls_interfaces",
"//rs/crypto/utils/basic_sig",
"//rs/interfaces",
"//rs/interfaces/registry",
"//rs/protobuf",
"//rs/types/types",
"@crate_index//:tokio",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/node_key_generation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ic-crypto-node-key-validation = { path = "../node_key_validation"}
ic-crypto-tls-interfaces = { path = "../tls_interfaces" }
ic-crypto-utils-basic-sig = { path = "../utils/basic_sig" }
ic-interfaces = { path = "../../interfaces" }
ic-interfaces-registry = { path = "../../interfaces/registry" }
ic-protobuf = { path = "../../protobuf" }
ic-types = { path = "../../types/types" }
tokio = { workspace = true }
Expand Down
2 changes: 0 additions & 2 deletions rs/crypto/node_key_validation/tls_cert_validation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ package(default_visibility = ["//visibility:public"])
########################################################
DEPENDENCIES = [
"//rs/crypto/internal/crypto_lib/basic_sig/ed25519",
"//rs/crypto/internal/crypto_lib/types",
"//rs/protobuf",
"//rs/types/base_types",
"//rs/types/types",
"@crate_index//:hex",
"@crate_index//:serde",
Expand Down
2 changes: 0 additions & 2 deletions rs/crypto/node_key_validation/tls_cert_validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ documentation.workspace = true
# use dependencies that can be compiled to WebAssembly.
########################################################
hex = "0.4.2"
ic-base-types = { path = "../../../types/base_types" }
ic-crypto-internal-basic-sig-ed25519 = { path = "../../internal/crypto_lib/basic_sig/ed25519" }
ic-crypto-internal-types = { path = "../../internal/crypto_lib/types" }
ic-crypto-test-utils-reproducible-rng = { path = "../../test_utils/reproducible_rng" }
ic-protobuf = { path = "../../../protobuf" }
ic-types = { path = "../../../types/types" }
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/prng/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ filegroup(

DEPENDENCIES = [
"//rs/crypto/sha2",
"//rs/interfaces",
"//rs/types/types",
"@crate_index//:rand",
"@crate_index//:rand_chacha",
Expand Down
1 change: 0 additions & 1 deletion rs/crypto/prng/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2021"

[dependencies]
ic-crypto-sha2 = { path = "../sha2" }
ic-interfaces = { path = "../../interfaces" }
ic-types = { path = "../../types/types" }
rand = "0.8"
rand_chacha = "0.3"
Expand Down
Loading

0 comments on commit a3b6beb

Please sign in to comment.