From 53ae87aa9d255ea53c34a652c77a9df56673d0b0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 17:12:35 +0000 Subject: [PATCH] chore: trim unnecessary Arti features to reduce binary size - Set default-features = false on arti-client and tor-rtcompat - Removed bridge-client (UI doesn't expose bridge config yet) - Narrowed tokio features from "full" to only what the SOCKS proxy needs: rt-multi-thread, net, io-util, time, macros Kept: tokio, rustls, compression, onion-service-client, static-sqlite (all required for Amethyst's .onion relay support) https://claude.ai/code/session_01BApgDd5udqBzMqysSRMpZu --- tools/arti-build/Cargo.toml | 7 +++---- tools/arti-build/README.md | 24 +++++++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/tools/arti-build/Cargo.toml b/tools/arti-build/Cargo.toml index 2a3bb6db3..befc17bd7 100644 --- a/tools/arti-build/Cargo.toml +++ b/tools/arti-build/Cargo.toml @@ -9,17 +9,16 @@ crate-type = ["cdylib"] [workspace] [dependencies] -arti-client = { version = "0.38", features = [ +arti-client = { version = "0.38", default-features = false, features = [ "tokio", "rustls", "compression", - "bridge-client", "onion-service-client", "static-sqlite", ] } -tor-rtcompat = { version = "0.38", features = ["tokio", "rustls"] } +tor-rtcompat = { version = "0.38", default-features = false, features = ["tokio", "rustls"] } jni = "0.21" -tokio = { version = "1", features = ["full"] } +tokio = { version = "1", features = ["rt-multi-thread", "net", "io-util", "time", "macros"] } anyhow = "1" [profile.release] diff --git a/tools/arti-build/README.md b/tools/arti-build/README.md index 1ee313b4e..4fce5231a 100644 --- a/tools/arti-build/README.md +++ b/tools/arti-build/README.md @@ -148,14 +148,24 @@ The Rust wrapper (`src/lib.rs`) exposes these JNI functions to Kotlin: ## Cargo.toml features -| Feature | Purpose | +Default features are disabled (`default-features = false`) to minimize binary size. + +| Feature | Purpose | Why included | +|---|---|---| +| `tokio` | Async runtime | Required by our SOCKS proxy | +| `rustls` | TLS via pure Rust | No OpenSSL dependency, smaller binary | +| `compression` | zstd/deflate relay traffic | Reduces bandwidth on Tor circuits | +| `onion-service-client` | Access .onion addresses | Amethyst routes .onion relay connections through Tor | +| `static-sqlite` | Bundled SQLite | Android native code can't use system SQLite | + +**Not included:** + +| Feature | Why excluded | |---|---| -| `tokio` | Async runtime | -| `rustls` | TLS without OpenSSL (smaller, no system dependency) | -| `compression` | Tor relay compression support | -| `bridge-client` | Connect via Tor bridges | -| `onion-service-client` | Access .onion addresses | -| `static-sqlite` | Bundled SQLite for state storage | +| `native-tls` | Using `rustls` instead (smaller, no system dependency) | +| `bridge-client` | Amethyst doesn't expose bridge configuration in UI yet. Add back if needed. | +| `pt-client` | Pluggable transports — same reason as bridges | +| `onion-service-service` | We only connect to .onion, we don't host them | ### Release profile