Skip to content

perf(channels): pin rustls to ring and drop the second crypto stack - #1312

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Oct 23, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

What and why

channels depended on rustls with default features, which selects aws-lc-rs. Everything else
in the tree — reqwest via hyper-rustls, host, cli, desktop — already selects ring, so
every shipped binary linked two complete TLS crypto stacks (aws-lc-sys is a BoringSSL fork built
through CMake) and only one of them could ever be the installed provider: run() pins one
explicitly, and the let _ = swallowed the error for whichever lost.

This pins the same ring provider the rest of the tree uses and installs it explicitly, so one
stack is linked and the provider no longer depends on init order.

Commits

  • perf(channels): pin rustls to ring and drop the second crypto stack

Verification

Run in the main checkout at dev tip 40e31677c on rustc 1.97.0, macOS arm64:

  • cargo fmt --all -- --check — clean
  • cargo clippy -p future-channel --all-targets -- -D warnings — clean
  • cargo test -p future-channel --lib — 1498 passed, 0 failed

Two earlier runs of the same suite on this machine were red on load-sensitive timing tests
(bridge::queue::…worker_stops), so the baseline was checked the same way: an unmodified
origin/main checkout at the same moment failed a different timing test
(delivery::tests::the_queue_is_bounded_and_drops_finished_entries_first) while the machine sat at
load average ~60 on 32 cores, and the dev tip then passed the full suite. That class of failure
reproduces on origin/main, so it is saturation flakiness rather than this change.

Notes

  • Measured on macOS arm64 (cargo build --release -p future-cli --bin future): __text
    42.9 MB -> 41.6 MB; aws-lc-rs, aws-lc-sys, cmake, dunce and fs_extra leave
    Cargo.lock entirely, so the desktop and CLI release jobs stop building BoringSSL with CMake.
  • No behaviour change: run() already pinned a provider explicitly, and the ignored install error
    still covers the case where the embedding CLI installed one first.

`channels` depended on `rustls = "0.23"` with default features, which
selects aws-lc-rs. Everything else in the tree — reqwest via hyper-rustls,
`host`, `cli`, `desktop` — already selects ring, so every shipped binary
linked two complete TLS crypto stacks (aws-lc-sys is a BoringSSL fork built
through CMake) and only one of them could ever be the installed provider:
`run()` pins a provider explicitly, and `let _ =` swallowed the Err for
whichever lost.

Pin the same ring provider the other crates use and install it explicitly, so
one stack is linked and the provider no longer depends on init order.

Measured on macOS arm64 (`cargo build --release -p future-cli --bin future`):
__text 42.9 MB -> 41.6 MB, and aws-lc-rs/aws-lc-sys/cmake/dunce/fs_extra
leave Cargo.lock entirely, so the desktop and CLI release jobs stop building
BoringSSL with CMake.
@huichen
huichen enabled auto-merge (squash) October 23, 2026 02:27
@huichen
huichen merged commit 2f941b9 into main Oct 23, 2026
63 of 66 checks passed
@huichen
huichen deleted the pr/huichen branch October 23, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant