perf(sync-service): parallelize Aura call proof downloads during parachain bootstrap#3223
Closed
replghost wants to merge 1 commit into
Closed
perf(sync-service): parallelize Aura call proof downloads during parachain bootstrap#3223replghost wants to merge 1 commit into
replghost wants to merge 1 commit into
Conversation
…chain bootstrap Download AuraApi_slot_duration and AuraApi_authorities call proofs in parallel using futures::join, then execute them sequentially against the compiled VM. Saves one P2P round-trip on every parachain start (cold and warm). The two downloads are independent — only the VM execution requires sequential access because the VM prototype is consumed and returned by each call.
495fb48 to
43eb70a
Compare
Contributor
Author
|
Superseded by #3225, which parallelizes all three requests (storage proof + both Aura proofs) rather than just the two Aura proofs. |
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.
Summary
Download
AuraApi_slot_durationandAuraApi_authoritiescall proofs in parallel during parachain bootstrap usingfutures::try_join, saving one P2P round-trip on every start. If either request fails, the other is cancelled eagerly.Changes
future::try_joinOne file changed, net +7 lines. No new dependencies (
futures_util::futurealready imported).Benchmark results
10 cold-start iterations each (baseline vs PR) on Polkadot Asset Hub via smolbench:
aura_phase = full Phase 2 time (
:codedownload + compile + Aura call proofs):Baseline (sorted)
PR (sorted)
The median improvement of ~200ms matches the expected savings from removing one P2P round-trip. The measurement is noisy because
aura_phaseincludes the:codedownload (2 MiB, high variance), which dominates timing. The call proof parallelization affects only the last ~200-500ms of this window.Test plan
cargo check -p smoldot-lightcleancargo fmtcleancargo clippy -p smoldot-light— no new warningsCloses #3219