apollo_starknet_os_program,starknet_os: add the Cairo0 proof-fact fold tree - #15093
Conversation
PR SummaryMedium Risk Overview The fold program is compiled and exercised via Reviewed by Cursor Bugbot for commit 0ce5d55. Bugbot is set up for automated code reviews on this repo. Configure here. |
3893cae to
b23d2c2
Compare
89fb31b to
f3a733e
Compare
f0196fe to
ed8eb88
Compare
f3a733e to
151d20a
Compare
ed8eb88 to
d33ec72
Compare
151d20a to
6b6cc46
Compare
d33ec72 to
efaa234
Compare
6b6cc46 to
42977ca
Compare
42977ca to
6c70dbe
Compare
1fcfd19 to
02eab67
Compare
6c70dbe to
d6004c1
Compare
02eab67 to
c8828fe
Compare
d6004c1 to
b0e4d06
Compare
c8828fe to
0ce5d55
Compare
b0e4d06 to
0ce5d55
Compare
|
Closing: the stack was restructured around a first milestone — verifying a single transaction's proof against the OS output — and proof-fact folding over several transactions is deferred to a later phase. The Cairo0 fold tree from this PR (pairwise layers, carry rule, multi-leaf Generated by Claude Code |
Fourth PR of the privacy proof-fact fold stack. Adds the fold tree above the leaf digest in Cairo0:
fold_block_proof_factsfolds a block'sProofFactsReferencearray into the block's root fold entry (leaf entries, pairwise folding with a carried trailing entry, single-transaction self-fold), andcompute_fold_digestcomputes the digest the Cairo circuit verifier outputs for that entry. Still not reachable from the OS program — the OS output wiring lands in #15064.ProofFactsReferencecarries each transaction'sleaf_circuit_indexalongside its proof facts, andbuild_leaf_entriesstamps each leaf with the indexed hash from the allowed-circuits table (range-checked in #15092's getter). The production registry keys leaf circuits by trace size, so the index becomes real per-transaction OS input on the production swap; until then everything records index 0.Tested for bit-exact agreement with the Rust mirror across tree shapes exercising the pairing and carry rules (N = 1, 2, 3, 4, 5, 7).
Stack: leaf digest (#15090) ← rust tree fold (#15091) ← cairo leaf digest (#15092) ← this PR ← OS output wiring (#15064) ← registry pin (#15086) ← verifier task (#15088) ← combined test (#15095).
🤖 Generated with Claude Code
https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4