starknet_transaction_prover,starknet_os,workspace: run the circuit verifier as a bootloader task - #15088
Conversation
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit fcf4042. Bugbot is set up for automated code reviews on this repo. Configure here. |
5ccc8b0 to
45d2292
Compare
45d2292 to
ccdf52c
Compare
ccdf52c to
3ea9055
Compare
9c77ed6 to
b628c29
Compare
9aecebb to
c9f1861
Compare
…rifier as a bootloader task Implements the verifier-invocation side of the privacy proof flow, per the decision that the verifier is called from the simple bootloader: a new verifier_task module builds a SimpleBootloaderInput with the Cairo1 circuit verifier as its single task (Blake program hash function), runs it in-process via cairo-program-runner-lib, and parses the bootloader output page [1, 10, verifier_program_hash, digest words]. An invalid proof - or any verifier/proof configuration mismatch - fails the run, so there is no output to misinterpret. verify_circuit_verifier_task_output closes the comparison loop: it checks the verifier program hash against a pinned value (the task's sole identity) and recomputes the expected digest from the packed root output digest the OS emits (proof_facts_root_output_low/high), via a new unpack_output_digest mirror in starknet_os::proof_fact_fold. The workspace's dead cairo-program-runner-lib = "1.1.0" entry is rewritten to the proving-utils git tag already pinned in the lock (v0.14.3-rust-bump), so the dependency unifies with the existing 1.2.2. Tests run the whole chain on real data: the four_leaves golden root proof is verified by the fixture verifier executable under the vendored simple bootloader, and the resulting digest matches the digest expected from the OS-side fold of the same four transactions' proof facts; a corrupted proof felt fails the run. Fixture provenance is documented on each constant. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4
c9f1861 to
fcf4042
Compare
Part 7 of the privacy proof-fact fold stack, on top of #15086. Implements the decision that the verifier is called from the simple bootloader, and closes the comparison loop on the sequencer side.
starknet_transaction_prover::verifier_task:run_circuit_verifier_taskbuilds aSimpleBootloaderInputwith the Cairo1 circuit verifier as its single task (Blake program hash function,single_page: true), runs it in-process viacairo-program-runner-lib, and parses the bootloader output page[1, 10, verifier_program_hash, digest word 0..7]. An invalid proof — or any verifier/proof configuration mismatch, which the verifier makes indistinguishable by design — fails the run, so there is never an output to misinterpret.verify_circuit_verifier_task_outputperforms the comparison the whole project exists for: the verifier program hash against a pinned value (the task's only identity), and the verifier's digest againstblake2s(multiverifier circuit hash ‖ root output digest)recomputed from the packedproof_facts_root_output_low/highthe OS emits (apollo_starknet_os_program,starknet_os,blockifier: emit the proof-fact fold in the OS output #15064), via a newunpack_output_digestmirror instarknet_os::proof_fact_fold.Dependency: the workspace's dead
cairo-program-runner-lib = "1.1.0"entry (a crates.io requirement nothing consumed) is rewritten to the proving-utils git tag already pinned in the lock (v0.14.3-rust-bump), unifying with the existing 1.2.2 — the Cargo.lock delta is one line. The lib pulls no stwo/nightly crates, so the module is unconditional (not behindstwo_proving).Tests run the whole chain on real data (57s total in debug): the
four_leavesgolden root proof is verified by the fixture verifier executable under the vendored simple bootloader; the resulting digest matches the digest expected from the OS-side fold of the same four transactions' proof facts; wrong pinned hash and wrong emitted digest are rejected; a corrupted proof felt fails the run. Fixtures (~1.3MB gzipped) carry documented provenance: the bootloader from the pinned proving-utils tag, the verifier executable built from proving-devb75d21f9with scarb 2.19.4 (dev profile — production artifact ownership and theproving-profile/qm31_opcode question remain open), and the root proof from the proving-dev goldens.Verified: 2/2 verifier-task tests, 24/24 fold tests (including the new
unpack_output_digestroundtrip), 17/17 workspace tests, clippy and rustfmt clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4