chore(services): drop unused declared deps (cargo-machete cleanup)

Remove dependencies declared in 5 service Cargo.toml files that no
source code in those services references (verified by grepping for
use statements). Reduces dep-graph fan-out and unnecessary recompiles.

  services/api/Cargo.toml             −16 deps  (async-trait, bytes,
                                                 const-oid, hdrhistogram,
                                                 hex, http-body, hyper,
                                                 hyper-util, num-traits,
                                                 rust_decimal, tokio-stream,
                                                 tower-layer, tower-service,
                                                 tracing-subscriber,
                                                 trading_engine, zeroize.
                                                 + json feature added to
                                                 reqwest since trading_engine
                                                 was enabling it transitively)
  services/trading_service/Cargo.toml −11 deps
  services/backtesting_service/Cargo.toml −17 deps
  services/trading_agent_service/Cargo.toml −6 deps
  services/ml_training_service/Cargo.toml −4 deps

False positives kept (cargo-machete misses these because they're only
referenced in tonic-generated proto code, not in hand-written src):
  - prost            (`::prost::Message` derive in build.rs-generated code)
  - tonic-prost      (`tonic_prost::ProstCodec::default()` in generated tonic
                     clients/servers)

cargo check --workspace passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-05-01 01:37:49 +02:00
parent 05687ac941
commit 5b9995c6f5
4 changed files with 5 additions and 41 deletions

View File

@@ -25,18 +25,16 @@ tokio.workspace = true
serde.workspace = true
serde_json.workspace = true
anyhow.workspace = true
thiserror.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
uuid.workspace = true
chrono.workspace = true
num_cpus.workspace = true
rand.workspace = true
rust_decimal.workspace = true
semver.workspace = true
num-traits.workspace = true
# gRPC - USE WORKSPACE
# NOTE: tonic-prost & prost used by generated proto code (ProstCodec, ::prost::Message)
tonic.workspace = true
tonic-prost.workspace = true
prost.workspace = true
@@ -51,27 +49,18 @@ once_cell.workspace = true
# Database - USE WORKSPACE
sqlx.workspace = true
influxdb2.workspace = true
# Configuration - USE WORKSPACE
config.workspace = true
dotenvy.workspace = true
# Async and parallel processing - USE WORKSPACE
tokio-util.workspace = true
tokio-stream.workspace = true
async-stream.workspace = true
async-trait.workspace = true
rayon.workspace = true
crossbeam.workspace = true
dashmap.workspace = true
# Cryptography and security for TLS/mTLS
x509-parser = "0.16"
reqwest = { version = "0.12", features = ["rustls-tls"], default-features = false }
rustls = { version = "0.23", features = ["ring"], default-features = false } # Wave 75: TLS crypto provider
base64.workspace = true
sha2.workspace = true
# DBN (Databento Binary) support for market data replay
dbn = "0.42.0"
@@ -80,15 +69,9 @@ dbn = "0.42.0"
clap = { version = "4.5", features = ["derive"] }
# Internal workspace crates
trading_engine.workspace = true
risk.workspace = true
ml = { workspace = true, features = ["financial"] } # Minimal ML for backtesting
data.workspace = true
common = { workspace = true, features = ["database"] }
storage.workspace = true
model_loader = { path = "../../crates/model_loader" } # Real model loading with S3 and caching
# Model functionality from ml-data
ml-data = { path = "../../crates/ml-data" }
[dev-dependencies]
tokio-test.workspace = true

View File

@@ -21,12 +21,12 @@ clap.workspace = true
rust_decimal.workspace = true
# gRPC and protocol buffers - USE WORKSPACE
# NOTE: tonic-prost & prost used by generated proto code (ProstCodec, ::prost::Message)
tonic.workspace = true
tonic-prost.workspace = true
tonic-health.workspace = true
tonic-reflection.workspace = true
prost.workspace = true
prost-types.workspace = true
# Database and compression - USE WORKSPACE
sqlx.workspace = true
@@ -38,13 +38,10 @@ tokio-util.workspace = true
async-stream.workspace = true
futures.workspace = true
async-trait.workspace = true
tokio-retry.workspace = true
# Logging, tracing and metrics - USE WORKSPACE
tracing.workspace = true
tracing-subscriber.workspace = true
metrics.workspace = true
metrics-exporter-prometheus.workspace = true
prometheus.workspace = true
once_cell.workspace = true

View File

@@ -16,18 +16,16 @@ path = "src/main.rs"
tokio.workspace = true
anyhow.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
serde.workspace = true
serde_json.workspace = true
once_cell.workspace = true
# gRPC and networking
# NOTE: tonic-prost & prost used by generated proto code (ProstCodec, ::prost::Message)
tonic = { workspace = true, features = ["transport", "server", "tls-ring", "tls-webpki-roots"] }
tonic-prost.workspace = true
tonic-reflection.workspace = true
tonic-health.workspace = true
prost.workspace = true
tower.workspace = true
hyper.workspace = true
http-body-util.workspace = true
hyper-util.workspace = true
@@ -35,9 +33,7 @@ bytes.workspace = true
# Async streams and futures
tokio-stream.workspace = true
async-stream.workspace = true
futures.workspace = true
async-trait.workspace = true
# Performance monitoring
prometheus.workspace = true
@@ -63,7 +59,6 @@ thiserror.workspace = true
rust_decimal = { workspace = true, features = ["serde"] }
rust_decimal_macros.workspace = true
nalgebra.workspace = true
num-traits.workspace = true
[build-dependencies]
tonic-prost-build.workspace = true

View File

@@ -28,15 +28,13 @@ clap.workspace = true
# gRPC and networking - USE WORKSPACE
# NOTE: Tonic 0.14 uses 'tls-ring' instead of 'tls'
# NOTE: Tonic 0.14 requires tonic-prost for generated code runtime
# NOTE: Tonic 0.14 requires tonic-prost for generated code runtime (codec::ProstCodec)
# NOTE: prost is used by generated proto code via ::prost::Message derive
tonic = { workspace = true, features = ["transport", "server", "tls-ring", "tls-webpki-roots"] }
tonic-prost.workspace = true
tonic-reflection.workspace = true
tonic-health.workspace = true
prost.workspace = true
tower.workspace = true
tower-layer.workspace = true
tower-service.workspace = true
hyper.workspace = true
http-body.workspace = true
http-body-util.workspace = true
@@ -45,11 +43,9 @@ bytes.workspace = true
# Async streams and futures - USE WORKSPACE
tokio-stream.workspace = true
async-stream.workspace = true
futures.workspace = true
futures-util = "0.3"
async-trait.workspace = true
url = "2.5"
fastrand.workspace = true
tokio-tungstenite.workspace = true
@@ -68,7 +64,6 @@ chrono.workspace = true
thiserror.workspace = true
secrecy.workspace = true # Secure secret handling (still needed for other modules)
zeroize.workspace = true # Secure memory zeroing (still needed for other modules)
uuid.workspace = true
sqlx = { workspace = true, features = ["postgres", "chrono", "uuid", "json", "macros"] }
redis = { workspace = true, features = ["tokio-comp", "connection-manager"] }
@@ -79,7 +74,6 @@ num-traits.workspace = true
rust_decimal.workspace = true
rand.workspace = true
sysinfo = "0.33"
log.workspace = true
dbn.workspace = true # DBN market data for E2E testing
# Internal workspace crates
@@ -88,12 +82,7 @@ risk.workspace = true
ml = { workspace = true, features = ["financial"] } # Minimal ML for inference only
data.workspace = true
common = { workspace = true, features = ["database"] }
storage = { workspace = true }
config = { workspace = true, features = ["postgres"] }
database = { path = "../../crates/database" }
# Model functionality from storage and ml-data crates
ml-data = { path = "../../crates/ml-data" }
semver.workspace = true
[build-dependencies]
# NOTE: Tonic 0.14+ uses tonic-prost-build instead of tonic-build