Skip to content

build(deps): link one TLS backend and no JSON-RPC server in client builds - #2459

Merged
thiras merged 3 commits into
mainfrom
fix/2454-ring-only-client-tls
Oct 14, 2026
Merged

thiras merged 3 commits into
mainfrom
fix/2454-ring-only-client-tls

Conversation

@thiras

@thiras thiras commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

decdn-client and the decdn CLI compiled two TLS crypto libraries (aws-lc beside the ring that iroh's QUIC stack links) and the admin RPC's JSON-RPC server. This PR leaves them one backend, ring, and no server. The release decdn binary drops from 32.5 MB to 29.6 MB (−2.9 MB).

  • aws-lc out. Its only entry was reqwest's rustls feature, reached through alloy's default reqwest-rustls-tls and through the workspace reqwest. alloy is now default-features = false, and reqwest uses rustls-no-provider.
  • A provider is installed. With rustls-no-provider, reqwest panics in Client::build unless a process-wide rustls provider is installed. It never falls back to the provider that rustls's crate features select, so the issue's "rustls picks ring on its own" does not hold. Every alloy connect_http hits this, even for http://. The new decdn_common::tls::install_crypto_provider() installs ring and does nothing if a provider is already installed. Callers:
    • both binaries, at start;
    • the SDK's provider builders and registry discovery, so a mobile host needs no call of its own;
    • HttpOrigin, runtime::run, metered_http_client and the e2e ChainFixture;
    • every test that builds a client directly.
  • Node. Its chain RPC also moves to ring. Otherwise a combined cargo build -p decdn-node -p decdn-cli would merge aws-lc back into the CLI. The S3 client keeps aws-lc (CryptoMode::AwsLc).
  • JSON-RPC server out. jsonrpsee's server feature moves off the workspace dependency. decdn-common emits AdminRpcServer only under a new admin-server feature, and only decdn-node enables it.
  • The guard. check_crate_edges.py now resolves the decdn-cli and decdn-client closures with one cargo tree -p each (--all-features --target all -e normal,build), and fails on aws-lc-* or jsonrpsee-server. The old closure walk read cargo metadata, which merges features across the whole workspace. The daemon's aws-lc and server would therefore show up in every crate's closure, and that walk could never pass. The direct-edge pass stays on cargo metadata --no-deps.

Closes #2454

Reviewer notes

  • Read first: crates/common/src/tls.rs, then the Cargo.toml changes, then .github/scripts/check_crate_edges.py.
  • A new place that builds a reqwest or alloy HTTP client without the installer panics with "No rustls crypto provider is configured". nextest runs each test in its own process, so CI catches this deterministically. The two new tests in crates/client/src/provider/tests.rs fail if the SDK builders stop installing the provider.
  • decdn-common's RpcResult import is gated on admin-server: the client-only macro expansion leaves it unused, and a per-crate clippy run catches that, while the workspace run does not.

Verification

  • cargo fmt -- --check
  • CARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targets --all-features, plus per-crate -p decdn-common / decdn-client / decdn-incentive / decdn-cli (no feature merging) for clippy and rustdoc
  • cargo nextest run --workspace --all-features, including the anvil e2e tests. The first push missed decdn-e2e chain::tests::reset_broadcast_lane_survives_a_straggler_from_a_killed_forge: it builds its own provider, and I misread its local failure as a leak. CI's anvil e2e (journeys) caught it, and the second commit fixes it; it now passes locally. A re-audit of the local log finds no other test that hits the missing-provider panic. ordered_writes::a_panicking_write_does_not_strand_the_writes_behind_it failed once under load; it uses no TLS and passes alone.
  • cargo tree -p decdn-client|decdn-cli --all-features --target all -e normal,build -i aws-lc-sys and -i jsonrpsee-server find nothing. decdn-node reaches aws-lc only through aws-smithy-http-client.
  • .github/scripts/check-crate-edges.sh passes. Putting jsonrpsee/server back on decdn-common, or reqwest/rustls on decdn-cli, makes it fail and names the path; the CLI-only leak does not blame the SDK. uvx --with pyyaml pytest .github/scripts/tests scripts/tests (258 passed)
  • HTTPS against the Arbitrum Sepolia RPC: decdn node doctor (chain checks, contract presence) and decdn pool list --all both succeed
  • User-visible change: CHANGELOG.md entry added
  • Not run locally: Windows/Android cross-target clippy (CI covers them) and a live decdn-node against the testnet

🤖 Generated with Claude Code

…ilds

decdn-client and the decdn CLI compiled aws-lc beside the ring that
iroh's QUIC stack already links, and the admin RPC's jsonrpsee server.

- alloy drops its default `reqwest-rustls-tls`, and the workspace
  reqwest moves from `rustls` to `rustls-no-provider`; both turned on
  aws-lc-rs. reqwest then panics in `Client::build` with no process-wide
  rustls provider, so `decdn_common::tls::install_crypto_provider`
  installs ring. Both binaries call it at start; the SDK's provider
  builders, registry discovery, `HttpOrigin`, the node runtime and the
  e2e chain fixture call it before they build a client. The daemon's S3
  client keeps aws-lc.
- jsonrpsee's `server` feature moves off the workspace dependency.
  decdn-common emits `AdminRpcServer` only under a new `admin-server`
  feature, which decdn-node enables.
- check_crate_edges.py resolves the decdn-cli / decdn-client closures
  per crate with `cargo tree -p` (cargo metadata unifies features across
  the workspace, so the daemon's aws-lc and server would show up in every
  closure) and fails on `aws-lc-*` or `jsonrpsee-server`.

Closes #2454

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 11:06
@thiras thiras added dependencies Dependabot: a dependency update rust Dependabot: a Cargo update; use area: labels for Rust code otherwise kind:chore Cleanup, dependencies, tooling or release work; no user-visible change labels Oct 14, 2026
@thiras thiras self-assigned this Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The dependency guard cannot parse build-dependency sections, and one isolated E2E test still constructs an HTTP provider without installing rustls.

2 open findings
What changed in this PR

Reduces client binary size by standardizing HTTP TLS on ring and excluding JSON-RPC server code from client builds.

Changes:

  • Adds process-wide rustls provider installation across HTTP client paths.
  • Feature-gates the admin RPC server to the node.
  • Strengthens dependency-closure checks, though two blocking defects remain.
File Description
Cargo.toml Configures alloy, reqwest, rustls, and jsonrpsee features.
Cargo.lock Updates the resolved dependency graph.
CHANGELOG.md Documents the dependency reduction.
CLAUDE.md Records client dependency invariants.
.github/​scripts/​check_crate_edges.py Adds per-crate closure checks.
.github/​scripts/​tests/​test_check_crate_edges.py Updates dependency-check tests.
crates/​common/​Cargo.toml Adds rustls and the admin-server feature.
crates/​common/​src/​admin.rs Feature-gates RPC server generation.
crates/​common/​src/​lib.rs Exports TLS utilities.
crates/​common/​src/​tls.rs Installs the ring provider.
crates/​client/​src/​provider.rs Installs TLS before provider construction.
crates/​client/​src/​provider/​tests.rs Tests provider builders without host setup.
crates/​client/​src/​discovery.rs Installs TLS for registry discovery.
crates/​cli/​Cargo.toml Limits server dependencies to tests.
crates/​cli/​src/​main.rs Installs TLS during CLI startup.
crates/​cli/​src/​commands/​node_top/​classifier_tests.rs Initializes TLS in classifier tests.
crates/​cli/​src/​commands/​node_top/​e2e_tests.rs Initializes TLS in metrics tests.
crates/​cli/​src/​commands/​node_top/​loop_budget_tests.rs Initializes TLS in loop tests.
crates/​cache/​Cargo.toml Adds rustls for HTTP origins.
crates/​cache/​src/​origin/​http.rs Installs ring before building the HTTP client.
crates/​cache/​src/​origin/​s3.rs Clarifies the S3 TLS backend.
crates/​e2e/​src/​chain.rs Initializes TLS in the chain fixture.
crates/​node/​Cargo.toml Enables admin server features for the daemon.
crates/​node/​src/​main.rs Installs TLS during daemon startup.
crates/​node/​src/​runtime/​mod.rs Installs TLS for direct runtime callers.
crates/​node/​src/​runtime/​tests.rs Initializes TLS in runtime tests.
crates/​node/​src/​rpc_metrics.rs Initializes TLS for metered RPC clients.
crates/​node/​src/​slash_watcher/​tests.rs Initializes TLS before provider creation.
crates/​node/​src/​dht/​capacity_bond_registry/​tests.rs Initializes TLS in registry tests.
crates/​node/​src/​chain_events/​shared_head/​tests.rs Initializes TLS in shared-head tests.
crates/​node/​src/​chain_events/​multiplexed_poller/​tests.rs Initializes TLS in poller tests.
crates/​node/​tests/​anvil_bringup_shutdown_e2e.rs Initializes TLS in bring-up E2E tests.
crates/​node/​tests/​anvil_settlement_e2e.rs Initializes TLS in settlement E2E tests.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/scripts/check_crate_edges.py Resolved
Comment thread crates/e2e/src/chain.rs Resolved
@github-code-quality

github-code-quality Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 5121b66 in the fix/2454-ring-only-c... branch remains at 75%, unchanged from commit c50a62e in the main branch.

Show a line coverage summary of the most impacted files.
File main c50a62e fix/2454-ring-only-c... 5121b66 +/-
crates/client/src/lib.rs 88% 88% 0%
crates/node/src/runtime/mod.rs 27% 27% 0%
crates/e2e/src/chain.rs 7% 7% 0%
crates/client/src/discovery.rs 93% 93% 0%
crates/client/src/provider.rs 97% 97% 0%
crates/cli/src/...ommands/node.rs 59% 60% +1%
crates/client/src/streamer.rs 83% 84% +1%
crates/cli/src/main.rs 78% 79% +1%
crates/client/src/sink.rs 93% 95% +2%
crates/common/src/tls.rs 0% 100% +100%

Updated October 14, 2026 11:29 UTC

thiras and others added 2 commits October 14, 2026 14:20
…r test

The test builds its own alloy HTTP provider, and reqwest built with
`rustls-no-provider` panics without a process-wide provider (#2454).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thiras
thiras merged commit c511e86 into main Oct 14, 2026
33 checks passed
@thiras
thiras deleted the fix/2454-ring-only-client-tls branch October 14, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependabot: a dependency update kind:chore Cleanup, dependencies, tooling or release work; no user-visible change rust Dependabot: a Cargo update; use area: labels for Rust code otherwise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants