mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-05-22 01:30:00 +00:00
- Introduce `struct Case` holding pre-serialized InstructionData, with new<I: Serialize>(...) -> Result<Self> constructor and fn run(self, prove, exec_iters) -> Result<BenchResult>. - Replace 9 inline `run_case(...)?` push calls in main() with [Case::new(...)?, ...].into_iter().map(|c| c.run(prove, exec_iters)) .collect::<Result<Vec<_>>>()?. - Drop now-unused `needless_pass_by_value` and `too_many_arguments` from the crate-level #![expect] block.
cycle_bench
Per-program Risc0 cycle counts, prover wall time, PPE composition cost, and verifier wall time for the built-in LEZ programs. Feeds the fee model (G_executor, G_prove, G_verify, S_agg).
Run
# Executor cycles only (fast, ~seconds)
cargo run --release -p cycle_bench
# + real proving per program (slow, ~minutes)
cargo run --release -p cycle_bench --features prove -- --prove
# + PPE composition cases (very slow, ~hour)
cargo run --release -p cycle_bench --features ppe -- --prove --ppe
# + verifier microbench (G_verify): generates one PPE receipt, times verify x1000
cargo run --release -p cycle_bench --features ppe -- --verify --verify-iters 1000
RISC0_DEV_MODE=1 skips proving entirely and is only useful for the executor path. Combine flags freely; output is printed to stdout and written to target/cycle_bench.json for regression diffs.
What you'll see
- Per-program executor cycles and segments, plus exec wall time as
best / mean ± stdev (n=N). - With
--prove: prover total cycles, paging cycles, segments, and wall time. - With
--ppe: end-to-endexecute_and_provewall time and S_agg (the borsh-serialized InnerReceipt length) for one auth-transfer-in-PPE case and a chain-caller depth sweep. - With
--verify: verify wall timebest / mean ± stdev, plusproof_bytesandjournal_bytes.