Skip to content

[light-client] trust ratcheting perf improvements#26173

Open
alex-mysten wants to merge 1 commit intomainfrom
steka-light-clients-improvements
Open

[light-client] trust ratcheting perf improvements#26173
alex-mysten wants to merge 1 commit intomainfrom
steka-light-clients-improvements

Conversation

@alex-mysten
Copy link
Copy Markdown
Contributor

@alex-mysten alex-mysten commented Apr 9, 2026

Summary

Refactors trust ratcheting in the authenticated events light client:

  • Parallel epoch fetching. Replaces the per-epoch sequential loop with parallel_fetch_epoch_data (buffer_unordered, concurrency 20), driven by a target epoch extracted from the proof response's certified summary.
  • Single-mutex serialization. Holds the epoch_cache mutex across the entire ratchet (including network fetches). Concurrent ratchet calls now serialize: the first does the work and the rest see the cache already advanced and return immediately. Removes the previous skip-and-fresh-read dance.
  • Narrower checkpoint reads. Only fetches summary.bcs and signature from the ledger service (instead of full Checkpoint with contents), and builds CertifiedCheckpointSummary directly via new_from_data_and_sig rather than going through full_checkpoint_content::Checkpoint (which requires contents to construct).
  • Arc<Committee> in EpochCache to avoid expensive committee clones on every lookup.
  • TLS config auto-applied to https RPC URLs.
  • Hard kill-switch at MAX_RATCHET_GAP = 10_000 epochs (≈27 years) to bound work induced by malformed server responses.

Test plan

  • cargo nextest run -p sui-light-client (29 passed)
  • cargo simtest -p sui-e2e-tests --test authenticated_events_client_test (12 passed, including test_client_cross_epoch_stream)
  • cargo xclippy -D warnings
  • cargo fmt --all
  • 1-off test against devnet

@alex-mysten alex-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 9, 2026 13:04 — with GitHub Actions Inactive
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Apr 9, 2026 2:10pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Apr 9, 2026 2:10pm
sui-kiosk Ignored Ignored Preview Apr 9, 2026 2:10pm

Request Review

@alex-mysten alex-mysten force-pushed the steka-light-clients-improvements branch from 18a7def to 3425b10 Compare April 9, 2026 14:07
@alex-mysten alex-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 9, 2026 14:08 — with GitHub Actions Inactive
@alex-mysten alex-mysten changed the title [light-client] parallel trust ratcheting with single-mutex serialization [light-client] trust ratcheting perf improvements Apr 9, 2026
@alex-mysten alex-mysten marked this pull request as ready for review April 9, 2026 14:20
@alex-mysten alex-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 9, 2026 14:20 — with GitHub Actions Inactive
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