Repository navigation
build(deps): link one TLS backend and no JSON-RPC server in client builds - #2459
Merged
Merged
Conversation
…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]>
There was a problem hiding this comment.
🟡 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.
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 5121b66 in the Show a line coverage summary of the most impacted files.
Updated |
…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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
decdn-clientand thedecdnCLI 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 releasedecdnbinary drops from 32.5 MB to 29.6 MB (−2.9 MB).rustlsfeature, reached through alloy's defaultreqwest-rustls-tlsand through the workspace reqwest. alloy is nowdefault-features = false, and reqwest usesrustls-no-provider.rustls-no-provider, reqwest panics inClient::buildunless 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 alloyconnect_httphits this, even forhttp://. The newdecdn_common::tls::install_crypto_provider()installs ring and does nothing if a provider is already installed. Callers:HttpOrigin,runtime::run,metered_http_clientand the e2eChainFixture;cargo build -p decdn-node -p decdn-cliwould merge aws-lc back into the CLI. The S3 client keeps aws-lc (CryptoMode::AwsLc).serverfeature moves off the workspace dependency.decdn-commonemitsAdminRpcServeronly under a newadmin-serverfeature, and onlydecdn-nodeenables it.check_crate_edges.pynow resolves thedecdn-clianddecdn-clientclosures with onecargo tree -peach (--all-features --target all -e normal,build), and fails onaws-lc-*orjsonrpsee-server. The old closure walk readcargo 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 oncargo metadata --no-deps.Closes #2454
Reviewer notes
crates/common/src/tls.rs, then theCargo.tomlchanges, then.github/scripts/check_crate_edges.py.crates/client/src/provider/tests.rsfail if the SDK builders stop installing the provider.decdn-common'sRpcResultimport is gated onadmin-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 -- --checkCARGO_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 rustdoccargo nextest run --workspace --all-features, including the anvil e2e tests. The first push misseddecdn-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'sanvil 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_itfailed 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-sysand-i jsonrpsee-serverfind nothing.decdn-nodereaches aws-lc only throughaws-smithy-http-client..github/scripts/check-crate-edges.shpasses. Puttingjsonrpsee/serverback ondecdn-common, orreqwest/rustlsondecdn-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)decdn node doctor(chain checks, contract presence) anddecdn pool list --allboth succeedCHANGELOG.mdentry addeddecdn-nodeagainst the testnet🤖 Generated with Claude Code