From 05dc474cb347affc48f80db36e957316791953ec Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Tue, 31 Oct 2023 07:41:23 -0400 Subject: [PATCH] Correct std feature-flagging If a crate has std set, it should enable std for all dependencies in order to let them properly select which algorithms to use. Some crates fallback to slower/worse algorithms on no-std. Also more aggressively sets default-features = false leading to a *10%* reduction in the amount of crates coordinator builds. --- Cargo.lock | 13 +++-- coins/bitcoin/Cargo.toml | 26 +++++----- coins/monero/Cargo.toml | 16 ++++--- common/std-shims/Cargo.toml | 4 +- common/zalloc/Cargo.toml | 2 + coordinator/Cargo.toml | 43 ++++++++--------- coordinator/tributary/Cargo.toml | 30 ++++++------ coordinator/tributary/tendermint/Cargo.toml | 14 +++--- crypto/ciphersuite/Cargo.toml | 27 +++++++++-- crypto/dalek-ff-group/Cargo.toml | 6 ++- crypto/dkg/Cargo.toml | 10 +++- crypto/dleq/Cargo.toml | 15 +++--- crypto/ed448/Cargo.toml | 8 +++- crypto/multiexp/Cargo.toml | 2 +- crypto/schnorr/Cargo.toml | 2 +- crypto/transcript/Cargo.toml | 2 + message-queue/Cargo.toml | 31 ++++++------ processor/Cargo.toml | 53 ++++++++++----------- processor/messages/Cargo.toml | 16 +++---- 19 files changed, 185 insertions(+), 135 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4daa4856f..bbfca3301 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -644,6 +644,15 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "bls12_381" version = "0.8.0" @@ -3633,6 +3642,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ + "block-padding", "generic-array 0.14.7", ] @@ -9526,9 +9536,6 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] [[package]] name = "spki" diff --git a/coins/bitcoin/Cargo.toml b/coins/bitcoin/Cargo.toml index 608d7b762..ac6979bd8 100644 --- a/coins/bitcoin/Cargo.toml +++ b/coins/bitcoin/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" [dependencies] std-shims = { version = "0.1.1", path = "../../common/std-shims", default-features = false } -thiserror = { version = "1", optional = true } +thiserror = { version = "1", default-features = false, optional = true } zeroize = { version = "^1.5", default-features = false } rand_core = { version = "0.6", default-features = false } @@ -22,18 +22,18 @@ bitcoin = { version = "0.31", default-features = false, features = ["no-std"] } k256 = { version = "^0.13.1", default-features = false, features = ["arithmetic", "bits"] } -transcript = { package = "flexible-transcript", path = "../../crypto/transcript", version = "0.3", features = ["recommended"], optional = true } -frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.8", features = ["secp256k1"], optional = true } +transcript = { package = "flexible-transcript", path = "../../crypto/transcript", version = "0.3", default-features = false, features = ["recommended"], optional = true } +frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.8", default-features = false, features = ["secp256k1"], optional = true } -hex = { version = "0.4", optional = true } -serde = { version = "1", features = ["derive"], optional = true } -serde_json = { version = "1", optional = true } -reqwest = { version = "0.11", features = ["json"], optional = true } +hex = { version = "0.4", default-features = false, optional = true } +serde = { version = "1", default-features = false, features = ["derive"], optional = true } +serde_json = { version = "1", default-features = false, optional = true } +reqwest = { version = "0.11", default-features = false, features = ["default-tls", "json"], optional = true } [dev-dependencies] frost = { package = "modular-frost", path = "../../crypto/frost", features = ["tests"] } -tokio = { version = "1", features = ["full"] } +tokio = { version = "1", features = ["macros"] } [features] std = [ @@ -52,13 +52,13 @@ std = [ "k256/std", - "transcript", + "transcript/std", "frost", - "hex", - "serde", - "serde_json", - "reqwest" + "hex/std", + "serde/std", + "serde_json/std", + "reqwest", ] hazmat = [] default = ["std"] diff --git a/coins/monero/Cargo.toml b/coins/monero/Cargo.toml index 910b152cd..701f7ebbe 100644 --- a/coins/monero/Cargo.toml +++ b/coins/monero/Cargo.toml @@ -15,7 +15,7 @@ rustdoc-args = ["--cfg", "docsrs"] std-shims = { path = "../../common/std-shims", version = "^0.1.1", default-features = false } async-trait = { version = "0.1", default-features = false } -thiserror = { version = "1", optional = true } +thiserror = { version = "1", default-features = false, optional = true } zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] } subtle = { version = "^2.4", default-features = false } @@ -40,8 +40,8 @@ multiexp = { path = "../../crypto/multiexp", version = "0.4", default-features = # Needed for multisig transcript = { package = "flexible-transcript", path = "../../crypto/transcript", version = "0.3", default-features = false, features = ["recommended"], optional = true } -dleq = { path = "../../crypto/dleq", version = "0.4", features = ["serialize"], optional = true } -frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.8", features = ["ed25519"], optional = true } +dleq = { path = "../../crypto/dleq", version = "0.4", default-features = false, features = ["serialize"], optional = true } +frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.8", default-features = false, features = ["ed25519"], optional = true } monero-generators = { path = "generators", version = "0.4", default-features = false } @@ -55,7 +55,7 @@ serde_json = { version = "1", default-features = false, features = ["alloc"] } base58-monero = { version = "2", default-features = false, features = ["check"] } # Used for the provided HTTP RPC -digest_auth = { version = "0.3", optional = true } +digest_auth = { version = "0.3", default-features = false, optional = true } hyper = { version = "0.14", default-features = false, features = ["http1", "tcp", "client", "backports", "deprecated"], optional = true } hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "native-tokio"], optional = true } tokio = { version = "1", default-features = false, optional = true } @@ -65,7 +65,7 @@ dalek-ff-group = { path = "../../crypto/dalek-ff-group", version = "0.4", defaul monero-generators = { path = "generators", version = "0.4", default-features = false } [dev-dependencies] -tokio = { version = "1", features = ["rt-multi-thread", "sync", "macros"] } +tokio = { version = "1", features = ["sync", "macros"] } frost = { package = "modular-frost", path = "../../crypto/frost", features = ["tests"] } @@ -79,14 +79,18 @@ std = [ "subtle/std", "rand_core/std", - "rand_chacha/std", "rand/std", + "rand_chacha/std", "rand_distr/std", "sha3/std", + "pbkdf2/std", "multiexp/std", + "transcript/std", + "dleq/std", + "monero-generators/std", "futures/std", diff --git a/common/std-shims/Cargo.toml b/common/std-shims/Cargo.toml index e4cf73782..3f248dc6d 100644 --- a/common/std-shims/Cargo.toml +++ b/common/std-shims/Cargo.toml @@ -14,8 +14,8 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -spin = { version = "0.9", features = ["mutex", "once"] } -hashbrown = "0.14" +spin = { version = "0.9", default-features = false, features = ["use_ticket_mutex", "once"] } +hashbrown = { version = "0.14", default-features = false, features = ["ahash", "inline-more"] } [features] std = [] diff --git a/common/zalloc/Cargo.toml b/common/zalloc/Cargo.toml index c8076df50..169f08a46 100644 --- a/common/zalloc/Cargo.toml +++ b/common/zalloc/Cargo.toml @@ -17,5 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"] zeroize = { version = "^1.5", default-features = false } [features] +std = ["zeroize/std"] +default = ["std"] # Commented for now as it requires nightly and we don't use nightly # allocator = [] diff --git a/coordinator/Cargo.toml b/coordinator/Cargo.toml index 5ce736ace..760dc0a8e 100644 --- a/coordinator/Cargo.toml +++ b/coordinator/Cargo.toml @@ -14,23 +14,21 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -async-trait = "0.1" +async-trait = { version = "0.1", default-features = false } -zeroize = "^1.5" -rand_core = "0.6" -rand_chacha = "0.3" +zeroize = { version = "^1.5", default-features = false, features = ["std"] } +rand_core = { version = "0.6", default-features = false, features = ["std"] } +rand_chacha = { version = "0.3", default-features = false, features = ["std"] } -blake2 = "0.10" +blake2 = { version = "0.10", default-features = false, features = ["std"] } -transcript = { package = "flexible-transcript", path = "../crypto/transcript", features = ["recommended"] } -ciphersuite = { path = "../crypto/ciphersuite" } -schnorr = { package = "schnorr-signatures", path = "../crypto/schnorr" } +transcript = { package = "flexible-transcript", path = "../crypto/transcript", default-features = false, features = ["std", "recommended"] } +ciphersuite = { path = "../crypto/ciphersuite", default-features = false, features = ["std"] } +schnorr = { package = "schnorr-signatures", path = "../crypto/schnorr", default-features = false, features = ["std"] } frost = { package = "modular-frost", path = "../crypto/frost" } frost-schnorrkel = { path = "../crypto/schnorrkel" } -scale = { package = "parity-scale-codec", version = "3", features = ["derive"] } - -sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["std", "derive"] } serai-db = { path = "../common/db", features = ["rocksdb"] } serai-env = { path = "../common/env" } @@ -39,20 +37,21 @@ processor-messages = { package = "serai-processor-messages", path = "../processo message-queue = { package = "serai-message-queue", path = "../message-queue" } tributary = { package = "tributary-chain", path = "./tributary" } -serai-client = { path = "../substrate/client", features = ["serai"] } +serai-client = { path = "../substrate/client", default-features = false, features = ["serai"] } -hex = "0.4" -bincode = "1" -serde_json = { version = "1", default-features = false } +hex = { version = "0.4", default-features = false, features = ["std"] } +bincode = { version = "1", default-features = false } +serde_json = { version = "1", default-features = false, features = ["std"] } -log = "0.4" -env_logger = "0.10" +log = { version = "0.4", default-features = false, features = ["std"] } +env_logger = { version = "0.10", default-features = false, features = ["humantime"] } -futures = "0.3" -tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "macros"] } -libp2p = { version = "0.52", features = ["tokio", "tcp", "noise", "yamux", "gossipsub", "mdns", "macros"] } +futures = { version = "0.3", default-features = false, features = ["std"] } +tokio = { version = "1", default-features = false, features = ["rt-multi-thread", "sync", "time", "macros"] } +libp2p = { version = "0.52", default-features = false, features = ["tokio", "tcp", "noise", "yamux", "gossipsub", "mdns", "macros"] } [dev-dependencies] -futures = "0.3" +futures = { version = "0.3", default-features = false, features = ["std"] } tributary = { package = "tributary-chain", path = "./tributary", features = ["tests"] } -sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false } +sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] } +sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] } diff --git a/coordinator/tributary/Cargo.toml b/coordinator/tributary/Cargo.toml index b4eb49355..ff6dc1e31 100644 --- a/coordinator/tributary/Cargo.toml +++ b/coordinator/tributary/Cargo.toml @@ -8,31 +8,31 @@ authors = ["Luke Parker "] edition = "2021" [dependencies] -async-trait = "0.1" -thiserror = "1" +async-trait = { version = "0.1", default-features = false } +thiserror = { version = "1", default-features = false } -subtle = "^2" -zeroize = "^1.5" +subtle = { version = "^2", default-features = false, features = ["std"] } +zeroize = { version = "^1.5", default-features = false, features = ["std"] } -rand = "0.8" -rand_chacha = "0.3" +rand = { version = "0.8", default-features = false, features = ["std"] } +rand_chacha = { version = "0.3", default-features = false, features = ["std"] } -blake2 = "0.10" -transcript = { package = "flexible-transcript", path = "../../crypto/transcript", features = ["recommended"] } +blake2 = { version = "0.10", default-features = false, features = ["std"] } +transcript = { package = "flexible-transcript", path = "../../crypto/transcript", default-features = false, features = ["std", "recommended"] } -ciphersuite = { package = "ciphersuite", path = "../../crypto/ciphersuite", features = ["ristretto"] } -schnorr = { package = "schnorr-signatures", path = "../../crypto/schnorr" } +ciphersuite = { package = "ciphersuite", path = "../../crypto/ciphersuite", default-features = false, features = ["std", "ristretto"] } +schnorr = { package = "schnorr-signatures", path = "../../crypto/schnorr", default-features = false, features = ["std"] } -hex = "0.4" -log = "0.4" +hex = { version = "0.4", default-features = false, features = ["std"] } +log = { version = "0.4", default-features = false, features = ["std"] } serai-db = { path = "../../common/db" } -scale = { package = "parity-scale-codec", version = "3", features = ["derive"] } -futures = "0.3" +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["std", "derive"] } +futures = { version = "0.3", default-features = false, features = ["std"] } tendermint = { package = "tendermint-machine", path = "./tendermint" } -tokio = { version = "1", features = ["sync", "time", "rt"] } +tokio = { version = "1", default-features = false, features = ["sync", "time", "rt"] } [dev-dependencies] tokio = { version = "1", features = ["macros"] } diff --git a/coordinator/tributary/tendermint/Cargo.toml b/coordinator/tributary/tendermint/Cargo.toml index 14a797465..652e10d8c 100644 --- a/coordinator/tributary/tendermint/Cargo.toml +++ b/coordinator/tributary/tendermint/Cargo.toml @@ -8,16 +8,16 @@ authors = ["Luke Parker "] edition = "2021" [dependencies] -async-trait = "0.1" -thiserror = "1" +async-trait = { version = "0.1", default-features = false } +thiserror = { version = "1", default-features = false } -hex = "0.4" -log = "0.4" +hex = { version = "0.4", default-features = false, features = ["std"] } +log = { version = "0.4", default-features = false, features = ["std"] } -parity-scale-codec = { version = "3", features = ["derive"] } +parity-scale-codec = { version = "3", default-features = false, features = ["std", "derive"] } -futures = "0.3" -tokio = { version = "1", features = ["sync", "time"] } +futures = { version = "0.3", default-features = false, features = ["std", "async-await"] } +tokio = { version = "1", default-features = false, features = ["sync", "time"] } [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } diff --git a/crypto/ciphersuite/Cargo.toml b/crypto/ciphersuite/Cargo.toml index 40ccea9b2..2dad48770 100644 --- a/crypto/ciphersuite/Cargo.toml +++ b/crypto/ciphersuite/Cargo.toml @@ -38,15 +38,36 @@ k256 = { version = "^0.13.1", default-features = false, features = ["arithmetic" minimal-ed448 = { path = "../ed448", version = "0.4", default-features = false, optional = true } [dev-dependencies] -hex = "0.4" +hex = { version = "0.4", default-features = false, features = ["std"] } -rand_core = { version = "0.6", features = ["std"] } +rand_core = { version = "0.6", default-features = false, features = ["std"] } ff-group-tests = { version = "0.13", path = "../ff-group-tests" } [features] alloc = ["std-shims"] -std = ["zeroize/std", "std-shims/std"] +std = [ + "std-shims/std", + + "rand_core/std", + + "zeroize/std", + "subtle/std", + + "digest/std", + "transcript/std", + "sha2?/std", + "sha3?/std", + + "ff/std", + + "dalek-ff-group?/std", + + "elliptic-curve?/std", + "p256?/std", + "k256?/std", + "minimal-ed448?/std", +] dalek = ["sha2", "dalek-ff-group"] ed25519 = ["dalek"] diff --git a/crypto/dalek-ff-group/Cargo.toml b/crypto/dalek-ff-group/Cargo.toml index 8dc1a6759..dc0ce06fa 100644 --- a/crypto/dalek-ff-group/Cargo.toml +++ b/crypto/dalek-ff-group/Cargo.toml @@ -32,5 +32,9 @@ sha2 = { version = "0.10", default-features = false } curve25519-dalek = { version = ">= 4.0, < 4.2", default-features = false, features = ["alloc", "zeroize", "digest", "group", "precomputed-tables"] } [dev-dependencies] -rand_core = { version = "0.6", features = ["std"] } +rand_core = { version = "0.6", default-features = false, features = ["std"] } ff-group-tests = { path = "../ff-group-tests" } + +[features] +std = ["zeroize/std", "subtle/std", "rand_core/std", "digest/std", "sha2/std"] +default = ["std"] diff --git a/crypto/dkg/Cargo.toml b/crypto/dkg/Cargo.toml index efc00587c..ac26d3a92 100644 --- a/crypto/dkg/Cargo.toml +++ b/crypto/dkg/Cargo.toml @@ -40,16 +40,22 @@ ciphersuite = { path = "../ciphersuite", default-features = false, features = [" [features] std = [ "thiserror", + "rand_core/std", "std-shims/std", - "ciphersuite/std", + "serde/std", - "multiexp/batch", + "transcript/std", + "chacha20/std", + + "ciphersuite/std", "multiexp/std", + "multiexp/batch", "schnorr/std", + "dleq/std", "dleq/serialize" ] serde = ["dep:serde"] diff --git a/crypto/dleq/Cargo.toml b/crypto/dleq/Cargo.toml index 0e41ad5c0..36da97652 100644 --- a/crypto/dleq/Cargo.toml +++ b/crypto/dleq/Cargo.toml @@ -41,15 +41,18 @@ dalek-ff-group = { path = "../dalek-ff-group" } transcript = { package = "flexible-transcript", path = "../transcript", features = ["recommended"] } [features] -std = [] +std = ["rand_core/std", "zeroize/std", "digest/std", "transcript/std", "ff/std", "multiexp?/std"] serialize = ["std"] # Needed for cross-group DLEqs secure_capacity_difference = [] experimental = ["std", "thiserror", "multiexp"] -# Only applies to experimental, yet is default to ensure security -# experimental doesn't mandate it itself in case two curves with extreme -# capacity differences are desired to be used together, in which case the user -# must specify experimental without default features -default = ["secure_capacity_difference"] +default = [ + "std", + # Only applies to experimental, yet is default to ensure security + # experimental doesn't mandate it itself in case two curves with extreme + # capacity differences are desired to be used together, in which case the user + # must specify experimental without default features + "secure_capacity_difference" +] diff --git a/crypto/ed448/Cargo.toml b/crypto/ed448/Cargo.toml index c9184ed02..ce8f0f5e2 100644 --- a/crypto/ed448/Cargo.toml +++ b/crypto/ed448/Cargo.toml @@ -28,8 +28,12 @@ generic-array = { version = "1", default-features = false } crypto-bigint = { version = "0.5", default-features = false, features = ["zeroize"] } [dev-dependencies] -hex = "0.4" +hex = { version = "0.4", default-features = false, features = ["std"] } -rand_core = { version = "0.6", features = ["std"] } +rand_core = { version = "0.6", default-features = false, features = ["std"] } ff-group-tests = { path = "../ff-group-tests" } + +[features] +std = ["rand_core/std", "zeroize/std", "subtle/std", "ff/std"] +default = ["std"] diff --git a/crypto/multiexp/Cargo.toml b/crypto/multiexp/Cargo.toml index d9231d0fc..128fca4a7 100644 --- a/crypto/multiexp/Cargo.toml +++ b/crypto/multiexp/Cargo.toml @@ -32,7 +32,7 @@ k256 = { version = "^0.13.1", default-features = false, features = ["arithmetic" dalek-ff-group = { path = "../dalek-ff-group" } [features] -std = ["std-shims/std", "zeroize/std"] +std = ["std-shims/std", "zeroize/std", "ff/std", "rand_core/std"] batch = ["rand_core"] diff --git a/crypto/schnorr/Cargo.toml b/crypto/schnorr/Cargo.toml index 191b3289e..fc03a10b2 100644 --- a/crypto/schnorr/Cargo.toml +++ b/crypto/schnorr/Cargo.toml @@ -36,5 +36,5 @@ dalek-ff-group = { path = "../dalek-ff-group" } ciphersuite = { path = "../ciphersuite", features = ["ed25519"] } [features] -std = ["std-shims/std", "ciphersuite/std", "multiexp/std"] +std = ["std-shims/std", "rand_core/std", "zeroize/std", "transcript/std", "ciphersuite/std", "multiexp/std"] default = ["std"] diff --git a/crypto/transcript/Cargo.toml b/crypto/transcript/Cargo.toml index e55261219..eba5da7e8 100644 --- a/crypto/transcript/Cargo.toml +++ b/crypto/transcript/Cargo.toml @@ -29,6 +29,8 @@ sha2 = { version = "0.10", default-features = false } blake2 = { version = "0.10", default-features = false } [features] +std = ["subtle/std", "zeroize/std", "digest/std", "blake2?/std", "merlin?/std"] recommended = ["blake2"] merlin = ["dep:merlin"] tests = [] +default = ["std"] diff --git a/message-queue/Cargo.toml b/message-queue/Cargo.toml index d09117893..d131e4228 100644 --- a/message-queue/Cargo.toml +++ b/message-queue/Cargo.toml @@ -15,28 +15,29 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] # Macros -lazy_static = "1" -serde = { version = "1", features = ["derive"] } +lazy_static = { version = "1", default-features = false } +serde = { version = "1", default-features = false, features = ["std", "derive"] } # Encoders -hex = "0.4" -bincode = "1" -serde_json = "1" +hex = { version = "0.4", default-features = false, features = ["std"] } +bincode = { version = "1", default-features = false } +serde_json = { version = "1", default-features = false, features = ["std"] } # Libs -zeroize = "1" -rand_core = "0.6" +zeroize = { version = "1", default-features = false, features = ["std"] } +rand_core = { version = "0.6", default-features = false, features = ["std"] } # Cryptography -transcript = { package = "flexible-transcript", path = "../crypto/transcript", features = ["recommended"] } -ciphersuite = { path = "../crypto/ciphersuite", features = ["ristretto"] } -schnorr-signatures = { path = "../crypto/schnorr" } +transcript = { package = "flexible-transcript", path = "../crypto/transcript", default-features = false, features = ["std", "recommended"] } +ciphersuite = { path = "../crypto/ciphersuite", default-features = false, features = ["std", "ristretto"] } +schnorr-signatures = { path = "../crypto/schnorr", default-features = false, features = ["std"] } # Application -log = "0.4" -env_logger = "0.10" +log = { version = "0.4", default-features = false, features = ["std"] } +env_logger = { version = "0.10", default-features = false, features = ["humantime"] } -tokio = { version = "1", features = ["rt-multi-thread", "time", "macros"] } +# Uses a single threaded runtime since this shouldn't ever be CPU-bound +tokio = { version = "1", default-features = false, features = ["rt", "time", "macros"] } serai-db = { path = "../common/db", optional = true } @@ -44,8 +45,8 @@ serai-env = { path = "../common/env" } serai-primitives = { path = "../substrate/primitives" } -jsonrpsee = { version = "0.16", features = ["server"], optional = true } -reqwest = { version = "0.11", features = ["json"] } +jsonrpsee = { version = "0.16", default-features = false, features = ["server"], optional = true } +reqwest = { version = "0.11", default-features = false, features = ["json"] } [features] binaries = ["serai-db", "serai-db/rocksdb", "jsonrpsee"] diff --git a/processor/Cargo.toml b/processor/Cargo.toml index 2418d850e..50d1a61e5 100644 --- a/processor/Cargo.toml +++ b/processor/Cargo.toml @@ -15,47 +15,44 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] # Macros -async-trait = "0.1" -lazy_static = "1" -zeroize = "1" -thiserror = "1" -serde = { version = "1", default-features = false, features = ["derive"] } +async-trait = { version = "0.1", default-features = false } +lazy_static = { version = "1", default-features = false } +zeroize = { version = "1", default-features = false, features = ["std"] } +thiserror = { version = "1", default-features = false } +serde = { version = "1", default-features = false, features = ["std", "derive"] } # Libs -rand_core = { version = "0.6", default-features = false, features = ["getrandom"] } -rand_chacha = { version = "0.3", default-features = false } +rand_core = { version = "0.6", default-features = false, features = ["std", "getrandom"] } +rand_chacha = { version = "0.3", default-features = false, features = ["std"] } # Encoders -hex = "0.4" -scale = { package = "parity-scale-codec", version = "3" } +hex = { version = "0.4", default-features = false, features = ["std"] } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["std"] } bincode = { version = "1", default-features = false } -serde_json = { version = "1", default-features = false } +serde_json = { version = "1", default-features = false, features = ["std"] } # Cryptography -ciphersuite = { path = "../crypto/ciphersuite", default-features = false, features = ["ristretto"] } +ciphersuite = { path = "../crypto/ciphersuite", default-features = false, features = ["std", "ristretto"] } -transcript = { package = "flexible-transcript", default-features = false, path = "../crypto/transcript" } -frost = { package = "modular-frost", path = "../crypto/frost", features = ["ristretto"] } -frost-schnorrkel = { path = "../crypto/schnorrkel" } - -# Substrate -sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false } +transcript = { package = "flexible-transcript", path = "../crypto/transcript", default-features = false, features = ["std"] } +frost = { package = "modular-frost", path = "../crypto/frost", default-features = false, features = ["ristretto"] } +frost-schnorrkel = { path = "../crypto/schnorrkel", default-features = false } # Bitcoin -secp256k1 = { version = "0.28", features = ["global-context", "rand-std"], optional = true } -k256 = { version = "^0.13.1", optional = true } -bitcoin-serai = { path = "../coins/bitcoin", optional = true } +secp256k1 = { version = "0.28", default-features = false, features = ["std", "global-context", "rand-std"], optional = true } +k256 = { version = "^0.13.1", default-features = false, features = ["std"], optional = true } +bitcoin-serai = { path = "../coins/bitcoin", default-features = false, features = ["std"], optional = true } # Monero -dalek-ff-group = { path = "../crypto/dalek-ff-group", optional = true } -monero-serai = { path = "../coins/monero", features = ["multisig"], optional = true } +dalek-ff-group = { path = "../crypto/dalek-ff-group", default-features = false, features = ["std"], optional = true } +monero-serai = { path = "../coins/monero", default-features = false, features = ["std", "http-rpc", "multisig"], optional = true } # Application -log = "0.4" -env_logger = "0.10" -tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "macros"] } +log = { version = "0.4", default-features = false, features = ["std"] } +env_logger = { version = "0.10", default-features = false, features = ["humantime"] } +tokio = { version = "1", default-features = false, features = ["rt-multi-thread", "sync", "time", "macros"] } -serai-db = { path = "../common/db", default-features = false, features = ["rocksdb"] } +serai-db = { path = "../common/db", features = ["rocksdb"] } serai-env = { path = "../common/env" } serai-client = { path = "../substrate/client", default-features = false } @@ -64,11 +61,11 @@ messages = { package = "serai-processor-messages", path = "./messages" } message-queue = { package = "serai-message-queue", path = "../message-queue" } [dev-dependencies] -futures = "0.3" +futures = { version = "0.3", default-features = false } frost = { package = "modular-frost", path = "../crypto/frost", features = ["tests"] } -env_logger = "0.10" +sp-application-crypto = { git = "https://github.com/serai-dex/substrate", default-features = false, features = ["std"] } dockertest = "0.4" serai-docker-tests = { path = "../tests/docker" } diff --git a/processor/messages/Cargo.toml b/processor/messages/Cargo.toml index b4078f909..98684ed32 100644 --- a/processor/messages/Cargo.toml +++ b/processor/messages/Cargo.toml @@ -14,14 +14,14 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -zeroize = { version = "1", features = ["derive"] } +zeroize = { version = "1", default-features = false, features = ["std", "derive"] } -scale = { package = "parity-scale-codec", version = "3", default-features = false } -serde = { version = "1", features = ["derive"] } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["std"] } +serde = { version = "1", default-features = false, features = ["std", "derive"] } -dkg = { path = "../../crypto/dkg", features = ["serde"] } +dkg = { path = "../../crypto/dkg", default-features = false, features = ["std", "serde"] } -serai-primitives = { path = "../../substrate/primitives" } -in-instructions-primitives = { package = "serai-in-instructions-primitives", path = "../../substrate/in-instructions/primitives" } -coins-primitives = { package = "serai-coins-primitives", path = "../../substrate/coins/primitives" } -validator-sets-primitives = { package = "serai-validator-sets-primitives", path = "../../substrate/validator-sets/primitives" } +serai-primitives = { path = "../../substrate/primitives", default-features = false, features = ["std"] } +in-instructions-primitives = { package = "serai-in-instructions-primitives", path = "../../substrate/in-instructions/primitives", default-features = false, features = ["std"] } +coins-primitives = { package = "serai-coins-primitives", path = "../../substrate/coins/primitives", default-features = false, features = ["std"] } +validator-sets-primitives = { package = "serai-validator-sets-primitives", path = "../../substrate/validator-sets/primitives", default-features = false, features = ["std"] }