Skip to content

perf(sync-service): parallelize Aura call proof downloads during parachain bootstrap#3223

Closed
replghost wants to merge 1 commit into
paritytech:mainfrom
replghost:perf/parallel-aura-call-proofs
Closed

perf(sync-service): parallelize Aura call proof downloads during parachain bootstrap#3223
replghost wants to merge 1 commit into
paritytech:mainfrom
replghost:perf/parallel-aura-call-proofs

Conversation

@replghost

@replghost replghost commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Download AuraApi_slot_duration and AuraApi_authorities call proofs in parallel during parachain bootstrap using futures::try_join, saving one P2P round-trip on every start. If either request fails, the other is cancelled eagerly.

Changes

  • Fire both call proof requests simultaneously using future::try_join
  • Decode both proofs after both downloads complete
  • Execute the calls sequentially against the compiled VM (the VM prototype is consumed and returned by each call, so execution must remain serial)

One file changed, net +7 lines. No new dependencies (futures_util::future already imported).

Benchmark results

10 cold-start iterations each (baseline vs PR) on Polkadot Asset Hub via smolbench:

aura_phase = full Phase 2 time (:code download + compile + Aura call proofs):

Stat Baseline (main) PR (try_join) Delta
Median 1361ms 1161ms -200ms
Mean 1471ms 1710ms +239ms (skewed by one 6.8s outlier)
Min 358ms 325ms -33ms
P25 401ms 374ms -27ms
P75 2133ms 2126ms -7ms

Baseline (sorted)

358, 401, 1270, 1335, 1353, 1369, 1550, 2133, 2318, 2627

PR (sorted)

325, 373, 374, 1095, 1144, 1179, 1197, 2126, 2433, 6858

The median improvement of ~200ms matches the expected savings from removing one P2P round-trip. The measurement is noisy because aura_phase includes the :code download (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-light clean
  • cargo fmt clean
  • cargo clippy -p smoldot-light — no new warnings
  • Benchmarked on Polkadot Asset Hub (10 runs each, baseline vs PR)

Closes #3219

…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.
@replghost replghost force-pushed the perf/parallel-aura-call-proofs branch from 495fb48 to 43eb70a Compare April 22, 2026 19:12
@replghost

Copy link
Copy Markdown
Contributor Author

Superseded by #3225, which parallelizes all three requests (storage proof + both Aura proofs) rather than just the two Aura proofs.

@replghost replghost closed this Apr 23, 2026
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.

perf(sync-service): parallelize Aura call proofs during parachain bootstrap

1 participant