types, node: parallelize per-att_data aggregate FFI (#907) - #920
Conversation
Issue #907 shows each aggregateImpl processes ~2 att_data per slot window while the recursive STARK cost is per att_data (~11s). Run independent prove calls on the shared thread pool after a serial prep phase, and sort att_data keys deterministically before building results.
Give aggregators the full post-system rayon budget, cap zig pool and aggregate_max_inflight, pre-warm the XMSS prover, and log main/xev/rayon thread counts at startup for operator visibility.
|
Critical review result: requesting changes / not approving yet. I found one blocker in the new parallel aggregation path: Blocking:
|
Keep one outer aggregate worker on aggregators and suppress commit/publish when snapshot gossip vids were already consumed by an earlier worker.
|
Follow-up review on The blocker I raised is addressed:
Validation I could do locally:
I could not run Per standing project guidance, this is a regular PR comment rather than a formal GitHub “Approve” review. |
zclawz
left a comment
There was a problem hiding this comment.
Approved after review. The parallel per-att_data aggregation refactor looks sound to me: prep stays serial, FFI work is scoped through the shared ThreadPool, output order is deterministic, and the aggregator path is wired through the pool while keeping outer aggregate in-flight capped. Local validation is blocked by this workspace Zig/dependency mismatch, but CI lint/macOS build are green and remaining Linux/test jobs are still running with no failures at approval time.
Summary
computeAggregatedSignaturesto prepare eachAttestationDataserially, then run independent recursive STARK FFI calls in parallel when the aggregator thread pool is available and more than one entry needs proving.att_datakeys deterministically before building output (stable block/aggregate ordering across runs).forkchoice.zigthroughcomputeAggregatedSignaturesWithPool.Complements #919 (parallel aggregate submission /
in_flightskips). That PR improves slot throughput; this one targets the ~11s per-FFI wall clock when a slot window contains multipleatt_dataentries (~2 per worker call per #907 finding 1).What this does not fix
att_datawith 7–8 gossip sigs still pays one full ~11s STARK (cost is input-shape independent in leanMultisig). Trivial 1-sig cases remain covered by node, types: skip recursive aggregation for 1-sig + 0-child trivial inputs (#907) #908 aggregator pre-filter.slot_interval/ tick duration (event-loop starvation vs nominal 0.8s) #863 event-loop backlog or peer aggregate merge timing (timely=none).Test plan
zig build test --summary allzeam_aggregate_worker_duration_secondsp50 drops when slot window has 2att_data(expect ~1× STARK time instead of ~2×)