diff --git a/Cargo.lock b/Cargo.lock index 64e39b4e1de3..6331ed44c32e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2083,7 +2083,7 @@ dependencies = [ "canlog_derive 0.1.0", "ic-canister-log 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ic0", - "proptest 1.6.0", + "proptest", "regex", "serde", "serde_json", @@ -2525,9 +2525,12 @@ dependencies = [ [[package]] name = "cobs" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.12", +] [[package]] name = "codespan-reporting" @@ -2856,7 +2859,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "hex", - "proptest 1.6.0", + "proptest", "serde", ] @@ -6461,7 +6464,7 @@ dependencies = [ "ic-protobuf", "ic-test-utilities-compare-dirs", "phantom_newtype", - "proptest 1.6.0", + "proptest", "proptest-derive", "prost 0.13.4", "serde", @@ -6825,7 +6828,7 @@ dependencies = [ "ic-types", "ic-universal-canister", "pocket-ic", - "proptest 1.6.0", + "proptest", "scraper", "serde", "serde_json", @@ -6850,18 +6853,15 @@ dependencies = [ "ic-logger", "ic-metrics", "ic-protobuf", - "ic-registry-client-helpers", - "ic-registry-subnet-features", "ic-replicated-state", "ic-test-utilities", "ic-test-utilities-logger", "ic-test-utilities-state", - "ic-test-utilities-time", "ic-test-utilities-types", "ic-types", "mockall", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "slog", "thiserror 2.0.12", @@ -6905,8 +6905,6 @@ version = "0.9.0" dependencies = [ "bitcoin 0.32.99", "csv", - "hex", - "proptest 0.9.6", "rstest", ] @@ -7005,20 +7003,16 @@ dependencies = [ "ic-logger", "ic-management-canister-types-private", "ic-metrics", - "ic-registry-routing-table", "ic-registry-subnet-type", "ic-replicated-state", - "ic-sys", "ic-test-utilities", "ic-test-utilities-execution-environment", "ic-test-utilities-metrics", "ic-test-utilities-types", "ic-types", - "ic-utils 0.9.0", "ic-wasm-types", "lazy_static", "libc", - "libflate", "memory_tracker", "mockall", "nix 0.24.3", @@ -7105,7 +7099,7 @@ dependencies = [ "leb128", "maplit", "phantom_newtype", - "proptest 1.6.0", + "proptest", "serde", "serde_bytes", "serde_cbor", @@ -7126,7 +7120,7 @@ dependencies = [ "ic-crypto-tree-hash-test-utils", "itertools 0.12.1", "leb128", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rand_chacha 0.3.1", "scoped_threadpool", @@ -7365,7 +7359,7 @@ dependencies = [ "mockall", "num-traits", "pocket-ic", - "proptest 1.6.0", + "proptest", "ripemd", "scopeguard", "serde", @@ -7417,7 +7411,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits", "phantom_newtype", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rlp", "scopeguard", @@ -7475,7 +7469,7 @@ dependencies = [ "ic-sys", "ic-types", "json5", - "proptest 1.6.0", + "proptest", "proptest-derive", "serde", "tempfile", @@ -7543,7 +7537,7 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7866,7 +7860,7 @@ dependencies = [ "maplit", "mockall", "parking_lot", - "proptest 1.6.0", + "proptest", "proptest-derive", "prost 0.13.4", "rand 0.8.5", @@ -8001,7 +7995,7 @@ dependencies = [ "ic-protobuf", "ic-types", "num-bigint 0.4.6", - "proptest 1.6.0", + "proptest", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -8157,7 +8151,7 @@ dependencies = [ "mockall", "num_cpus", "parking_lot", - "proptest 1.6.0", + "proptest", "proptest-derive", "prost 0.13.4", "rand 0.8.5", @@ -8201,7 +8195,7 @@ dependencies = [ "ic-protobuf", "ic-types", "paste", - "proptest 1.6.0", + "proptest", "strum 0.26.3", ] @@ -8263,7 +8257,7 @@ dependencies = [ "ic-crypto-test-utils-reproducible-rng", "ic-protobuf", "ic-types", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -8315,7 +8309,7 @@ dependencies = [ "ic-crypto-test-utils-reproducible-rng", "ic-types", "parking_lot", - "proptest 1.6.0", + "proptest", "proptest-derive", "rand 0.8.5", "rand_chacha 0.3.1", @@ -8834,7 +8828,7 @@ dependencies = [ "ic-crypto-tree-hash-test-utils", "ic-protobuf", "maplit", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "serde", @@ -8851,7 +8845,7 @@ dependencies = [ "assert_matches", "ic-crypto-test-utils-reproducible-rng", "ic-crypto-tree-hash", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "test-strategy 0.4.0", "thiserror 2.0.12", @@ -8973,7 +8967,6 @@ dependencies = [ "ic-test-utilities-state", "ic-test-utilities-types", "ic-types", - "ic-wasm-types", "prometheus 0.13.4", "serde", "slog", @@ -9075,7 +9068,6 @@ dependencies = [ "ic-test-utilities-execution-environment", "ic-test-utilities-logger", "ic-test-utilities-state", - "ic-test-utilities-time", "ic-test-utilities-types", "ic-types", "ic-utils 0.9.0", @@ -9095,7 +9087,7 @@ dependencies = [ "num-traits", "pretty_assertions", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "rayon", "rustc-demangle", "scopeguard", @@ -9145,7 +9137,7 @@ dependencies = [ "ic-sha3 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "minicbor", "minicbor-derive", - "proptest 1.6.0", + "proptest", "serde", "serde_json", ] @@ -9160,7 +9152,6 @@ dependencies = [ "criterion", "escargot", "execution-environment-bench", - "hex", "ic-base-types", "ic-btc-interface", "ic-canister-sandbox-backend-lib", @@ -9216,7 +9207,7 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "regex", "rstest", @@ -9473,7 +9464,7 @@ dependencies = [ "mockall", "pretty_assertions", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "reqwest 0.12.15", @@ -9700,7 +9691,7 @@ dependencies = [ "ic-types", "mockall", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rand_chacha 0.3.1", "slog", @@ -9846,7 +9837,7 @@ dependencies = [ "num-traits", "once_cell", "pocket-ic", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "reqwest 0.12.15", "rolling-file", @@ -9935,7 +9926,7 @@ dependencies = [ "leb128", "num-bigint 0.4.6", "num-traits", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "serde", "serde_bytes", @@ -9999,7 +9990,7 @@ dependencies = [ "ic-types", "icrc-ledger-types", "num-traits", - "proptest 1.6.0", + "proptest", "scopeguard", "serde", "serde_bytes", @@ -10043,7 +10034,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.6.0", + "proptest", "serde", "serde_bytes", "test-strategy 0.4.0", @@ -10064,7 +10055,7 @@ dependencies = [ "ic-types", "icrc-ledger-types", "num-traits", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rand_chacha 0.3.1", "rosetta-core", @@ -10087,7 +10078,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.6.0", + "proptest", "serde", "test-strategy 0.4.0", ] @@ -10102,7 +10093,7 @@ dependencies = [ "ic-stable-structures 0.6.8", "minicbor", "num-traits", - "proptest 1.6.0", + "proptest", "serde", "test-strategy 0.4.0", ] @@ -10186,7 +10177,7 @@ dependencies = [ "ic-validator", "pprof", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "slog", "tokio", @@ -10210,7 +10201,7 @@ dependencies = [ "ic-types", "ic-wasm-types", "phantom_newtype", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "serde", "strum 0.26.3", @@ -10313,7 +10304,7 @@ dependencies = [ "ic-types", "icp-ledger", "on_wire", - "proptest 1.6.0", + "proptest", "reqwest 0.12.15", "rosetta-core", "rusqlite", @@ -10364,7 +10355,7 @@ dependencies = [ "ic-stable-structures 0.6.8", "minicbor", "num-traits", - "proptest 1.6.0", + "proptest", "serde", "serde_bytes", ] @@ -10411,7 +10402,7 @@ dependencies = [ "mockall", "num-traits", "paste", - "proptest 1.6.0", + "proptest", "scopeguard", "scraper", "serde", @@ -10441,7 +10432,7 @@ dependencies = [ "ic-universal-canister", "icrc-ledger-types", "paste", - "proptest 1.6.0", + "proptest", ] [[package]] @@ -10480,7 +10471,7 @@ dependencies = [ "icrc1-test-suite", "num-bigint 0.4.6", "num-traits", - "proptest 1.6.0", + "proptest", ] [[package]] @@ -10653,7 +10644,7 @@ dependencies = [ "mockall", "pretty_assertions", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rand_chacha 0.3.1", "random-traffic-test", @@ -10718,7 +10709,6 @@ dependencies = [ "ic-cdk-timers", "ic-stable-structures 0.7.0", "serde", - "serde_bytes", "serde_cbor", ] @@ -10862,7 +10852,7 @@ dependencies = [ "mockall", "num-traits", "priority-queue", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rust_decimal", "serde", @@ -11266,7 +11256,7 @@ dependencies = [ "ic-cdk", "ic-nervous-system-common", "lazy_static", - "proptest 1.6.0", + "proptest", "rust_decimal", "rust_decimal_macros", "serde", @@ -11463,7 +11453,7 @@ dependencies = [ "on_wire", "pretty_assertions", "prometheus-parse", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -12118,9 +12108,7 @@ dependencies = [ "ic-logger", "ic-metrics", "ic-replicated-state", - "ic-test-utilities", "ic-test-utilities-state", - "ic-test-utilities-time", "ic-types", "ic-types-test-utils", "prometheus 0.13.4", @@ -12808,8 +12796,6 @@ version = "0.9.0" dependencies = [ "assert_matches", "candid", - "canister-test", - "crossbeam-channel", "ic-base-types", "ic-btc-interface", "ic-btc-replica-types", @@ -12845,7 +12831,6 @@ dependencies = [ "maplit", "prost 0.13.4", "rand 0.8.5", - "slog", "slog-scope", "tempfile", "tokio", @@ -12888,7 +12873,6 @@ dependencies = [ "ic-test-utilities-io", "ic-test-utilities-metrics", "ic-test-utilities-state", - "ic-test-utilities-time", "ic-test-utilities-types", "ic-types", "ic-utils 0.9.0", @@ -12903,14 +12887,13 @@ dependencies = [ "num-traits", "phantom_newtype", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", "scoped_threadpool", "serde", - "serde_bytes", "serde_cbor", "slog", "static_assertions", @@ -12918,7 +12901,6 @@ dependencies = [ "strum_macros 0.26.4", "tempfile", "test-strategy 0.4.0", - "uuid", ] [[package]] @@ -13006,7 +12988,7 @@ dependencies = [ "on_wire", "pocket-ic", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -13291,7 +13273,7 @@ dependencies = [ "maplit", "num-traits", "pretty_assertions", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "prost-build 0.13.4", "rand 0.8.5", @@ -13493,7 +13475,7 @@ dependencies = [ "on_wire", "pretty-bytes", "pretty_assertions", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rust_decimal", @@ -13586,7 +13568,7 @@ dependencies = [ "lazy_static", "maplit", "pretty_assertions", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rust_decimal", "rust_decimal_macros", @@ -13818,7 +13800,7 @@ dependencies = [ "itertools 0.12.1", "libc", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "scoped_threadpool", "slog", @@ -13887,7 +13869,7 @@ dependencies = [ "ic-universal-canister", "ic-xnet-payload-builder", "maplit", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rcgen", "serde", @@ -13953,7 +13935,7 @@ dependencies = [ "nix 0.24.3", "parking_lot", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -14281,7 +14263,7 @@ dependencies = [ "nix 0.24.3", "parking_lot", "rand 0.8.5", - "rusty-fork 0.3.0", + "rusty-fork", "serde", "serde_cbor", "slog", @@ -14472,7 +14454,7 @@ dependencies = [ "ic-types", "ic-wasm-types", "mockall", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "rand_chacha 0.3.1", "strum 0.26.3", @@ -14674,12 +14656,12 @@ dependencies = [ "once_cell", "phantom_newtype", "pretty_assertions", - "proptest 1.6.0", + "proptest", "proptest-derive", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", - "rusty-fork 0.3.0", + "rusty-fork", "serde", "serde_bytes", "serde_cbor", @@ -14697,7 +14679,7 @@ version = "0.9.0" dependencies = [ "ic-protobuf", "ic-types", - "proptest 1.6.0", + "proptest", "strum 0.26.3", ] @@ -14757,7 +14739,7 @@ dependencies = [ "ic-heap-bytes", "ic-types", "lru", - "proptest 1.6.0", + "proptest", ] [[package]] @@ -15047,7 +15029,7 @@ dependencies = [ "mockall", "nix 0.24.3", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "reqwest 0.12.15", "slog", @@ -15373,7 +15355,7 @@ dependencies = [ "ic-state-machine-tests", "ic-types", "lazy_static", - "proptest 1.6.0", + "proptest", "serde", ] @@ -15425,7 +15407,7 @@ dependencies = [ "maplit", "on_wire", "pocket-ic", - "proptest 1.6.0", + "proptest", "prost 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", @@ -15471,7 +15453,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.6.0", + "proptest", ] [[package]] @@ -15522,7 +15504,7 @@ dependencies = [ "minicbor", "num-bigint 0.4.6", "num-traits", - "proptest 1.6.0", + "proptest", "serde", "serde_bytes", "sha2 0.10.9", @@ -15873,14 +15855,12 @@ dependencies = [ [[package]] name = "insta" -version = "1.42.1" +version = "1.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71c1b125e30d93896b365e156c33dadfffab45ee8400afcbba4752f59de08a86" +checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" dependencies = [ "console", - "linked-hash-map", "once_cell", - "pin-project", "similar", ] @@ -16513,7 +16493,7 @@ dependencies = [ "minicbor", "num-traits", "on_wire", - "proptest 1.6.0", + "proptest", "serde", "serde_bytes", "serde_cbor", @@ -17156,11 +17136,11 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memfd" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" dependencies = [ - "rustix 0.38.44", + "rustix 1.0.5", ] [[package]] @@ -17219,7 +17199,7 @@ dependencies = [ "libc", "memmap2", "nix 0.24.3", - "proptest 1.6.0", + "proptest", "rayon", "slog", "tempfile", @@ -19224,9 +19204,9 @@ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "postcard" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" dependencies = [ "cobs", "embedded-io 0.4.0", @@ -19537,26 +19517,6 @@ dependencies = [ "regex", ] -[[package]] -name = "proptest" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c477819b845fe023d33583ebf10c9f62518c8d79a0960ba5c36d6ac8a55a5b" -dependencies = [ - "bit-set 0.5.3", - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "num-traits", - "quick-error", - "rand 0.6.5", - "rand_chacha 0.1.1", - "rand_xorshift 0.1.1", - "regex-syntax 0.6.29", - "rusty-fork 0.2.2", - "tempfile", -] - [[package]] name = "proptest" version = "1.6.0" @@ -19572,7 +19532,7 @@ dependencies = [ "rand_chacha 0.3.1", "rand_xorshift 0.3.0", "regex-syntax 0.8.5", - "rusty-fork 0.3.0", + "rusty-fork", "tempfile", "unarray", ] @@ -20108,7 +20068,7 @@ dependencies = [ "ic-cdk", "ic-error-types 0.2.0", "ic-types", - "proptest 1.6.0", + "proptest", "rand 0.8.5", "serde", "serde_bytes", @@ -20896,7 +20856,7 @@ dependencies = [ "lazy_static", "num-bigint 0.4.6", "prometheus 0.13.4", - "proptest 1.6.0", + "proptest", "serde", "serde_bytes", "serde_json", @@ -21390,18 +21350,6 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" -[[package]] -name = "rusty-fork" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd93264e10c577503e926bd1430193eeb5d21b059148910082245309b424fae" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - [[package]] name = "rusty-fork" version = "0.3.0" @@ -24064,7 +24012,7 @@ dependencies = [ "ic-crypto-tree-hash", "leb128", "maplit", - "proptest 1.6.0", + "proptest", "proptest-derive", "serde", "test-strategy 0.4.0", diff --git a/packages/ic-error-types/Cargo.toml b/packages/ic-error-types/Cargo.toml index 6a31c39ce639..48bfda9e95db 100644 --- a/packages/ic-error-types/Cargo.toml +++ b/packages/ic-error-types/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "ic-error-types" -version = "0.2.0" -license = "Apache-2.0" +authors.workspace = true +categories = ["api-bindings", "development-tools"] description = "Error types of the Internet Computer" -repository = "https://github.com/dfinity/ic" documentation = "https://docs.rs/ic-error-types/latest/ic_error_types/" -readme = "README.md" -categories = ["api-bindings", "development-tools"] -keywords = ["icp", "error", "smart-contract", "internet-computer"] -include = ["src", "Cargo.toml", "CHANGELOG.md", "README.md", "LICENSE"] -authors.workspace = true edition.workspace = true +include = ["CHANGELOG.md", "Cargo.toml", "LICENSE", "README.md", "src"] +keywords = ["error", "icp", "internet-computer", "smart-contract"] +license = "Apache-2.0" +name = "ic-error-types" +readme = "README.md" +repository = "https://github.com/dfinity/ic" +version = "0.2.0" [dependencies] ic-heap-bytes = { path = "../ic-heap-bytes" } diff --git a/rs/bitcoin/consensus/BUILD.bazel b/rs/bitcoin/consensus/BUILD.bazel index 50b3377eddb1..228cab2030ba 100644 --- a/rs/bitcoin/consensus/BUILD.bazel +++ b/rs/bitcoin/consensus/BUILD.bazel @@ -19,8 +19,6 @@ rust_library( "//rs/monitoring/logger", "//rs/monitoring/metrics", "//rs/protobuf", - "//rs/registry/helpers", - "//rs/registry/subnet_features", "//rs/replicated_state", "//rs/types/types", "@crate_index//:prometheus", @@ -38,33 +36,16 @@ rust_test( ], deps = [ # Keep sorted. - "//packages/ic-error-types", - "//rs/bitcoin/replica_types", - "//rs/config", - "//rs/interfaces", "//rs/interfaces/adapter_client", "//rs/interfaces/registry", "//rs/interfaces/registry/mocks", "//rs/interfaces/state_manager", "//rs/interfaces/state_manager/mocks", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/protobuf", - "//rs/registry/helpers", - "//rs/registry/subnet_features", - "//rs/replicated_state", "//rs/test_utilities", "//rs/test_utilities/logger", "//rs/test_utilities/state", - "//rs/test_utilities/time", "//rs/test_utilities/types", - "//rs/types/types", - "@crate_index//:ic-btc-interface", "@crate_index//:mockall", - "@crate_index//:prometheus", "@crate_index//:proptest", - "@crate_index//:prost", - "@crate_index//:slog", - "@crate_index//:thiserror", ], ) diff --git a/rs/bitcoin/consensus/Cargo.toml b/rs/bitcoin/consensus/Cargo.toml index da71bba88933..022ab5978a67 100644 --- a/rs/bitcoin/consensus/Cargo.toml +++ b/rs/bitcoin/consensus/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ic-btc-consensus" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-btc-consensus" +version.workspace = true [dependencies] ic-btc-replica-types = { path = "../replica_types" } @@ -17,8 +17,6 @@ ic-interfaces-state-manager = { path = "../../interfaces/state_manager" } ic-logger = { path = "../../monitoring/logger" } ic-metrics = { path = "../../monitoring/metrics" } ic-protobuf = { path = "../../protobuf" } -ic-registry-client-helpers = { path = "../../registry/helpers" } -ic-registry-subnet-features = { path = "../../registry/subnet_features" } ic-replicated-state = { path = "../../replicated_state" } ic-types = { path = "../../types/types" } prometheus = { workspace = true } @@ -32,7 +30,6 @@ ic-interfaces-state-manager-mocks = { path = "../../interfaces/state_manager/moc ic-test-utilities = { path = "../../test_utilities" } ic-test-utilities-logger = { path = "../../test_utilities/logger" } ic-test-utilities-state = { path = "../../test_utilities/state" } -ic-test-utilities-time = { path = "../../test_utilities/time" } ic-test-utilities-types = { path = "../../test_utilities/types" } mockall = { workspace = true } proptest = { workspace = true } diff --git a/rs/bitcoin/replica_types/Cargo.toml b/rs/bitcoin/replica_types/Cargo.toml index d564a5415c32..ceb59cb6bec7 100644 --- a/rs/bitcoin/replica_types/Cargo.toml +++ b/rs/bitcoin/replica_types/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ic-btc-replica-types" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-btc-replica-types" +version.workspace = true [dependencies] candid = { workspace = true } diff --git a/rs/bitcoin/validation/BUILD.bazel b/rs/bitcoin/validation/BUILD.bazel index e89314fce64e..1f9fbc29d712 100644 --- a/rs/bitcoin/validation/BUILD.bazel +++ b/rs/bitcoin/validation/BUILD.bazel @@ -22,10 +22,7 @@ rust_test( ], deps = [ # Keep sorted. - "@crate_index//:bitcoin", "@crate_index//:csv", - "@crate_index//:hex", - "@crate_index//:proptest", "@crate_index//:rstest", ], ) @@ -37,13 +34,4 @@ rust_test_suite( # Keep sorted. "tests/data/headers.csv", ], - deps = [ - # Keep sorted. - ":validation", - "@crate_index//:bitcoin", - "@crate_index//:csv", - "@crate_index//:hex", - "@crate_index//:proptest", - "@crate_index//:rstest", - ], ) diff --git a/rs/bitcoin/validation/Cargo.toml b/rs/bitcoin/validation/Cargo.toml index e0f27a008b89..170b0eba2f0a 100644 --- a/rs/bitcoin/validation/Cargo.toml +++ b/rs/bitcoin/validation/Cargo.toml @@ -1,18 +1,16 @@ [package] -name = "ic-btc-validation" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-btc-validation" +version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] bitcoin = { workspace = true } -hex = { workspace = true } [dev-dependencies] csv = "1.1" -proptest = "0.9.4" rstest = { workspace = true } diff --git a/rs/canister_sandbox/BUILD.bazel b/rs/canister_sandbox/BUILD.bazel index 2f514b196874..64874bc4ea10 100644 --- a/rs/canister_sandbox/BUILD.bazel +++ b/rs/canister_sandbox/BUILD.bazel @@ -4,77 +4,44 @@ load("//bazel:defs.bzl", "rust_ic_test") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//rs/config", - "//rs/cycles_account_manager", - "//rs/embedders", - "//rs/interfaces", - "//rs/interfaces/state_manager", - "//rs/limits", - "//rs/memory_tracker", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/registry/subnet_type", - "//rs/replicated_state", - "//rs/sys", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "//rs/types/wasm_types", - "//rs/utils", - "@crate_index//:bincode", - "@crate_index//:bytes", - "@crate_index//:lazy_static", - "@crate_index//:libc", - "@crate_index//:libflate", - "@crate_index//:nix", - "@crate_index//:num-traits", - "@crate_index//:once_cell", - "@crate_index//:prometheus", - "@crate_index//:rayon", - "@crate_index//:regex", - "@crate_index//:serde", - "@crate_index//:serde_bytes", - "@crate_index//:serde_json", - "@crate_index//:slog", - "@crate_index//:threadpool", - "@crate_index//:which", -] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//packages/ic-error-types", - "//rs/registry/routing_table", - "//rs/test_utilities", - "//rs/test_utilities/execution_environment", - "//rs/test_utilities/metrics", - "//rs/test_utilities/types", - "@crate_index//:mockall", - "@crate_index//:rand", - "@crate_index//:rstest", - "@crate_index//:slog-async", - "@crate_index//:slog-term", - "@crate_index//:tempfile", - "@crate_index//:wat", -] - -MACRO_DEPENDENCIES = [] - -ALIASES = {} - rust_library( name = "backend_lib", srcs = glob(["src/**/*.rs"]), - aliases = ALIASES, crate_features = select({ "//bazel:fuzzing_code_enabled": ["fuzzing_code"], "//conditions:default": [], }), crate_name = "ic_canister_sandbox_backend_lib", - proc_macro_deps = MACRO_DEPENDENCIES, version = "0.9.0", - deps = DEPENDENCIES + select({ + deps = [ + # Keep sorted. + "//rs/config", + "//rs/embedders", + "//rs/interfaces", + "//rs/interfaces/state_manager", + "//rs/monitoring/logger", + "//rs/monitoring/metrics", + "//rs/replicated_state", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/wasm_types", + "@crate_index//:bincode", + "@crate_index//:bytes", + "@crate_index//:lazy_static", + "@crate_index//:libc", + "@crate_index//:nix", + "@crate_index//:num-traits", + "@crate_index//:once_cell", + "@crate_index//:prometheus", + "@crate_index//:rayon", + "@crate_index//:regex", + "@crate_index//:serde", + "@crate_index//:serde_bytes", + "@crate_index//:serde_json", + "@crate_index//:slog", + "@crate_index//:threadpool", + "@crate_index//:which", + ] + select({ "//bazel:fuzzing_code_enabled": ["@crate_index//:object"], "//conditions:default": [], }), @@ -82,7 +49,6 @@ rust_library( rust_ic_test( name = "backend_lib_test", - aliases = ALIASES, crate = ":backend_lib", data = [ "//rs/universal_canister/impl:universal_canister.module", @@ -92,8 +58,26 @@ rust_ic_test( "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", "UNIVERSAL_CANISTER_SERIALIZED_MODULE_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.module)", }, - proc_macro_deps = MACRO_DEPENDENCIES, - deps = DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//packages/ic-error-types", + "//rs/cycles_account_manager", + "//rs/limits", + "//rs/registry/subnet_type", + "//rs/test_utilities", + "//rs/test_utilities/execution_environment", + "//rs/test_utilities/metrics", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/wasm_types", + "@crate_index//:mockall", + "@crate_index//:rand", + "@crate_index//:rstest", + "@crate_index//:slog-async", + "@crate_index//:slog-term", + "@crate_index//:tempfile", + "@crate_index//:wat", + ], ) cargo_build_script( @@ -106,9 +90,7 @@ cargo_build_script( rust_binary( name = "canister_sandbox", srcs = ["bin/canister_sandbox.rs"], - aliases = ALIASES, crate_name = "canister_sandbox", - proc_macro_deps = MACRO_DEPENDENCIES, version = "0.9.0", deps = [ # Keep sorted. @@ -128,9 +110,8 @@ rust_binary( rust_binary( name = "test_controller", srcs = ["bin/test_controller.rs"], - aliases = ALIASES, - proc_macro_deps = MACRO_DEPENDENCIES, - deps = DEPENDENCIES + [ + deps = [ + # Keep sorted. ":backend_lib", "@crate_index//:tempfile", ], @@ -139,12 +120,7 @@ rust_binary( rust_binary( name = "test_sandbox", srcs = ["bin/test_sandbox.rs"], - aliases = ALIASES, - proc_macro_deps = MACRO_DEPENDENCIES, - deps = DEPENDENCIES + [ - ":backend_lib", - "@crate_index//:tempfile", - ], + deps = [":backend_lib"], ) rust_binary( diff --git a/rs/canister_sandbox/Cargo.toml b/rs/canister_sandbox/Cargo.toml index 94e3c8c5cbe5..0f756c2356e4 100644 --- a/rs/canister_sandbox/Cargo.toml +++ b/rs/canister_sandbox/Cargo.toml @@ -24,17 +24,14 @@ ic-management-canister-types-private = { path = "../types/management_canister_ty ic-metrics = { path = "../monitoring/metrics" } ic-registry-subnet-type = { path = "../registry/subnet_type" } ic-replicated-state = { path = "../replicated_state" } -ic-sys = { path = "../sys" } ic-types = { path = "../types/types" } -ic-utils = { path = "../utils" } ic-wasm-types = { path = "../types/wasm_types" } lazy_static = { workspace = true } libc = { workspace = true } -libflate = { workspace = true } memory_tracker = { path = "../memory_tracker" } nix = { workspace = true } num-traits = { workspace = true } -object = { workspace = true, optional = true} +object = { workspace = true, optional = true } once_cell = "1.8" prometheus = { workspace = true } rayon = { workspace = true } @@ -49,7 +46,6 @@ which = "4.2.2" [dev-dependencies] ic-error-types = { path = "../../packages/ic-error-types" } -ic-registry-routing-table = { path = "../registry/routing_table" } ic-test-utilities = { path = "../test_utilities" } ic-test-utilities-execution-environment = { path = "../test_utilities/execution_environment" } ic-test-utilities-metrics = { path = "../test_utilities/metrics" } @@ -66,8 +62,8 @@ slog-term = { workspace = true } wat = { workspace = true } [features] -sigsegv_handler_checksum = ["memory_tracker/sigsegv_handler_checksum"] fuzzing_code = ["dep:object"] +sigsegv_handler_checksum = ["memory_tracker/sigsegv_handler_checksum"] [[bin]] name = "canister_sandbox" diff --git a/rs/cycles_account_manager/BUILD.bazel b/rs/cycles_account_manager/BUILD.bazel index cc99b6e41fa7..47903a88aa9a 100644 --- a/rs/cycles_account_manager/BUILD.bazel +++ b/rs/cycles_account_manager/BUILD.bazel @@ -2,49 +2,56 @@ load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//rs/config", - "//rs/interfaces", - "//rs/monitoring/logger", - "//rs/nns/constants", - "//rs/registry/subnet_type", - "//rs/replicated_state", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "@crate_index//:prometheus", - "@crate_index//:serde", - "@crate_index//:slog", -] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//rs/limits", - "//rs/test_utilities", - "//rs/test_utilities/logger", - "//rs/test_utilities/state", - "//rs/test_utilities/types", - "//rs/types/wasm_types", - "@crate_index//:candid", -] - rust_library( name = "cycles_account_manager", srcs = glob(["src/**"]), crate_name = "ic_cycles_account_manager", version = "0.9.0", - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/config", + "//rs/interfaces", + "//rs/monitoring/logger", + "//rs/nns/constants", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:prometheus", + "@crate_index//:serde", + "@crate_index//:slog", + ], ) rust_test( name = "cycles_account_manager_test", crate = ":cycles_account_manager", - deps = DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/test_utilities/types", + "@crate_index//:candid", + ], ) rust_test( name = "cycles_account_manager_integration", srcs = glob(["tests/**/*.rs"]), - deps = [":cycles_account_manager"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [":cycles_account_manager"] + [ + # Keep sorted. + "//rs/config", + "//rs/interfaces", + "//rs/limits", + "//rs/monitoring/logger", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/test_utilities", + "//rs/test_utilities/logger", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:prometheus", + ], ) diff --git a/rs/cycles_account_manager/Cargo.toml b/rs/cycles_account_manager/Cargo.toml index 8deb0286fd2f..e1a51501457a 100644 --- a/rs/cycles_account_manager/Cargo.toml +++ b/rs/cycles_account_manager/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ic-cycles-account-manager" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-cycles-account-manager" +version.workspace = true [dependencies] ic-base-types = { path = "../types/base_types" } @@ -27,4 +27,3 @@ ic-test-utilities = { path = "../test_utilities" } ic-test-utilities-logger = { path = "../test_utilities/logger" } ic-test-utilities-state = { path = "../test_utilities/state" } ic-test-utilities-types = { path = "../test_utilities/types" } -ic-wasm-types = { path = "../types/wasm_types" } diff --git a/rs/determinism_test/BUILD.bazel b/rs/determinism_test/BUILD.bazel index 9bac91678262..62e1f7b9873c 100644 --- a/rs/determinism_test/BUILD.bazel +++ b/rs/determinism_test/BUILD.bazel @@ -3,33 +3,6 @@ load("//bazel:defs.bzl", "rust_ic_test_suite") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//rs/config", - "//rs/cycles_account_manager", - "//rs/execution_environment", - "//rs/interfaces", - "//rs/interfaces/state_manager", - "//rs/messaging", - "//rs/monitoring/metrics", - "//rs/protobuf", - "//rs/registry/client", - "//rs/registry/keys", - "//rs/registry/proto_data_provider", - "//rs/registry/provisional_whitelist", - "//rs/registry/routing_table", - "//rs/registry/subnet_type", - "//rs/state_manager", - "//rs/test_utilities/consensus", - "//rs/test_utilities/registry", - "//rs/test_utilities/types", - "//rs/types/management_canister_types", - "//rs/types/types", - "@crate_index//:slog", - "@crate_index//:tokio", - "@crate_index//:wat", -] - rust_library( name = "determinism_test", testonly = True, @@ -38,7 +11,32 @@ rust_library( crate_name = "ic_determinism_test", proc_macro_deps = [], version = "0.9.0", - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/config", + "//rs/cycles_account_manager", + "//rs/execution_environment", + "//rs/interfaces", + "//rs/interfaces/state_manager", + "//rs/messaging", + "//rs/monitoring/metrics", + "//rs/protobuf", + "//rs/registry/client", + "//rs/registry/keys", + "//rs/registry/proto_data_provider", + "//rs/registry/provisional_whitelist", + "//rs/registry/routing_table", + "//rs/registry/subnet_type", + "//rs/state_manager", + "//rs/test_utilities/consensus", + "//rs/test_utilities/registry", + "//rs/test_utilities/types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:slog", + "@crate_index//:tokio", + "@crate_index//:wat", + ], ) rust_test( @@ -46,7 +44,6 @@ rust_test( aliases = {}, crate = ":determinism_test", proc_macro_deps = [], - deps = DEPENDENCIES, ) rust_ic_test_suite( @@ -54,5 +51,5 @@ rust_ic_test_suite( srcs = glob(["tests/**/*.rs"]), aliases = {}, proc_macro_deps = [], - deps = [":determinism_test"] + DEPENDENCIES, + deps = [":determinism_test"], ) diff --git a/rs/determinism_test/Cargo.toml b/rs/determinism_test/Cargo.toml index 0e65fe3ad0bb..2603ec6f2275 100644 --- a/rs/determinism_test/Cargo.toml +++ b/rs/determinism_test/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ic-determinism-test" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-determinism-test" +version.workspace = true [dependencies] ic-config = { path = "../config" } @@ -29,4 +29,5 @@ ic-test-utilities-types = { path = "../test_utilities/types" } ic-types = { path = "../types/types" } slog = { workspace = true } tokio = { workspace = true } + wat = { workspace = true } diff --git a/rs/embedders/BUILD.bazel b/rs/embedders/BUILD.bazel index a714860454b2..85e67af2b0fd 100644 --- a/rs/embedders/BUILD.bazel +++ b/rs/embedders/BUILD.bazel @@ -5,85 +5,6 @@ load("//rs/tests:common.bzl", "UNIVERSAL_CANISTER_ENV", "UNIVERSAL_CANISTER_RUNT package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//packages/ic-error-types", - "//packages/ic-heap-bytes", - "//rs/config", - "//rs/cycles_account_manager", - "//rs/interfaces", - "//rs/limits", - "//rs/memory_tracker", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/nns/constants", - "//rs/registry/subnet_type", - "//rs/replicated_state", - "//rs/sys", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "//rs/types/wasm_types", - "//rs/utils", - "//rs/utils/lru_cache", - "//rs/wasm_transform", - "@crate_index//:anyhow", - "@crate_index//:bincode", - "@crate_index//:ic-btc-interface", - "@crate_index//:itertools", - "@crate_index//:libc", - "@crate_index//:libflate", - "@crate_index//:nix", - "@crate_index//:num-traits", - "@crate_index//:prometheus", - "@crate_index//:rayon", - "@crate_index//:rustc-demangle", - "@crate_index//:scopeguard", - "@crate_index//:serde", - "@crate_index//:serde_bytes", - "@crate_index//:slog", - "@crate_index//:slog-term", - "@crate_index//:tempfile", - "@crate_index//:wasm-encoder", - "@crate_index//:wasmparser", - "@crate_index//:wasmprinter", - "@crate_index//:wasmtime", - "@crate_index//:wasmtime-environ", -] - -MACRO_DEPENDENCIES = [] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//rs/registry/routing_table", - "//rs/rust_canisters/canister_test", - "//rs/test_utilities", - "//rs/test_utilities/embedders", - "//rs/test_utilities/execution_environment", - "//rs/test_utilities/logger", - "//rs/test_utilities/state", - "//rs/test_utilities/time", - "//rs/test_utilities/types", - "@crate_index//:assert_matches", - "@crate_index//:candid", - "@crate_index//:criterion", - "@crate_index//:insta", - "@crate_index//:lazy_static", - "@crate_index//:maplit", - "@crate_index//:more-asserts", - "@crate_index//:pretty_assertions", - "@crate_index//:proptest", - "@crate_index//:strum", - "@crate_index//:wast", - "@crate_index//:wat", -] - -MACRO_DEV_DEPENDENCIES = [ - "@crate_index//:strum_macros", -] - -ALIASES = {} - DATA = [ "//rs/rust_canisters/stable_structures:stable_structures_canister", "//rs/nns/governance:governance-bench-canister", @@ -97,48 +18,120 @@ ENV = { rust_library( name = "embedders", srcs = glob(["src/**/*.rs"]), - aliases = ALIASES, crate_name = "ic_embedders", - proc_macro_deps = MACRO_DEPENDENCIES, rustc_flags = select({ "//bazel:fuzzing_code_enabled": DEFAULT_RUSTC_FLAGS_FOR_FUZZING, "//conditions:default": [], }), version = "0.9.0", - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//packages/ic-error-types", + "//packages/ic-heap-bytes", + "//rs/config", + "//rs/cycles_account_manager", + "//rs/interfaces", + "//rs/limits", + "//rs/memory_tracker", + "//rs/monitoring/logger", + "//rs/monitoring/metrics", + "//rs/nns/constants", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/sys", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/wasm_types", + "//rs/utils", + "//rs/utils/lru_cache", + "//rs/wasm_transform", + "@crate_index//:anyhow", + "@crate_index//:bincode", + "@crate_index//:ic-btc-interface", + "@crate_index//:itertools", + "@crate_index//:libc", + "@crate_index//:libflate", + "@crate_index//:nix", + "@crate_index//:num-traits", + "@crate_index//:prometheus", + "@crate_index//:rustc-demangle", + "@crate_index//:scopeguard", + "@crate_index//:serde", + "@crate_index//:serde_bytes", + "@crate_index//:slog", + "@crate_index//:tempfile", + "@crate_index//:wasm-encoder", + "@crate_index//:wasmparser", + "@crate_index//:wasmprinter", + "@crate_index//:wasmtime", + "@crate_index//:wasmtime-environ", + ], ) rust_binary( name = "instrument-wasm", srcs = ["bin/instrument_wasm.rs"], - aliases = ALIASES, - proc_macro_deps = MACRO_DEPENDENCIES, - deps = DEPENDENCIES + [ + deps = [ + # Keep sorted. ":embedders", + "//rs/config", + "@crate_index//:bincode", "@crate_index//:clap", + "@crate_index//:slog", + "@crate_index//:slog-term", ], ) rust_test( name = "embedders_test", - aliases = ALIASES, crate = ":embedders", - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/interfaces", + "//rs/test_utilities", + "//rs/test_utilities/types", + "@crate_index//:assert_matches", + "@crate_index//:candid", + "@crate_index//:lazy_static", + "@crate_index//:maplit", + "@crate_index//:proptest", + "@crate_index//:wat", + ], ) rust_test( name = "instrumentation", srcs = ["tests/instrumentation.rs"], - aliases = ALIASES, crate_root = "tests/instrumentation.rs", data = glob(["tests/instrumentation-test-data/*"]) + glob(["tests/snapshots/*"]), env = { "CARGO_MANIFEST_DIR": "rs/embedders", "INSTA_WORKSPACE_ROOT": ".", }, - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = [":embedders"] + DEPENDENCIES + DEV_DEPENDENCIES, + proc_macro_deps = [ + # "@crate_index//:strum_macros", + ], + deps = [ + # Keep sorted. + ":embedders", + "//rs/config", + "//rs/interfaces", + "//rs/monitoring/logger", + "//rs/replicated_state", + "//rs/sys", + "//rs/test_utilities/embedders", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/wasm_types", + "//rs/wasm_transform", + "@crate_index//:insta", + "@crate_index//:itertools", + "@crate_index//:pretty_assertions", + "@crate_index//:wasmparser", + "@crate_index//:wasmprinter", + "@crate_index//:wat", + ], ) # Run some tests using wasm spec files. @@ -158,7 +151,6 @@ rust_ic_test_suite_with_extra_srcs( "tests/sandbox_safe_system_state.rs", ], ), - aliases = ALIASES, compile_data = glob(["tests/instrumentation-test-data/*"]), data = DATA + [ "//rs/universal_canister/impl:universal_canister.module", @@ -183,8 +175,45 @@ rust_ic_test_suite_with_extra_srcs( "tests/wasmtime_simple.rs", "tests/instrumentation.rs", ], - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = [":embedders"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + ":embedders", + "//packages/ic-error-types", + "//rs/config", + "//rs/cycles_account_manager", + "//rs/interfaces", + "//rs/monitoring/logger", + "//rs/nns/constants", + "//rs/registry/routing_table", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/rust_canisters/canister_test", + "//rs/sys", + "//rs/test_utilities", + "//rs/test_utilities/embedders", + "//rs/test_utilities/execution_environment", + "//rs/test_utilities/logger", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/wasm_types", + "//rs/wasm_transform", + "@crate_index//:anyhow", + "@crate_index//:assert_matches", + "@crate_index//:lazy_static", + "@crate_index//:libc", + "@crate_index//:maplit", + "@crate_index//:proptest", + "@crate_index//:wasm-encoder", + "@crate_index//:wasmparser", + "@crate_index//:wasmprinter", + "@crate_index//:wasmtime", + "@crate_index//:wasmtime-environ", + "@crate_index//:wast", + "@crate_index//:wat", + ], ) rust_test( @@ -194,7 +223,29 @@ rust_test( "tests/system_api.rs", ], crate_root = "tests/system_api.rs", - deps = [":embedders"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + ":embedders", + "//packages/ic-error-types", + "//rs/config", + "//rs/cycles_account_manager", + "//rs/interfaces", + "//rs/limits", + "//rs/monitoring/logger", + "//rs/nns/constants", + "//rs/registry/routing_table", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/test_utilities", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:maplit", + "@crate_index//:more-asserts", + "@crate_index//:strum", + ], ) rust_test( @@ -204,7 +255,27 @@ rust_test( "tests/sandbox_safe_system_state.rs", ], crate_root = "tests/sandbox_safe_system_state.rs", - deps = [":embedders"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + ":embedders", + "//rs/config", + "//rs/cycles_account_manager", + "//rs/interfaces", + "//rs/limits", + "//rs/monitoring/logger", + "//rs/nns/constants", + "//rs/registry/routing_table", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/test_utilities", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:maplit", + "@crate_index//:prometheus", + ], ) rust_library( @@ -213,10 +284,16 @@ rust_library( srcs = [ "benches/embedders_bench/src/lib.rs", ], - aliases = ALIASES, - proc_macro_deps = MACRO_DEPENDENCIES, version = "0.9.0", - deps = DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/rust_canisters/canister_test", + "//rs/test_utilities/execution_environment", + "//rs/types/types", + "//rs/wasm_transform", + "@crate_index//:candid", + "@crate_index//:criterion", + ], ) UNIVERSAL_CANISTER_TEST_DEPS = UNIVERSAL_CANISTER_RUNTIME_DEPS + [ @@ -237,9 +314,20 @@ rust_ic_bench( test_name = "compilation_bench_test", test_timeout = "long", deps = [ + # Keep sorted. ":embedders", ":embedders_bench", - ] + DEPENDENCIES + DEV_DEPENDENCIES, + "//rs/config", + "//rs/monitoring/logger", + "//rs/rust_canisters/canister_test", + "//rs/types/wasm_types", + "@crate_index//:candid", + "@crate_index//:criterion", + "@crate_index//:lazy_static", + "@crate_index//:libflate", + "@crate_index//:rayon", + "@crate_index//:wat", + ], ) rust_ic_bench( @@ -251,7 +339,14 @@ rust_ic_bench( deps = [ # Keep sorted. ":embedders_bench", - ] + DEPENDENCIES + DEV_DEPENDENCIES, + "//rs/replicated_state", + "//rs/rust_canisters/canister_test", + "//rs/sys", + "@crate_index//:candid", + "@crate_index//:criterion", + "@crate_index//:lazy_static", + "@crate_index//:wat", + ], ) rust_ic_bench( @@ -261,9 +356,17 @@ rust_ic_bench( compile_data = glob(["benches/test-data/*"]), data = DATA + UNIVERSAL_CANISTER_TEST_DEPS, env = ENV | UNIVERSAL_CANISTER_TEST_ENV, - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, + proc_macro_deps = [ + # Keep sorted. + "@crate_index//:strum_macros", + ], deps = [ # Keep sorted. ":embedders_bench", - ] + DEPENDENCIES + DEV_DEPENDENCIES, + "//rs/replicated_state", + "//rs/sys", + "@crate_index//:criterion", + "@crate_index//:strum", + "@crate_index//:wat", + ], ) diff --git a/rs/embedders/Cargo.toml b/rs/embedders/Cargo.toml index 719c79d973e3..282f59c999f9 100644 --- a/rs/embedders/Cargo.toml +++ b/rs/embedders/Cargo.toml @@ -10,21 +10,21 @@ version.workspace = true anyhow = { workspace = true } bincode = { workspace = true } clap = { workspace = true } +ic-base-types = { path = "../types/base_types" } ic-btc-interface = { workspace = true } ic-config = { path = "../config" } ic-cycles-account-manager = { path = "../cycles_account_manager" } -ic-heap-bytes = { path = "../../packages/ic-heap-bytes" } ic-error-types = { path = "../../packages/ic-error-types" } +ic-heap-bytes = { path = "../../packages/ic-heap-bytes" } ic-interfaces = { path = "../interfaces" } +ic-limits = { path = "../limits" } ic-logger = { path = "../monitoring/logger" } ic-management-canister-types-private = { path = "../types/management_canister_types" } ic-metrics = { path = "../monitoring/metrics" } +ic-nns-constants = { path = "../nns/constants" } ic-registry-subnet-type = { path = "../registry/subnet_type" } ic-replicated-state = { path = "../replicated_state" } ic-sys = { path = "../sys" } -ic-base-types = { path = "../types/base_types" } -ic-limits = { path = "../limits" } -ic-nns-constants = { path = "../nns/constants" } ic-types = { path = "../types/types" } ic-utils = { path = "../utils" } ic-utils-lru-cache = { path = "../utils/lru_cache" } @@ -68,14 +68,12 @@ candid = { workspace = true } canister-test = { path = "../rust_canisters/canister_test" } criterion = { workspace = true } embedders_bench = { path = "benches/embedders_bench" } -ic-base-types = { path = "../types/base_types" } ic-registry-routing-table = { path = "../registry/routing_table" } ic-test-utilities = { path = "../test_utilities" } ic-test-utilities-embedders = { path = "../test_utilities/embedders" } ic-test-utilities-execution-environment = { path = "../test_utilities/execution_environment" } ic-test-utilities-logger = { path = "../test_utilities/logger" } ic-test-utilities-state = { path = "../test_utilities/state" } -ic-test-utilities-time = { path = "../test_utilities/time" } ic-test-utilities-types = { path = "../test_utilities/types" } insta = "1.8.0" lazy_static = { workspace = true } @@ -83,7 +81,6 @@ maplit = "1.0.2" more-asserts = "0.3.1" pretty_assertions = { workspace = true } proptest = { workspace = true } -slog = { workspace = true } strum = { workspace = true } strum_macros = { workspace = true } wasmprinter = { workspace = true } diff --git a/rs/embedders/fuzz/BUILD.bazel b/rs/embedders/fuzz/BUILD.bazel index 3eb4277071e3..12f9cdff0aea 100644 --- a/rs/embedders/fuzz/BUILD.bazel +++ b/rs/embedders/fuzz/BUILD.bazel @@ -6,8 +6,6 @@ package(default_visibility = [ "//rs/execution_environment/fuzz:__subpackages__", ]) -MACRO_DEPENDENCIES = [] - rust_library( name = "wasm_fuzzers", testonly = True, @@ -16,7 +14,6 @@ rust_library( "//bazel:fuzzing_code_enabled": ["fuzzing_code"], "//conditions:default": [], }), - proc_macro_deps = MACRO_DEPENDENCIES, rustc_flags = select({ "//bazel:fuzzing_code_enabled": DEFAULT_RUSTC_FLAGS_FOR_FUZZING, "//conditions:default": [], @@ -35,7 +32,6 @@ rust_library( "//rs/test_utilities", "//rs/test_utilities/embedders", "//rs/test_utilities/state", - "//rs/test_utilities/time", "//rs/test_utilities/types", "//rs/types/management_canister_types", "//rs/types/types", @@ -45,7 +41,6 @@ rust_library( "@crate_index//:lazy_static", "@crate_index//:libfuzzer-sys", "@crate_index//:num-traits", - "@crate_index//:tempfile", "@crate_index//:tokio", "@crate_index//:wasm-encoder", "@crate_index//:wasm-smith", @@ -72,7 +67,6 @@ rust_binary( "//rs/config", "//rs/embedders", "//rs/monitoring/logger", - "//rs/replicated_state", "@crate_index//:arbitrary", "@crate_index//:clap", "@crate_index//:wasmprinter", @@ -84,7 +78,6 @@ rust_fuzz_test_binary( srcs = [ "fuzz_targets/execute_with_wasmtime.rs", ], - proc_macro_deps = MACRO_DEPENDENCIES, deps = [":wasm_fuzzers"] + ["@crate_index//:libfuzzer-sys"], ) @@ -93,7 +86,6 @@ rust_fuzz_test_binary_afl( srcs = [ "fuzz_targets/execute_with_wasmtime.rs", ], - proc_macro_deps = MACRO_DEPENDENCIES, deps = [":wasm_fuzzers"] + ["@crate_index//:libfuzzer-sys"], ) @@ -102,7 +94,6 @@ rust_fuzz_test_binary_afl( srcs = [ "fuzz_targets/differential_simd_execute_with_wasmtime.rs", ], - proc_macro_deps = MACRO_DEPENDENCIES, deps = [":wasm_fuzzers"] + ["@crate_index//:libfuzzer-sys"], ) @@ -111,7 +102,6 @@ rust_fuzz_test_binary( srcs = [ "fuzz_targets/execute_with_wasm_executor.rs", ], - proc_macro_deps = MACRO_DEPENDENCIES, deps = [":wasm_fuzzers"] + ["@crate_index//:libfuzzer-sys"], ) @@ -120,13 +110,11 @@ rust_fuzz_test_binary_afl( srcs = [ "fuzz_targets/execute_with_wasm_executor.rs", ], - proc_macro_deps = MACRO_DEPENDENCIES, deps = [":wasm_fuzzers"] + ["@crate_index//:libfuzzer-sys"], ) rust_fuzz_test_binary_afl( name = "compile_wasm_using_embedder", srcs = ["fuzz_targets/compile_wasm_using_embedder.rs"], - proc_macro_deps = MACRO_DEPENDENCIES, deps = [":wasm_fuzzers"] + ["@crate_index//:libfuzzer-sys"], ) diff --git a/rs/execution_environment/BUILD.bazel b/rs/execution_environment/BUILD.bazel index fbd4e17220cc..4e79b1aea912 100644 --- a/rs/execution_environment/BUILD.bazel +++ b/rs/execution_environment/BUILD.bazel @@ -3,135 +3,106 @@ load("//bazel:defs.bzl", "rust_ic_bench", "rust_ic_test", "rust_ic_test_suite") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//packages/ic-error-types", - "//packages/ic-heap-bytes", - "//rs/canister_sandbox:backend_lib", - "//rs/config", - "//rs/crypto/prng", - "//rs/crypto/sha2", - "//rs/crypto/tree_hash", - "//rs/crypto/utils/canister_threshold_sig", - "//rs/cycles_account_manager", - "//rs/embedders", - "//rs/interfaces", - "//rs/interfaces/state_manager", - "//rs/limits", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/nns/constants", - "//rs/phantom_newtype", - "//rs/query_stats", - "//rs/registry/provisional_whitelist", - "//rs/registry/routing_table", - "//rs/registry/subnet_features", - "//rs/registry/subnet_type", - "//rs/replicated_state", - "//rs/state_layout", - "//rs/sys", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "//rs/types/wasm_types", - "//rs/utils", - "//rs/utils/lru_cache", - "//rs/utils/thread", - "@crate_index//:candid", - "@crate_index//:hex", - "@crate_index//:ic-btc-interface", - "@crate_index//:ic-vetkeys", - "@crate_index//:lazy_static", - "@crate_index//:more-asserts", - "@crate_index//:num-rational", - "@crate_index//:num-traits", - "@crate_index//:prometheus", - "@crate_index//:rand", - "@crate_index//:scoped_threadpool", - "@crate_index//:serde", - "@crate_index//:serde_bytes", - "@crate_index//:serde_cbor", - "@crate_index//:slog", - "@crate_index//:strum", - "@crate_index//:tempfile", - "@crate_index//:threadpool", - "@crate_index//:tokio", - "@crate_index//:tower", - "@crate_index//:tracing", - "@crate_index//:wasmparser", -] - -MACRO_DEPENDENCIES = [] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//rs/crypto/test_utils/vetkd", - "//rs/interfaces/state_manager/mocks", - "//rs/rust_canisters/canister_test", - "//rs/state_machine_tests", - "//rs/test_utilities", - "//rs/test_utilities/consensus", - "//rs/test_utilities/execution_environment", - "//rs/test_utilities/logger", - "//rs/test_utilities/metrics", - "//rs/test_utilities/state", - "//rs/test_utilities/types", - "//rs/types/types_test_utils", - "//rs/universal_canister/lib", - "@crate_index//:assert_matches", - "@crate_index//:criterion", - "@crate_index//:insta", - "@crate_index//:itertools", - "@crate_index//:libflate", - "@crate_index//:maplit", - "@crate_index//:proptest", - "@crate_index//:regex", - "@crate_index//:rstest", - "@crate_index//:wat", -] - -MACRO_DEV_DEPENDENCIES = [ - # Keep sorted. - "@crate_index//:test-strategy", -] - -ALIASES = {} - -DATA = [] - -ENV = {} - rust_library( name = "execution_environment", srcs = glob(["src/**"]), - aliases = ALIASES, compile_data = glob(["tests/test-data/**"]), crate_name = "ic_execution_environment", - proc_macro_deps = MACRO_DEPENDENCIES, version = "0.9.0", - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//packages/ic-error-types", + "//packages/ic-heap-bytes", + "//rs/canister_sandbox:backend_lib", + "//rs/config", + "//rs/crypto/prng", + "//rs/crypto/tree_hash", + "//rs/crypto/utils/canister_threshold_sig", + "//rs/cycles_account_manager", + "//rs/embedders", + "//rs/interfaces", + "//rs/interfaces/state_manager", + "//rs/limits", + "//rs/monitoring/logger", + "//rs/monitoring/metrics", + "//rs/phantom_newtype", + "//rs/query_stats", + "//rs/registry/provisional_whitelist", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/state_layout", + "//rs/sys", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/wasm_types", + "//rs/utils/lru_cache", + "//rs/utils/thread", + "@crate_index//:candid", + "@crate_index//:ic-vetkeys", + "@crate_index//:lazy_static", + "@crate_index//:more-asserts", + "@crate_index//:num-rational", + "@crate_index//:num-traits", + "@crate_index//:prometheus", + "@crate_index//:rand", + "@crate_index//:scoped_threadpool", + "@crate_index//:serde", + "@crate_index//:serde_cbor", + "@crate_index//:slog", + "@crate_index//:strum", + "@crate_index//:tempfile", + "@crate_index//:threadpool", + "@crate_index//:tokio", + "@crate_index//:tower", + "@crate_index//:tracing", + "@crate_index//:wasmparser", + ], ) rust_ic_test( name = "execution_environment_test", timeout = "long", - aliases = ALIASES, crate = ":execution_environment", - data = DATA + [ + data = [ "//rs/universal_canister/impl:universal_canister.module", "//rs/universal_canister/impl:universal_canister.wasm.gz", ], - env = ENV | { + env = { "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", "UNIVERSAL_CANISTER_SERIALIZED_MODULE_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.module)", }, - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, + proc_macro_deps = [ + # Keep sorted. + "@crate_index//:test-strategy", + ], # TODO(IDX-3164): enable on PR when flakiness issue is resolved # or we have new darwin runners in use tags = [ "test_macos_slow", ], - deps = DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/crypto/sha2", + "//rs/interfaces", + "//rs/registry/routing_table", + "//rs/state_machine_tests", + "//rs/test_utilities", + "//rs/test_utilities/consensus", + "//rs/test_utilities/execution_environment", + "//rs/test_utilities/metrics", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/types", + "//rs/types/types_test_utils", + "//rs/universal_canister/lib", + "@crate_index//:assert_matches", + "@crate_index//:ic-btc-interface", + "@crate_index//:maplit", + "@crate_index//:proptest", + "@crate_index//:serde_bytes", + "@crate_index//:wat", + ], ) rust_ic_test_suite( @@ -144,9 +115,8 @@ rust_ic_test_suite( # so we want to experiment with different configuration options. exclude = ["tests/dts.rs"], ), - aliases = ALIASES, compile_data = glob(["tests/test-data/**"]), - data = DATA + [ + data = [ "//rs/rust_canisters/backtrace_canister:backtrace-canister", "//rs/rust_canisters/backtrace_canister:backtrace-canister-without-names", "//rs/rust_canisters/call_loop_canister:call-loop-canister", @@ -155,7 +125,7 @@ rust_ic_test_suite( "//rs/universal_canister/impl:universal_canister_no_heartbeat.wasm.gz", "//testnet/prebuilt-canisters:image-classification", ], - env = dict(ENV.items() + [ + env = dict([ ("BACKTRACE_CANISTER_WASM_PATH", "$(rootpath //rs/rust_canisters/backtrace_canister:backtrace-canister)"), ("BACKTRACE_CANISTER_WITHOUT_NAMES_WASM_PATH", "$(rootpath //rs/rust_canisters/backtrace_canister:backtrace-canister-without-names)"), ("CALL_LOOP_CANISTER_WASM_PATH", "$(rootpath //rs/rust_canisters/call_loop_canister:call-loop-canister)"), @@ -164,11 +134,58 @@ rust_ic_test_suite( ("UNIVERSAL_CANISTER_SERIALIZED_MODULE_PATH", "$(rootpath //rs/universal_canister/impl:universal_canister.module)"), ("IMAGE_CLASSIFICATION_CANISTER_WASM_PATH", "$(rootpath //testnet/prebuilt-canisters:image-classification)"), ]), - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, + proc_macro_deps = [ + # Keep sorted. + "@crate_index//:test-strategy", + ], tags = [ "test_macos_slow", ], - deps = [":execution_environment"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + ":execution_environment", + "//packages/ic-error-types", + "//rs/config", + "//rs/crypto/sha2", + "//rs/crypto/test_utils/vetkd", + "//rs/cycles_account_manager", + "//rs/embedders", + "//rs/interfaces", + "//rs/interfaces/state_manager", + "//rs/interfaces/state_manager/mocks", + "//rs/monitoring/metrics", + "//rs/nns/constants", + "//rs/registry/subnet_features", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/rust_canisters/canister_test", + "//rs/state_machine_tests", + "//rs/sys", + "//rs/test_utilities", + "//rs/test_utilities/execution_environment", + "//rs/test_utilities/logger", + "//rs/test_utilities/metrics", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/types_test_utils", + "//rs/universal_canister/lib", + "//rs/utils", + "@crate_index//:assert_matches", + "@crate_index//:candid", + "@crate_index//:itertools", + "@crate_index//:libflate", + "@crate_index//:maplit", + "@crate_index//:more-asserts", + "@crate_index//:proptest", + "@crate_index//:regex", + "@crate_index//:rstest", + "@crate_index//:serde", + "@crate_index//:tokio", + "@crate_index//:wasmparser", + "@crate_index//:wat", + ], ) # TODO: move this dts test back into the :execution_environment_misc_integration target above @@ -177,11 +194,11 @@ rust_ic_test( name = "dts_test", size = "large", srcs = ["tests/dts.rs"], - data = DATA + [ + data = [ "//rs/universal_canister/impl:universal_canister.wasm.gz", "//rs/universal_canister/impl:universal_canister_no_heartbeat.wasm.gz", ], - env = ENV | { + env = { "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", "UNIVERSAL_CANISTER_NO_HEARTBEAT_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister_no_heartbeat.wasm.gz)", "RUST_TEST_THREADS": "4", @@ -190,7 +207,24 @@ rust_ic_test( "cpu:4", "test_macos_slow", ], - deps = [":execution_environment"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//packages/ic-error-types", + "//rs/config", + "//rs/cycles_account_manager", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/state_machine_tests", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/universal_canister/lib", + "@crate_index//:assert_matches", + "@crate_index//:candid", + "@crate_index//:more-asserts", + "@crate_index//:strum", + "@crate_index//:wat", + ], ) rust_doc_test( @@ -201,151 +235,158 @@ rust_doc_test( ], ) -BENCH_DEPENDENCIES = [ - # Keep sorted. - ":execution_environment", - "//packages/ic-error-types", - "//rs/config", - "//rs/cycles_account_manager", - "//rs/embedders", - "//rs/interfaces", - "//rs/limits", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/nns/constants", - "//rs/registry/subnet_type", - "//rs/replicated_state", - "//rs/rust_canisters/canister_test", - "//rs/test_utilities", - "//rs/test_utilities/execution_environment", - "//rs/test_utilities/state", - "//rs/test_utilities/time", - "//rs/test_utilities/types", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "//rs/types/wasm_types", - "//rs/universal_canister/lib", - "@crate_index//:criterion", - "@crate_index//:lazy_static", - "@crate_index//:tokio", - "@crate_index//:wat", -] - rust_ic_bench( name = "execute_inspect_message_bench", srcs = ["benches/system_api/execute_inspect_message.rs"], - data = DATA, - env = ENV, test_name = "execute_inspect_message_bench_test", - deps = ["//rs/execution_environment/benches/lib:execution_environment_bench"] + BENCH_DEPENDENCIES, + deps = [ + # Keep sorted. + ":execution_environment", + "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/monitoring/logger", + "//rs/monitoring/metrics", + "//rs/test_utilities/types", + "//rs/types/types", + "@crate_index//:criterion", + ], ) rust_ic_bench( name = "execute_query_bench", srcs = ["benches/system_api/execute_query.rs"], - data = DATA, - env = ENV, test_name = "execute_query_bench_test", - deps = ["//rs/execution_environment/benches/lib:execution_environment_bench"] + BENCH_DEPENDENCIES, + deps = [ + # Keep sorted. + ":execution_environment", + "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/interfaces", + "//rs/types/types", + "@crate_index//:criterion", + ], ) rust_ic_bench( name = "execute_update_bench", srcs = ["benches/system_api/execute_update.rs"], - data = DATA, - env = ENV, test_name = "execute_update_bench_test", - deps = ["//rs/execution_environment/benches/lib:execution_environment_bench"] + BENCH_DEPENDENCIES, + deps = [ + # Keep sorted. + ":execution_environment", + "//packages/ic-error-types", + "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/limits", + "//rs/types/types", + "@crate_index//:criterion", + ], ) rust_ic_bench( name = "wasm_instructions_bench", srcs = glob(["benches/wasm_instructions/*.rs"]), - data = DATA, - env = ENV, - deps = ["//rs/execution_environment/benches/lib:execution_environment_bench"] + BENCH_DEPENDENCIES, + deps = [ + # Keep sorted. + ":execution_environment", + "//packages/ic-error-types", + "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/limits", + "//rs/types/types", + "@crate_index//:criterion", + ], ) rust_ic_bench( name = "scheduler_bench", srcs = ["benches/scheduler.rs"], - data = DATA, - env = ENV, deps = [ # Keep sorted. - "//rs/execution_environment/benches/lib:execution_environment_bench", - "//rs/state_machine_tests", + ":execution_environment", + "//rs/config", + "//rs/replicated_state", + "//rs/types/base_types", + "//rs/types/types", "//rs/types/types_test_utils", - ] + BENCH_DEPENDENCIES, + "@crate_index//:criterion", + ], ) rust_ic_bench( name = "load_simulator_canisters_bench", srcs = ["benches/load_simulator_canisters.rs"], - data = DATA + [ + data = [ "//rs/rust_canisters/canister_creator:canister_creator_canister", "//rs/rust_canisters/load_simulator:load_simulator_canister", ], - env = dict(ENV.items() + [ + env = dict([ ("CANISTER_CREATOR_CANISTER_WASM_PATH", "$(rootpath //rs/rust_canisters/canister_creator:canister_creator_canister)"), ("LOAD_SIMULATOR_CANISTER_WASM_PATH", "$(rootpath //rs/rust_canisters/load_simulator:load_simulator_canister)"), ]), deps = [ # Keep sorted. - "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/rust_canisters/canister_test", "//rs/state_machine_tests", - "//rs/types/types_test_utils", - ] + BENCH_DEPENDENCIES, + "//rs/types/types", + "@crate_index//:criterion", + ], ) rust_ic_bench( name = "100k_canisters_bench", srcs = ["benches/100k_canisters.rs"], - data = DATA + ["//rs/rust_canisters/canister_creator:canister_creator_canister"], - env = dict(ENV.items() + [ + data = ["//rs/rust_canisters/canister_creator:canister_creator_canister"], + env = dict([ ("CANISTER_CREATOR_CANISTER_WASM_PATH", "$(rootpath //rs/rust_canisters/canister_creator:canister_creator_canister)"), ]), deps = [ # Keep sorted. - "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/rust_canisters/canister_test", "//rs/state_machine_tests", - "//rs/types/types_test_utils", - ] + BENCH_DEPENDENCIES, + "//rs/types/base_types", + "//rs/types/types", + "@crate_index//:criterion", + ], ) rust_library( name = "utils", testonly = True, srcs = ["benches/management_canister/utils.rs"], - aliases = ALIASES, deps = [ # Keep sorted. - "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/config", + "//rs/registry/subnet_type", + "//rs/rust_canisters/canister_test", "//rs/state_machine_tests", + "//rs/types/base_types", + "//rs/types/types", "@crate_index//:candid", "@crate_index//:serde", - ] + BENCH_DEPENDENCIES, + ], ) rust_ic_bench( name = "management_canister_bench", srcs = glob(["benches/management_canister/*.rs"]), - data = DATA + [ + data = [ "//rs/execution_environment/benches/management_canister/test_canister", "//rs/universal_canister/impl:universal_canister.wasm.gz", ], - env = dict(ENV.items() + [ + env = dict([ ("TEST_CANISTER_WASM_PATH", "$(rootpath //rs/execution_environment/benches/management_canister/test_canister)"), ("UNIVERSAL_CANISTER_WASM_PATH", "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)"), ]), deps = [ # Keep sorted. - ":utils", - "//rs/execution_environment/benches/lib:execution_environment_bench", + "//rs/config", + "//rs/registry/subnet_type", + "//rs/rust_canisters/canister_test", "//rs/state_machine_tests", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/universal_canister/lib", "@crate_index//:candid", + "@crate_index//:criterion", "@crate_index//:rand", "@crate_index//:serde", - ] + BENCH_DEPENDENCIES, + ], ) diff --git a/rs/execution_environment/Cargo.toml b/rs/execution_environment/Cargo.toml index 768f7251cd0d..b78563930eb1 100644 --- a/rs/execution_environment/Cargo.toml +++ b/rs/execution_environment/Cargo.toml @@ -8,7 +8,6 @@ version.workspace = true [dependencies] candid = { workspace = true } -hex = { workspace = true } ic-base-types = { path = "../types/base_types" } ic-btc-interface = { workspace = true } ic-canister-sandbox-backend-lib = { path = "../canister_sandbox" } @@ -18,9 +17,9 @@ ic-crypto-sha2 = { path = "../crypto/sha2" } ic-crypto-tree-hash = { path = "../crypto/tree_hash" } ic-crypto-utils-canister-threshold-sig = { path = "../crypto/utils/canister_threshold_sig" } ic-cycles-account-manager = { path = "../cycles_account_manager" } -ic-heap-bytes = { path = "../../packages/ic-heap-bytes" } ic-embedders = { path = "../embedders" } ic-error-types = { path = "../../packages/ic-error-types" } +ic-heap-bytes = { path = "../../packages/ic-heap-bytes" } ic-interfaces = { path = "../interfaces" } ic-interfaces-state-manager = { path = "../interfaces/state_manager" } ic-limits = { path = "../limits" } @@ -70,7 +69,6 @@ criterion = { workspace = true } execution-environment-bench = { path = "benches/lib" } ic-crypto-test-utils-vetkd = { path = "../crypto/test_utils/vetkd" } ic-interfaces-state-manager-mocks = { path = "../interfaces/state_manager/mocks" } -ic-management-canister-types-private = { path = "../types/management_canister_types" } ic-state-machine-tests = { path = "../state_machine_tests" } ic-test-utilities = { path = "../test_utilities" } ic-test-utilities-consensus = { path = "../test_utilities/consensus" } @@ -81,7 +79,6 @@ ic-test-utilities-state = { path = "../test_utilities/state" } ic-test-utilities-types = { path = "../test_utilities/types" } ic-types-test-utils = { path = "../types/types_test_utils" } ic-universal-canister = { path = "../universal_canister/lib" } -ic-wasm-types = { path = "../types/wasm_types" } itertools = { workspace = true } libflate = { workspace = true } maplit = "1.0.2" diff --git a/rs/memory_tracker/BUILD.bazel b/rs/memory_tracker/BUILD.bazel index f4e592fee850..8f7b1acc3493 100644 --- a/rs/memory_tracker/BUILD.bazel +++ b/rs/memory_tracker/BUILD.bazel @@ -3,25 +3,22 @@ load("//bazel:defs.bzl", "rust_bench") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//rs/monitoring/logger", - "//rs/replicated_state", - "//rs/sys", - "//rs/types/types", - "@crate_index//:bit-vec", - "@crate_index//:lazy_static", - "@crate_index//:libc", - "@crate_index//:nix", - "@crate_index//:slog", -] - rust_library( name = "memory_tracker", srcs = glob(["src/**"]), crate_name = "memory_tracker", version = "0.9.0", - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/monitoring/logger", + "//rs/replicated_state", + "//rs/sys", + "//rs/types/types", + "@crate_index//:bit-vec", + "@crate_index//:libc", + "@crate_index//:nix", + "@crate_index//:slog", + ], ) rust_test( @@ -29,7 +26,6 @@ rust_test( crate = ":memory_tracker", deps = [ # Keep sorted. - "//rs/types/types", "@crate_index//:proptest", "@crate_index//:tempfile", ], @@ -42,8 +38,15 @@ rust_bench( deps = [ # Keep sorted. ":memory_tracker", + "//rs/monitoring/logger", + "//rs/replicated_state", + "//rs/sys", + "//rs/types/types", "@crate_index//:criterion", - ] + DEPENDENCIES, + "@crate_index//:lazy_static", + "@crate_index//:libc", + "@crate_index//:nix", + ], ) rust_bench( @@ -56,7 +59,7 @@ rust_bench( "@crate_index//:criterion", "@crate_index//:memmap2", "@crate_index//:rayon", - ] + DEPENDENCIES, + ], ) rust_bench( @@ -65,8 +68,7 @@ rust_bench( srcs = ["benches/bit_vec.rs"], deps = [ # Keep sorted. + "@crate_index//:bit-vec", "@crate_index//:criterion", - "@crate_index//:memmap2", - "@crate_index//:rayon", - ] + DEPENDENCIES, + ], ) diff --git a/rs/migration_canister/BUILD.bazel b/rs/migration_canister/BUILD.bazel index d75e18cba246..007338f44e38 100644 --- a/rs/migration_canister/BUILD.bazel +++ b/rs/migration_canister/BUILD.bazel @@ -15,7 +15,6 @@ rust_canister( "@crate_index//:ic-cdk-timers", "@crate_index//:ic_stable_structures_next", "@crate_index//:serde", - "@crate_index//:serde_bytes", "@crate_index//:serde_cbor", ], ) diff --git a/rs/migration_canister/Cargo.toml b/rs/migration_canister/Cargo.toml index 754ffbc96950..6110cd873751 100644 --- a/rs/migration_canister/Cargo.toml +++ b/rs/migration_canister/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ic-migration-canister" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-migration-canister" +version.workspace = true [lib] crate-type = ["cdylib"] @@ -15,6 +15,5 @@ futures = { workspace = true } ic-cdk = { workspace = true } ic-cdk-timers = { workspace = true } ic-stable-structures = "0.7.0" +serde = { workspace = true } serde_cbor = { workspace = true } -serde = { workspace =true } -serde_bytes = { workspace =true } diff --git a/rs/query_stats/BUILD.bazel b/rs/query_stats/BUILD.bazel index bb015545bae3..f8c0aa426f5b 100644 --- a/rs/query_stats/BUILD.bazel +++ b/rs/query_stats/BUILD.bazel @@ -2,39 +2,34 @@ load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//rs/config", - "//rs/interfaces", - "//rs/interfaces/state_manager", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/replicated_state", - "//rs/types/types", - "@crate_index//:crossbeam-channel", - "@crate_index//:prometheus", - "@crate_index//:slog", -] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//rs/interfaces/state_manager/mocks", - "//rs/test_utilities", - "//rs/test_utilities/state", - "//rs/test_utilities/time", - "//rs/types/types_test_utils", -] - rust_library( name = "query_stats", srcs = glob(["src/**"]), crate_name = "ic_query_stats", version = "0.9.0", - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/config", + "//rs/interfaces", + "//rs/interfaces/state_manager", + "//rs/monitoring/logger", + "//rs/monitoring/metrics", + "//rs/replicated_state", + "//rs/types/types", + "@crate_index//:crossbeam-channel", + "@crate_index//:prometheus", + "@crate_index//:slog", + ], ) rust_test( name = "query_stats_test", crate = ":query_stats", - deps = DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + "//rs/interfaces/state_manager", + "//rs/interfaces/state_manager/mocks", + "//rs/test_utilities/state", + "//rs/types/types_test_utils", + ], ) diff --git a/rs/query_stats/Cargo.toml b/rs/query_stats/Cargo.toml index 089be3593db1..fcd5999e9322 100644 --- a/rs/query_stats/Cargo.toml +++ b/rs/query_stats/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "ic-query-stats" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-query-stats" +version.workspace = true [dependencies] crossbeam-channel = { workspace = true } @@ -21,7 +21,5 @@ slog = { workspace = true } [dev-dependencies] ic-interfaces-state-manager-mocks = { path = "../interfaces/state_manager/mocks" } -ic-test-utilities = { path = "../test_utilities" } ic-test-utilities-state = { path = "../test_utilities/state" } -ic-test-utilities-time = { path = "../test_utilities/time" } ic-types-test-utils = { path = "../types/types_test_utils" } diff --git a/rs/replica_tests/BUILD.bazel b/rs/replica_tests/BUILD.bazel index 9663a13c574a..c915cec627f9 100644 --- a/rs/replica_tests/BUILD.bazel +++ b/rs/replica_tests/BUILD.bazel @@ -3,73 +3,12 @@ load("//bazel:defs.bzl", "rust_ic_test_suite") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//packages/ic-error-types", - "//rs/bitcoin/replica_types", - "//rs/bitcoin/service", - "//rs/canister_client/sender", - "//rs/config", - "//rs/execution_environment", - "//rs/http_endpoints/async_utils", - "//rs/interfaces", - "//rs/interfaces/registry", - "//rs/interfaces/state_manager", - "//rs/monitoring/metrics", - "//rs/monitoring/tracing", - "//rs/prep", - "//rs/protobuf", - "//rs/registry/fake", - "//rs/registry/keys", - "//rs/registry/proto_data_provider", - "//rs/registry/provisional_whitelist", - "//rs/registry/subnet_type", - "//rs/replica:replica_lib", - "//rs/replicated_state", - "//rs/state_machine_tests", - "//rs/test_utilities", - "//rs/test_utilities/logger", - "//rs/test_utilities/types", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "//rs/utils", - "@crate_index//:crossbeam-channel", - "@crate_index//:ic-btc-interface", - "@crate_index//:prost", - "@crate_index//:rand", - "@crate_index//:slog", - "@crate_index//:slog-scope", - "@crate_index//:tempfile", - "@crate_index//:tokio", - "@crate_index//:tonic", - "@crate_index//:tower", - "@crate_index//:tracing-subscriber", - "@crate_index//:wat", -] - -MACRO_DEPENDENCIES = [] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//rs/crypto/sha2", - "//rs/rust_canisters/canister_test", - "//rs/sys", - "@crate_index//:assert_matches", - "@crate_index//:candid", - "@crate_index//:maplit", -] - -MACRO_DEV_DEPENDENCIES = [] - DEV_DATA = [ # Keep sorted. ":replica_tests", "//rs/universal_canister/impl:universal_canister.wasm.gz", ] -ALIASES = {} - DEV_ENV = { # Keep sorted. "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", @@ -79,27 +18,81 @@ rust_library( name = "replica_tests", testonly = True, srcs = glob(["src/**/*.rs"]), - aliases = ALIASES, crate_name = "ic_replica_tests", - proc_macro_deps = MACRO_DEPENDENCIES, - deps = DEPENDENCIES, + deps = [ + # Keep sorted. + "//packages/ic-error-types", + "//rs/canister_client/sender", + "//rs/config", + "//rs/execution_environment", + "//rs/interfaces", + "//rs/interfaces/registry", + "//rs/interfaces/state_manager", + "//rs/monitoring/metrics", + "//rs/monitoring/tracing", + "//rs/prep", + "//rs/protobuf", + "//rs/registry/fake", + "//rs/registry/keys", + "//rs/registry/proto_data_provider", + "//rs/registry/provisional_whitelist", + "//rs/registry/subnet_type", + "//rs/replica:replica_lib", + "//rs/replicated_state", + "//rs/state_machine_tests", + "//rs/test_utilities", + "//rs/test_utilities/logger", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:prost", + "@crate_index//:rand", + "@crate_index//:slog-scope", + "@crate_index//:tokio", + "@crate_index//:tower", + "@crate_index//:tracing-subscriber", + "@crate_index//:wat", + ], ) rust_test( name = "replica_tests_test", - aliases = ALIASES, crate = ":replica_tests", - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = DEPENDENCIES + DEV_DEPENDENCIES, ) rust_ic_test_suite( name = "replica_tests_integration", timeout = "long", srcs = glob(["tests/**/*.rs"]), - aliases = ALIASES, data = DEV_DATA, env = DEV_ENV, - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = [":replica_tests"] + DEPENDENCIES + DEV_DEPENDENCIES, + deps = [ + # Keep sorted. + ":replica_tests", + "//packages/ic-error-types", + "//rs/bitcoin/replica_types", + "//rs/bitcoin/service", + "//rs/config", + "//rs/crypto/sha2", + "//rs/http_endpoints/async_utils", + "//rs/registry/provisional_whitelist", + "//rs/registry/subnet_type", + "//rs/replicated_state", + "//rs/state_machine_tests", + "//rs/sys", + "//rs/test_utilities", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/utils", + "@crate_index//:assert_matches", + "@crate_index//:candid", + "@crate_index//:ic-btc-interface", + "@crate_index//:maplit", + "@crate_index//:tempfile", + "@crate_index//:tokio", + "@crate_index//:tonic", + ], ) diff --git a/rs/replica_tests/Cargo.toml b/rs/replica_tests/Cargo.toml index 2fae31700367..97cd28613d3a 100644 --- a/rs/replica_tests/Cargo.toml +++ b/rs/replica_tests/Cargo.toml @@ -1,14 +1,12 @@ [package] -name = "ic-replica-tests" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-replica-tests" +version.workspace = true [dependencies] -crossbeam-channel = { workspace = true } -ic-http-endpoints-async-utils = { path = "../http_endpoints/async_utils" } ic-base-types = { path = "../types/base_types" } ic-btc-interface = { workspace = true } ic-btc-replica-types = { path = "../bitcoin/replica_types" } @@ -17,6 +15,7 @@ ic-canister-client-sender = { path = "../canister_client/sender" } ic-config = { path = "../config" } ic-error-types = { path = "../../packages/ic-error-types" } ic-execution-environment = { path = "../execution_environment" } +ic-http-endpoints-async-utils = { path = "../http_endpoints/async_utils" } ic-interfaces = { path = "../interfaces" } ic-interfaces-registry = { path = "../interfaces/registry" } ic-interfaces-state-manager = { path = "../interfaces/state_manager" } @@ -40,7 +39,6 @@ ic-types = { path = "../types/types" } ic-utils = { path = "../utils" } prost = { workspace = true } rand = { workspace = true } -slog = { workspace = true } slog-scope = { workspace = true } tempfile = { workspace = true } tokio = { workspace = true } @@ -52,9 +50,7 @@ wat = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } candid = { workspace = true } -canister-test = { path = "../rust_canisters/canister_test" } ic-crypto-sha2 = { path = "../crypto/sha2" } -ic-registry-provisional-whitelist = { path = "../registry/provisional_whitelist" } ic-sys = { path = "../sys" } ic-test-utilities = { path = "../test_utilities" } maplit = "1.0.2" diff --git a/rs/replicated_state/BUILD.bazel b/rs/replicated_state/BUILD.bazel index 904d6a9a0105..35406aa09c20 100644 --- a/rs/replicated_state/BUILD.bazel +++ b/rs/replicated_state/BUILD.bazel @@ -3,109 +3,67 @@ load("//bazel:defs.bzl", "rust_bench", "rust_test_with_binary") package(default_visibility = ["//visibility:public"]) -DEPENDENCIES = [ - # Keep sorted. - "//packages/ic-error-types", - "//rs/bitcoin/replica_types", - "//rs/canonical_state/certification_version", - "//rs/config", - "//rs/crypto/sha2", - "//rs/interfaces", - "//rs/limits", - "//rs/monitoring/logger", - "//rs/monitoring/metrics", - "//rs/phantom_newtype", - "//rs/protobuf", - "//rs/registry/routing_table", - "//rs/registry/subnet_features", - "//rs/registry/subnet_type", - "//rs/sys", - "//rs/types/base_types", - "//rs/types/management_canister_types", - "//rs/types/types", - "//rs/types/wasm_types", - "//rs/utils", - "//rs/utils/validate_eq", - "@crate_index//:bit-vec", - "@crate_index//:cvt", - "@crate_index//:itertools", - "@crate_index//:lazy_static", - "@crate_index//:libc", - "@crate_index//:maplit", - "@crate_index//:nix", - "@crate_index//:num-traits", - "@crate_index//:prometheus", - "@crate_index//:prost", - "@crate_index//:rand", - "@crate_index//:rand_chacha", - "@crate_index//:rayon", - "@crate_index//:serde", - "@crate_index//:serde_bytes", - "@crate_index//:slog", - "@crate_index//:static_assertions", - "@crate_index//:strum", - "@crate_index//:tempfile", - "@crate_index//:uuid", -] - -MACRO_DEPENDENCIES = [ - # Keep sorted. - "//rs/utils/validate_eq_derive", - "@crate_index//:strum_macros", -] - -DEV_DEPENDENCIES = [ - # Keep sorted. - "//packages/ic-ed25519", - "//rs/criterion_time", - "//rs/crypto/test_utils/canister_threshold_sigs", - "//rs/crypto/test_utils/keys", - "//rs/crypto/test_utils/reproducible_rng", - "//rs/test_utilities/io", - "//rs/test_utilities/metrics", - "//rs/test_utilities/state", - "//rs/test_utilities/time", - "//rs/test_utilities/types", - "@crate_index//:assert_matches", - "@crate_index//:criterion", - "@crate_index//:proptest", - "@crate_index//:scoped_threadpool", - "@crate_index//:serde_cbor", -] - -MACRO_DEV_DEPENDENCIES = [ - # Keep sorted. - "@crate_index//:test-strategy", -] - -BIN_DEPENDENCIES = [ - # Keep sorted. - "//rs/criterion_time", - "//rs/sys", - "@crate_index//:criterion", - "@crate_index//:scoped_threadpool", -] - -ALIASES = {} - rust_library( name = "replicated_state", srcs = glob(["src/**/*.rs"]), - aliases = ALIASES, crate_features = select({ "//bazel:fuzzing_code_enabled": ["fuzzing_code"], "//conditions:default": [], }), crate_name = "ic_replicated_state", - proc_macro_deps = MACRO_DEPENDENCIES, + proc_macro_deps = [ + # Keep sorted. + "//rs/utils/validate_eq_derive", + "@crate_index//:strum_macros", + ], version = "0.9.0", - deps = DEPENDENCIES + select({ + deps = [ + # Keep sorted. + "//packages/ic-error-types", + "//rs/bitcoin/replica_types", + "//rs/canonical_state/certification_version", + "//rs/config", + "//rs/crypto/sha2", + "//rs/interfaces", + "//rs/limits", + "//rs/monitoring/logger", + "//rs/monitoring/metrics", + "//rs/phantom_newtype", + "//rs/protobuf", + "//rs/registry/routing_table", + "//rs/registry/subnet_features", + "//rs/registry/subnet_type", + "//rs/sys", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "//rs/types/wasm_types", + "//rs/utils", + "//rs/utils/validate_eq", + "@crate_index//:bit-vec", + "@crate_index//:cvt", + "@crate_index//:itertools", + "@crate_index//:lazy_static", + "@crate_index//:libc", + "@crate_index//:maplit", + "@crate_index//:nix", + "@crate_index//:num-traits", + "@crate_index//:prometheus", + "@crate_index//:prost", + "@crate_index//:rand", + "@crate_index//:rand_chacha", + "@crate_index//:rayon", + "@crate_index//:serde", + "@crate_index//:slog", + "@crate_index//:static_assertions", + "@crate_index//:strum", + "@crate_index//:tempfile", + ] + select({ "//bazel:fuzzing_code_enabled": [ "//rs/test_utilities/io", "//rs/test_utilities/metrics", "@crate_index//:arbitrary", "@crate_index//:assert_matches", - "@crate_index//:proptest", ], "//conditions:default": [], }), @@ -116,7 +74,14 @@ rust_binary( srcs = [ "benches/bench_allocator.rs", ], - deps = [":replicated_state"] + BIN_DEPENDENCIES, + deps = [ + # Keep sorted. + ":replicated_state", + "//rs/criterion_time", + "//rs/sys", + "@crate_index//:criterion", + "@crate_index//:scoped_threadpool", + ], ) rust_bench( @@ -125,22 +90,64 @@ rust_bench( srcs = [ "benches/bench_intmap.rs", ], - deps = [":replicated_state"] + BIN_DEPENDENCIES, + deps = [ + # Keep sorted. + ":replicated_state", + "//rs/criterion_time", + "@crate_index//:criterion", + ], ) rust_test_with_binary( name = "replicated_state_test", - aliases = ALIASES, binary_name = "replicated_state_test_binary", crate = ":replicated_state", - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = DEPENDENCIES + DEV_DEPENDENCIES, + proc_macro_deps = [ + # Keep sorted. + "@crate_index//:test-strategy", + ], + deps = [ + # Keep sorted. + "//packages/ic-ed25519", + "//rs/crypto/test_utils/canister_threshold_sigs", + "//rs/crypto/test_utils/keys", + "//rs/crypto/test_utils/reproducible_rng", + "//rs/protobuf", + "//rs/test_utilities/io", + "//rs/test_utilities/metrics", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/types", + "@crate_index//:assert_matches", + "@crate_index//:proptest", + "@crate_index//:serde", + "@crate_index//:serde_cbor", + ], ) rust_test_suite( name = "replicated_state_integration", srcs = glob(["tests/**/*.rs"]), - aliases = ALIASES, - proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, - deps = [":replicated_state"] + DEPENDENCIES + DEV_DEPENDENCIES, + proc_macro_deps = [ + # Keep sorted. + "@crate_index//:test-strategy", + ], + deps = [ + # Keep sorted. + ":replicated_state", + "//packages/ic-error-types", + "//rs/bitcoin/replica_types", + "//rs/protobuf", + "//rs/registry/routing_table", + "//rs/registry/subnet_type", + "//rs/test_utilities/state", + "//rs/test_utilities/types", + "//rs/types/base_types", + "//rs/types/management_canister_types", + "//rs/types/types", + "@crate_index//:assert_matches", + "@crate_index//:maplit", + "@crate_index//:proptest", + "@crate_index//:strum", + ], ) diff --git a/rs/replicated_state/Cargo.toml b/rs/replicated_state/Cargo.toml index fac343c3a7e2..6fd7de0accf2 100644 --- a/rs/replicated_state/Cargo.toml +++ b/rs/replicated_state/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ic-replicated-state" -version.workspace = true authors.workspace = true -edition.workspace = true description.workspace = true documentation.workspace = true +edition.workspace = true +name = "ic-replicated-state" +version.workspace = true [dependencies] bit-vec = "0.6.3" @@ -13,10 +13,10 @@ ic-base-types = { path = "../types/base_types" } ic-btc-replica-types = { path = "../bitcoin/replica_types" } ic-certification-version = { path = "../canonical_state/certification_version" } ic-config = { path = "../config" } -ic-limits = { path = "../limits" } ic-crypto-sha2 = { path = "../crypto/sha2" } ic-error-types = { path = "../../packages/ic-error-types" } ic-interfaces = { path = "../interfaces" } +ic-limits = { path = "../limits" } ic-logger = { path = "../monitoring/logger" } ic-management-canister-types-private = { path = "../types/management_canister_types" } ic-metrics = { path = "../monitoring/metrics" } @@ -26,9 +26,9 @@ ic-registry-subnet-features = { path = "../registry/subnet_features" } ic-registry-subnet-type = { path = "../registry/subnet_type" } ic-sys = { path = "../sys" } ic-types = { path = "../types/types" } +ic-utils = { path = "../utils" } ic-validate-eq = { path = "../utils/validate_eq" } ic-validate-eq-derive = { path = "../utils/validate_eq_derive" } -ic-utils = { path = "../utils" } ic-wasm-types = { path = "../types/wasm_types" } itertools = { workspace = true } lazy_static = { workspace = true } @@ -43,13 +43,11 @@ rand = { workspace = true } rand_chacha = { workspace = true } rayon = { workspace = true } serde = { workspace = true } -serde_bytes = { workspace = true } slog = { workspace = true } static_assertions = { workspace = true } strum = { workspace = true } strum_macros = { workspace = true } tempfile = { workspace = true } -uuid = { workspace = true } # Optional dependencies needed for fuzzing arbitrary = { workspace = true, optional = true } @@ -59,7 +57,6 @@ ic-test-utilities-metrics = { path = "../test_utilities/metrics", optional = tru proptest = { workspace = true, optional = true } [dev-dependencies] -assert_matches = { workspace = true } criterion = { workspace = true } criterion-time = { path = "../criterion_time" } ic-crypto-test-utils-canister-threshold-sigs = { path = "../crypto/test_utils/canister_threshold_sigs" } @@ -67,19 +64,16 @@ ic-crypto-test-utils-keys = { path = "../crypto/test_utils/keys" } ic-crypto-test-utils-reproducible-rng = { path = "../crypto/test_utils/reproducible_rng" } ic-ed25519 = { path = "../../packages/ic-ed25519" } ic-test-utilities-io = { path = "../test_utilities/io" } -ic-test-utilities-metrics = { path = "../test_utilities/metrics" } ic-test-utilities-state = { path = "../test_utilities/state" } -ic-test-utilities-time = { path = "../test_utilities/time" } ic-test-utilities-types = { path = "../test_utilities/types" } -maplit = "1.0.2" proptest = { workspace = true } scoped_threadpool = "0.1.*" serde_cbor = { workspace = true } test-strategy = "0.4.0" [[bench]] -name = "bench_allocator" harness = false +name = "bench_allocator" [features] fuzzing_code = [