Add optional decode preprocessed commitment#640
Conversation
Codex Code ReviewFindings
No other issues found in the reviewed diff. |
Review: Add optional decode preprocessed commitmentOverviewThis PR adds an optional Security Model — CorrectTraced the full path through // verifier.rs:748-763
let expected_precomputed = air.precomputed_commitment();
match &proof.lde_trace_precomputed_merkle_root {
Some(actual) if *actual == expected_precomputed => { /* OK */ }
Some(actual) => return false, // commitment mismatch
None => return false,
}The verifier checks the proof's DECODE commitment against the expected value (either computed from the ELF or supplied by the caller). A prover cannot inject a forged Tests — Good Coverage
The IssuesLow — dead-code fallback in
No other issues found. The change is minimal, all call sites are updated correctly, the API extension is clean, and the trust model is documented accurately. |
A wrong supplied decode_commitment is caught either by the verifier's explicit precomputed-commitment equality check or by Fiat-Shamir transcript divergence — not by FS alone. Reword both doc comments to reflect the "or", since the earlier wording attributed rejection solely to Fiat-Shamir.
Description
verify_with_optionsandVmAirs::newnow accept an optional precomputed DECODE preprocessed commitment. WhenSome, the supplied value is used directly and the in-verifier FFT + Merkle build for the DECODE preprocessed columns is skipped. WhenNone, behavior is unchanged frommain. The trust anchor: value must come from the caller's compiled binary (aconst [u8; 32]), never from prover-supplied bytes. Wrong values surface as Fiat-Shamir transcript divergence.Verifier cycles reduction
Measured on the recursion guest (the verifier compiled as a RISC-V program verifying an empty inner proof, blowup=2, 1 query):
Baseline (Bitwise + keccak_rc): 2,895 M
This PR (+ Decode optional): 2,889 M (~6.8 M reduction)