Cryptography Engineer — Lita
The reference workload was valida run --fast on reva-client-eth against Ethereum mainnet block 17034871. The flamegraph showed most time in the multi-segment proving path spent on avoidable clones — ValidaSegmentBootData::clone, <BTreeMap as Drop>::drop, and the inner BasicMachine::run / suspend loop.
- Memory-aware segment splitting. Replaced the original "any-trace-near-max-height" splitting rule with a memory-operation-count rule (memory ops dominate trace height, and the count is a static function of the opcode). This eliminated the full first-pass logging that was contributing 30+ minutes on the reference block, enabling a two-pass flow: fast pass to discover segment boundaries, then per-segment slow-mode re-execution for trace generation.
- Boot-data plumbing. Teased apart which fields of
ValidaSegmentBootDatawere required for correctness (memory backend, persistent-bus state) versus only for trace generation, killing avoidable clones on segment boundaries while preserving the persistent-bus consistency check. - Parallel proving — coordinator/worker design. Built out the parallel prover (
coordinator.rs,worker.rs,parallel.rs) with four sync barriers (trace, permutation, quotient, opening). The coordinator owns the Fiat-Shamir transcript (transcript-soundness requires sequential challenge sampling); workers handle trace generation, polynomial ops, quotient and permutation construction.prove_multi_segment_keccak_parallelran at ~38s wall / 167s CPU (4.3× speedup) with ~78 MB peak RSS. - STARK circuit performance. R&D of high-performance STARK circuits for the Valida chip set, including the degree-3-safe XOR3 expansion in the Keccak-f chip.
- Profiling infrastructure. Set up
cargo flamegraphwithkernel.perf_event_paranoidand release-build debug symbols; iterated on flamegraphs of the multi-segment proving path.