Skip to content

Client builds link two TLS crypto backends (aws-lc and ring) and the JSON-RPC server #2454

Closed

Description

@alpergundogdu

Problem

Every client build (decdn-cli, the decdn-client SDK, and the Android/iOS demos on top of it) compiles and links two complete crypto libraries, plus server code it never runs.

  • aws-lc (aws-lc-sys → aws-lc-rs). rustls uses it only for the HTTPS JSON-RPC calls to the chain. It arrives two ways:
    • alloy's default features turn on reqwest-rustls-tls, which in reqwest 0.13 means rustls on aws-lc-rs (decdn-client → alloy default → reqwest-rustls-tls → hyper-rustls/aws-lc-rs).
    • the workspace's own reqwest = { features = ["rustls", …] } (Cargo.toml) does the same.
  • ring. iroh's QUIC stack (noq-proto) already uses ring, so the client always ships it too.
  • The JSON-RPC server. decdn-common enables jsonrpsee's server feature (the node's admin RPC), so jsonrpsee-server lands in the client SDK as well.

Check on main:

cargo tree -p decdn-client -e normal -i aws-lc-sys
cargo tree -p decdn-client -e features -i jsonrpsee-server

Cost: a larger binary (several MB per target), a C build of aws-lc in every client build (slow, and a cross-compile risk on Android and iOS), and two TLS backends to audit. Found while building the mobile demos (decdn/android-demo, decdn/ios-demo).

Fix

  1. One TLS backend in clients: ring.
    • Workspace alloy: default-features = false, keeping the features in use (providers, signers, signer-keystore, contract, and reqwest without its TLS provider).
    • Workspace reqwest: rustls-no-provider in place of rustls.
    • With only rustls's ring feature compiled in, rustls picks ring on its own. Where a crate builds its own ClientConfig, use rustls::crypto::ring::default_provider() explicitly.
    • Scope: the client graph. The node may keep aws-lc if aws-sdk-s3 needs it.
  2. JSON-RPC server out of the client. Move jsonrpsee's server feature off the workspace dependency and onto the crate that serves the admin RPC (decdn-node). decdn-common keeps only the parts the client needs (types, http-client, macros), or puts the server half behind a feature only decdn-node enables.
  3. Keep it fixed. Add both to the closure checks in .github/scripts/check_crate_edges.py, which already forbids iroh-blobs and the AWS SDK in the decdn-cli / decdn-client closures: forbid aws-lc-sys and jsonrpsee-server there too.

Done when

  • cargo tree -p decdn-client -i aws-lc-sys and cargo tree -p decdn-cli -i aws-lc-sys find nothing.
  • cargo tree -p decdn-client -e features -i jsonrpsee-server finds nothing.
  • The crate-edges check fails if either comes back.
  • Chain reads over HTTPS still work (the anvil e2e tests use plain http, so check against the Arbitrum Sepolia RPC by hand or with a smoke test).

🤖 Generated with Claude Code

Activity

  1. added
    dependencies
    rust
    kind:chore
    on Oct 13, 2026
  2. self-assigned this
    on Oct 14, 2026
  3. moved this from Backlog to In progress in deCDNon Oct 14, 2026
  4. moved this from In progress to Done in deCDNon Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

dependencieskind:chorerust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions