From 7e89300db909cac0617cf0c306f47ee5f5cd3a2c Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 26 Sep 2023 20:12:23 +0000 Subject: [PATCH] Move common package and dependency configs into workspace config The MSRV for the main crates is 1.65, which is higher than the Rust version that stabilised workplace dependencies (1.64). The implicit MSRV for the component crates is still lower than this, so we don't migrate these crates. --- Cargo.lock | 2 - Cargo.toml | 91 +++++++++++++++++++++ zcash_client_backend/Cargo.toml | 75 +++++++++-------- zcash_client_backend/src/data_api/wallet.rs | 1 - zcash_client_sqlite/Cargo.toml | 57 ++++++------- zcash_extensions/Cargo.toml | 23 +++--- zcash_history/Cargo.toml | 20 ++--- zcash_history/src/version.rs | 2 +- zcash_primitives/Cargo.toml | 78 +++++++++--------- zcash_proofs/Cargo.toml | 32 ++++---- 10 files changed, 235 insertions(+), 146 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e594db32c..9fb8e2c0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2968,12 +2968,10 @@ dependencies = [ "proptest", "prost", "rand_core", - "rand_xorshift", "rayon", "secrecy", "shardtree", "subtle", - "tempfile", "time", "tonic", "tonic-build", diff --git a/Cargo.toml b/Cargo.toml index 044d879e9..bb3cf1231 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,97 @@ members = [ "zcash_proofs", ] +[workspace.package] +edition = "2021" +rust-version = "1.65" +repository = "https://github.com/zcash/librustzcash" +license = "MIT OR Apache-2.0" +categories = ["cryptography::cryptocurrencies"] + +# Common dependencies across all of our crates. Dependencies used only by a single crate +# (and that don't have cross-crate versioning needs) are specified by the crate itself. +# +# See the individual crate `Cargo.toml` files for information about which dependencies are +# part of a public API, and which can be updated without a SemVer bump. +[workspace.dependencies] +# Intra-workspace dependencies +equihash = { version = "0.2", path = "components/equihash" } +zcash_address = { version = "0.3", path = "components/zcash_address" } +zcash_client_backend = { version = "0.10", path = "zcash_client_backend" } +zcash_encoding = { version = "0.2", path = "components/zcash_encoding" } +zcash_note_encryption = "0.4" +zcash_primitives = { version = "0.13", path = "zcash_primitives", default-features = false } +zcash_proofs = { version = "0.13", path = "zcash_proofs", default-features = false } + +# Shielded protocols +ff = "0.13" +group = "0.13" +incrementalmerkletree = "0.5" +shardtree = "0.1" + +# Payment protocols +# - Sapling +bitvec = "1" +blake2s_simd = "1" +bls12_381 = "0.8" +jubjub = "0.10" + +# - Orchard +nonempty = "0.7" +orchard = { version = "0.6", default-features = false } + +# - Transparent +hdwallet = "0.4" +ripemd = "0.1" +secp256k1 = "0.26" + +# CSPRNG +rand = "0.8" +rand_core = "0.6" + +# Digests +blake2b_simd = "1" +sha2 = "0.10" + +# Encodings +base64 = "0.21" +bech32 = "0.9" +bs58 = { version = "0.5", features = ["check"] } +byteorder = "1" +hex = "0.4" +percent-encoding = "2.1.0" + +# Logging and metrics +memuse = "0.2.1" +tracing = "0.1" + +# Parallel processing +crossbeam-channel = "0.5" +maybe-rayon = { version = "0.1.0", default-features = false } +rayon = "1.5" + +# Protobuf and gRPC +prost = "0.12" +tonic = "0.10" +tonic-build = "0.10" + +# Secret management +secrecy = "0.8" +subtle = "2.2.3" + +# Static constants +lazy_static = "1" + +# Tests and benchmarks +assert_matches = "1.5" +criterion = "0.4" +proptest = "1" +rand_xorshift = "0.3" + +# ZIP 32 +aes = "0.8" +fpe = "0.6" + [profile.release] lto = true panic = 'abort' diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 2f20e040a..2522f80ef 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -7,11 +7,12 @@ authors = [ "Kris Nuttycombe " ] homepage = "https://github.com/zcash/librustzcash" -repository = "https://github.com/zcash/librustzcash" +repository.workspace = true readme = "README.md" -license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +license.workspace = true +edition.workspace = true +rust-version.workspace = true +categories.workspace = true # Exclude proto files so crates.io consumers don't need protoc. exclude = ["*.proto"] @@ -20,10 +21,10 @@ exclude = ["*.proto"] development = ["zcash_proofs"] [dependencies] -zcash_address = { version = "0.3", path = "../components/zcash_address" } -zcash_encoding = { version = "0.2", path = "../components/zcash_encoding" } -zcash_note_encryption = "0.4" -zcash_primitives = { version = "0.13", path = "../zcash_primitives", default-features = false } +zcash_address.workspace = true +zcash_encoding.workspace = true +zcash_note_encryption.workspace = true +zcash_primitives.workspace = true # Dependencies exposed in a public API: # (Breaking upgrades to these require a breaking upgrade to this crate.) @@ -31,37 +32,37 @@ zcash_primitives = { version = "0.13", path = "../zcash_primitives", default-fea time = "0.3.22" # - Encodings -base64 = "0.21" -bech32 = "0.9" -bs58 = { version = "0.5", features = ["check"] } +base64.workspace = true +bech32.workspace = true +bs58.workspace = true # - Errors -hdwallet = { version = "0.4", optional = true } +hdwallet = { workspace = true, optional = true } # - Logging and metrics -memuse = "0.2" -tracing = "0.1" +memuse.workspace = true +tracing.workspace = true # - Protobuf interfaces and gRPC bindings -hex = "0.4" -prost = "0.12" -tonic = { version = "0.10", optional = true } +hex.workspace = true +prost.workspace = true +tonic = { workspace = true, optional = true } # - Secret management -secrecy = "0.8" -subtle = "2.2.3" +secrecy.workspace = true +subtle.workspace = true # - Shielded protocols -bls12_381 = "0.8" -group = "0.13" -orchard = { version = "0.6", default-features = false } +bls12_381.workspace = true +group.workspace = true +orchard.workspace = true # - Note commitment trees -incrementalmerkletree = "0.5" -shardtree = "0.1" +incrementalmerkletree.workspace = true +shardtree.workspace = true # - Test dependencies -proptest = { version = "1.0.0", optional = true } +proptest = { workspace = true, optional = true } # - ZIP 321 nom = "7" @@ -69,27 +70,25 @@ nom = "7" # Dependencies used internally: # (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.) # - Encodings -byteorder = { version = "1", optional = true } -percent-encoding = "2.1.0" +byteorder = { workspace = true, optional = true } +percent-encoding.workspace = true # - Scanning -crossbeam-channel = "0.5" -rayon = "1.5" +crossbeam-channel.workspace = true +rayon.workspace = true [build-dependencies] -tonic-build = "0.10" +tonic-build.workspace = true which = "4" [dev-dependencies] -assert_matches = "1.5" +assert_matches.workspace = true gumdrop = "0.8" -jubjub = "0.10" -proptest = "1.0.0" -rand_core = "0.6" -rand_xorshift = "0.3" -tempfile = "3.5.0" -zcash_proofs = { version = "0.13", path = "../zcash_proofs", default-features = false } -zcash_address = { version = "0.3", path = "../components/zcash_address", features = ["test-dependencies"] } +jubjub.workspace = true +proptest.workspace = true +rand_core.workspace = true +zcash_proofs.workspace = true +zcash_address = { workspace = true, features = ["test-dependencies"] } time = ">=0.3.22, <0.3.24" # time 0.3.24 has MSRV 1.67 diff --git a/zcash_client_backend/src/data_api/wallet.rs b/zcash_client_backend/src/data_api/wallet.rs index 71d050369..0d1adda6f 100644 --- a/zcash_client_backend/src/data_api/wallet.rs +++ b/zcash_client_backend/src/data_api/wallet.rs @@ -127,7 +127,6 @@ where /// ``` /// # #[cfg(all(feature = "test-dependencies", feature = "local-prover"))] /// # { -/// use tempfile::NamedTempFile; /// use zcash_primitives::{ /// consensus::{self, Network}, /// constants::testnet::COIN_TYPE, diff --git a/zcash_client_sqlite/Cargo.toml b/zcash_client_sqlite/Cargo.toml index bb2717717..a0a900976 100644 --- a/zcash_client_sqlite/Cargo.toml +++ b/zcash_client_sqlite/Cargo.toml @@ -7,38 +7,39 @@ authors = [ "Kris Nuttycombe " ] homepage = "https://github.com/zcash/librustzcash" -repository = "https://github.com/zcash/librustzcash" +repository.workspace = true readme = "README.md" -license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +license.workspace = true +edition.workspace = true +rust-version.workspace = true +categories.workspace = true [dependencies] -zcash_client_backend = { version = "0.10", path = "../zcash_client_backend", features = ["unstable-serialization", "unstable-spanning-tree"]} -zcash_encoding = { version = "0.2", path = "../components/zcash_encoding" } -zcash_primitives = { version = "0.13", path = "../zcash_primitives", default-features = false } +zcash_client_backend = { workspace = true, features = ["unstable-serialization", "unstable-spanning-tree"] } +zcash_encoding.workspace = true +zcash_primitives.workspace = true # Dependencies exposed in a public API: # (Breaking upgrades to these require a breaking upgrade to this crate.) # - Errors -bs58 = { version = "0.5", features = ["check"] } -hdwallet = { version = "0.4", optional = true } +bs58.workspace = true +hdwallet = { workspace = true, optional = true } # - Logging and metrics -tracing = "0.1" +tracing.workspace = true # - Serialization -byteorder = "1" -prost = "0.12" -group = "0.13" -jubjub = "0.10" +byteorder.workspace = true +prost.workspace = true +group.workspace = true +jubjub.workspace = true # - Secret management -secrecy = "0.8" +secrecy.workspace = true # - Note commitment trees -incrementalmerkletree = "0.5" -shardtree = { version = "0.1", features = ["legacy-api"] } +incrementalmerkletree.workspace = true +shardtree = { workspace = true, features = ["legacy-api"] } # - SQLite databases rusqlite = { version = "0.29.0", features = ["bundled", "time", "array"] } @@ -49,21 +50,21 @@ uuid = "1.1" # Dependencies used internally: # (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.) -maybe-rayon = {version = "0.1.0", default-features = false} +maybe-rayon.workspace = true [dev-dependencies] -assert_matches = "1.5" -incrementalmerkletree = { version = "0.5", features = ["test-dependencies"] } -shardtree = { version = "0.1", features = ["legacy-api", "test-dependencies"] } -proptest = "1.0.0" -rand_core = "0.6" +assert_matches.workspace = true +incrementalmerkletree = { workspace = true, features = ["test-dependencies"] } +shardtree = { workspace = true, features = ["legacy-api", "test-dependencies"] } +proptest.workspace = true +rand_core.workspace = true regex = "1.4" tempfile = "3.5.0" -zcash_note_encryption = "0.4" -zcash_proofs = { version = "0.13", path = "../zcash_proofs" } -zcash_primitives = { version = "0.13", path = "../zcash_primitives", features = ["test-dependencies"] } -zcash_client_backend = { version = "0.10", path = "../zcash_client_backend", features = ["test-dependencies", "unstable-serialization", "unstable-spanning-tree"] } -zcash_address = { version = "0.3", path = "../components/zcash_address", features = ["test-dependencies"] } +zcash_note_encryption.workspace = true +zcash_proofs.workspace = true +zcash_primitives = { workspace = true, features = ["test-dependencies"] } +zcash_client_backend = { workspace = true, features = ["test-dependencies", "unstable-serialization", "unstable-spanning-tree"] } +zcash_address = { workspace = true, features = ["test-dependencies"] } [features] default = ["multicore"] diff --git a/zcash_extensions/Cargo.toml b/zcash_extensions/Cargo.toml index 0123b6e71..1bd361caf 100644 --- a/zcash_extensions/Cargo.toml +++ b/zcash_extensions/Cargo.toml @@ -4,21 +4,22 @@ description = "Zcash Extension implementations & consensus node integration laye version = "0.0.0" authors = ["Jack Grigg ", "Kris Nuttycombe "] homepage = "https://github.com/zcash/librustzcash" -repository = "https://github.com/zcash/librustzcash" -license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" +repository.workspace = true +license.workspace = true +edition.workspace = true +rust-version.workspace = true +categories.workspace = true [dependencies] -blake2b_simd = "1" -zcash_primitives = { version = "0.13", path = "../zcash_primitives", default-features = false, features = ["zfuture" ] } +blake2b_simd.workspace = true +zcash_primitives = { workspace = true, features = ["zfuture" ] } [dev-dependencies] -ff = "0.13" -jubjub = "0.10" -rand_core = "0.6" -zcash_address = { version = "0.3", path = "../components/zcash_address" } -zcash_proofs = { version = "0.13", path = "../zcash_proofs" } +ff.workspace = true +jubjub.workspace = true +rand_core.workspace = true +zcash_address.workspace = true +zcash_proofs.workspace = true [features] transparent-inputs = [] diff --git a/zcash_history/Cargo.toml b/zcash_history/Cargo.toml index c9de761fb..a14ae93b5 100644 --- a/zcash_history/Cargo.toml +++ b/zcash_history/Cargo.toml @@ -2,22 +2,22 @@ name = "zcash_history" version = "0.3.0" authors = ["NikVolf "] -edition = "2021" -rust-version = "1.65" -license = "MIT/Apache-2.0" -documentation = "https://docs.rs/zcash_history/" +edition.workspace = true +rust-version.workspace = true +repository.workspace = true +license.workspace = true description = "Library for Zcash blockchain history tools" -categories = ["cryptography::cryptocurrencies"] +categories.workspace = true [dev-dependencies] -assert_matches = "1.3.0" -proptest = "1.0.0" +assert_matches.workspace = true +proptest.workspace = true [dependencies] primitive-types = { version = "0.12", default-features = false } -byteorder = "1" -blake2 = { package = "blake2b_simd", version = "1" } -proptest = { version = "1.0.0", optional = true } +byteorder.workspace = true +blake2b_simd.workspace = true +proptest = { workspace = true, optional = true } [features] test-dependencies = ["proptest"] diff --git a/zcash_history/src/version.rs b/zcash_history/src/version.rs index c9e53157d..bfc18fa6f 100644 --- a/zcash_history/src/version.rs +++ b/zcash_history/src/version.rs @@ -1,7 +1,7 @@ use std::fmt; use std::io; -use blake2::Params as Blake2Params; +use blake2b_simd::Params as Blake2Params; use byteorder::{ByteOrder, LittleEndian}; use crate::{node_data, NodeData, MAX_NODE_DATA_SIZE}; diff --git a/zcash_primitives/Cargo.toml b/zcash_primitives/Cargo.toml index e88ed685d..efcaa9b55 100644 --- a/zcash_primitives/Cargo.toml +++ b/zcash_primitives/Cargo.toml @@ -7,59 +7,59 @@ authors = [ "Kris Nuttycombe " ] homepage = "https://github.com/zcash/librustzcash" -repository = "https://github.com/zcash/librustzcash" +repository.workspace = true readme = "README.md" -license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" -categories = ["cryptography::cryptocurrencies"] +license.workspace = true +edition.workspace = true +rust-version.workspace = true +categories.workspace = true [package.metadata.docs.rs] all-features = true [dependencies] -equihash = { version = "0.2", path = "../components/equihash" } -zcash_address = { version = "0.3", path = "../components/zcash_address" } -zcash_encoding = { version = "0.2", path = "../components/zcash_encoding" } +equihash.workspace = true +zcash_address.workspace = true +zcash_encoding.workspace = true # Dependencies exposed in a public API: # (Breaking upgrades to these require a breaking upgrade to this crate.) # - CSPRNG -rand = "0.8" -rand_core = "0.6" +rand.workspace = true +rand_core.workspace = true # - Digests (output types exposed) -blake2b_simd = "1" -sha2 = "0.10" +blake2b_simd.workspace = true +sha2.workspace = true # - Metrics -memuse = "0.2.1" +memuse.workspace = true # - Secret management -subtle = "2.2.3" +subtle.workspace = true # - Shielded protocols -bls12_381 = "0.8" -ff = "0.13" -group = { version = "0.13", features = ["wnaf-memuse"] } -jubjub = "0.10" -nonempty = "0.7" -orchard = { version = "0.6", default-features = false } +bls12_381.workspace = true +ff.workspace = true +group = { workspace = true, features = ["wnaf-memuse"] } +jubjub.workspace = true +nonempty.workspace = true +orchard.workspace = true # - Note Commitment Trees -incrementalmerkletree = { version = "0.5", features = ["legacy-api"] } +incrementalmerkletree = { workspace = true, features = ["legacy-api"] } # - Static constants -lazy_static = "1" +lazy_static.workspace = true # - Test dependencies -proptest = { version = "1.0.0", optional = true } +proptest = { workspace = true, optional = true } # - Transparent inputs # - `Error` type exposed -hdwallet = { version = "0.4", optional = true } +hdwallet = { workspace = true, optional = true } # - `SecretKey` and `PublicKey` types exposed -secp256k1 = { version = "0.26", optional = true } +secp256k1 = { workspace = true, optional = true } # - ZIP 339 bip0039 = { version = "0.10", features = ["std", "all-languages"] } @@ -67,32 +67,32 @@ bip0039 = { version = "0.10", features = ["std", "all-languages"] } # Dependencies used internally: # (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.) # - Encodings -byteorder = "1" -hex = "0.4" +byteorder.workspace = true +hex.workspace = true # - Shielded protocols -bitvec = "1" -blake2s_simd = "1" +bitvec.workspace = true +blake2s_simd.workspace = true # - Transparent inputs -ripemd = { version = "0.1", optional = true } +ripemd = { workspace = true, optional = true } # - ZIP 32 -aes = "0.8" -fpe = "0.6" +aes.workspace = true +fpe.workspace = true [dependencies.zcash_note_encryption] -version = "0.4" +workspace = true features = ["pre-zip-212"] [dev-dependencies] chacha20poly1305 = "0.10" -criterion = "0.4" -incrementalmerkletree = { version = "0.5", features = ["legacy-api", "test-dependencies"] } -proptest = "1.0.0" -assert_matches = "1.3.0" -rand_xorshift = "0.3" -orchard = { version = "0.6", default-features = false, features = ["test-dependencies"] } +criterion.workspace = true +incrementalmerkletree = { workspace = true, features = ["legacy-api", "test-dependencies"] } +proptest.workspace = true +assert_matches.workspace = true +rand_xorshift.workspace = true +orchard = { workspace = true, features = ["test-dependencies"] } [target.'cfg(unix)'.dev-dependencies] pprof = { version = "0.11", features = ["criterion", "flamegraph"] } # MSRV 1.56 diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index a66295fd8..694c5f448 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -6,33 +6,33 @@ authors = [ "Jack Grigg ", ] homepage = "https://github.com/zcash/librustzcash" -repository = "https://github.com/zcash/librustzcash" +repository.workspace = true readme = "README.md" -license = "MIT OR Apache-2.0" -edition = "2021" -rust-version = "1.65" -categories = ["cryptography::cryptocurrencies"] +license.workspace = true +edition.workspace = true +rust-version.workspace = true +categories.workspace = true [package.metadata.docs.rs] all-features = true [dependencies] -zcash_primitives = { version = "0.13", path = "../zcash_primitives", default-features = false } +zcash_primitives.workspace = true # Dependencies exposed in a public API: # (Breaking upgrades to these require a breaking upgrade to this crate.) bellman = { version = "0.14", default-features = false, features = ["groth16"] } -bls12_381 = "0.8" -group = "0.13" -jubjub = "0.10" -lazy_static = "1" +bls12_381.workspace = true +group.workspace = true +jubjub.workspace = true +lazy_static.workspace = true minreq = { version = "2", features = ["https"], optional = true } -rand_core = "0.6" -tracing = "0.1" +rand_core.workspace = true +tracing.workspace = true # Dependencies used internally: # (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.) -blake2b_simd = "1" +blake2b_simd.workspace = true home = { version = "0.5", optional = true } known-folders = { version = "1", optional = true } redjubjub = "0.7" @@ -40,9 +40,9 @@ wagyu-zcash-parameters = { version = "0.2", optional = true } xdg = { version = "2.5", optional = true } [dev-dependencies] -byteorder = "1" -criterion = "0.4" -rand_xorshift = "0.3" +byteorder.workspace = true +criterion.workspace = true +rand_xorshift.workspace = true [target.'cfg(unix)'.dev-dependencies] pprof = { version = "0.11", features = ["criterion", "flamegraph"] } # MSRV 1.56