starknet_os_flow_tests,starknet_os,starknet_transaction_prover: test the fold against the verifier - #15095
Conversation
PR SummaryLow Risk Overview New flow tests in Refactor for reuse: Cairo fold entry-point helpers move from Reviewed by Cursor Bugbot for commit a47dcf4. Bugbot is set up for automated code reviews on this repo. Configure here. |
c9f1861 to
fcf4042
Compare
69d4399 to
5038791
Compare
…the fold against the verifier Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4
fcf4042 to
377b5b4
Compare
5038791 to
a47dcf4
Compare
Part 8 of the privacy proof-fact fold stack, on top of #15088. Test-only: combined tests connecting the OS side of the fold to a real simple-bootloader run of the circuit verifier.
New tests (
starknet_os_flow_tests::proof_fact_verifier_test):test_cairo_fold_matches_circuit_verifier_output— the positive loop on real artifacts: the Cairo0fold_block_proof_facts(the exact code the OS runs) over thefour_leavestransactions' proof facts, packed the way the OS output packs the root output digest, matches the digest the circuit verifier outputs when the simple bootloader runs it on the fixture's root proof. Previously the verifier was only compared against the Rust fold; this closes bootloader+verifier ⟷ Cairo OS fold directly, through the production comparison function (verify_circuit_verifier_task_output).test_os_emitted_fold_output_feeds_verifier_task_comparison— the OS program in the loop: a real OS run over a block of 4 proof-facts invokes, whose emittedproof_facts_root_output_low/highare fed intoverify_circuit_verifier_task_outputagainst the real verifier run. Asserts the OS-emitted packed digest is cleanly unpacked and rejected asFoldDigestMismatch(the facts differ from the fixture's), i.e. the packing seam is well-formed and mismatched fact sets are caught.Why the OS-program run can't be on the matching-digest path yet (documented on the test): the OS only accepts proof facts whose program hash is an allowed virtual-OS hash, while the
four_leavesfixture's leaves carry the proving side's test-task program hash; and the transaction proofs the OS does accept are verified against the privacy recursion circuits or the production (large_proofs) registry — not thecanonical_smallregistry the fold's circuit hashes are pinned to. Closing that gap needs the fold's production-registry swap (see the leaf-verifier question in #15086) plus a recursive-tree fixture over OS-valid proof facts; until then the matching path is covered by the Cairo-fold test above, and the OS output wiring by the fold assertions every flow test already makes.Plumbing (no production-code changes): the Cairo fold entry-point runner moved from
proof_fact_fold_testtostarknet_os::test_utils::proof_fact_fold_runner(exposed undertesting, which now also enablesapollo_starknet_os_program/test_programs); the verifier-task fixtures and helpers moved fromverifier_task_testtostarknet_transaction_prover::verifier_task::test_utils(newtestingfeature); both test files now import from there.Verified: the 2 new flow tests pass; 24/24 starknet_os fold tests and 2/2 verifier-task tests pass after the refactor (against
cairo-program-runner-lib1.1.0 from the 0.14.4 merge); rustfmt clean.Stack: leaf digest (#15090) ← rust tree fold (#15091) ← cairo leaf digest (#15092) ← cairo tree fold (#15093) ← OS output wiring (#15064) ← registry pin (#15086) ← verifier task (#15088) ← this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4