Skip to content

apollo_starknet_os_program,starknet_os: cite the circuit hashes' source and add todos - #15086

Open
einat-starkware wants to merge 1 commit into
claude/privacy-proof-os-verify-gsxf2h-3-cairo-leaf-digestfrom
claude/privacy-proof-os-verify-gsxf2h-4-registry-pin
Open

einat-starkware wants to merge 1 commit into
claude/privacy-proof-os-verify-gsxf2h-3-cairo-leaf-digestfrom
claude/privacy-proof-os-verify-gsxf2h-4-registry-pin

Conversation

@einat-starkware

@einat-starkware einat-starkware commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Part of the single-proof verification stack. Comments only, no code changes.

  • Records where the circuit hash constants come from: the leaf verifier (trace log size 20) and multiverifier entries of the proving repo's canonical_small registry, crates/stwo_run_and_prove_recursive_tree/test_data/circuit_registry.json at the pinned proving rev (2b495a36).
  • TODO: import the circuit hashes from the proving repo's registry once it is exposed from a crate, instead of copying them. The registry isn't vendored here: a static copy would only cross-check the constants against a second copy, and couldn't catch upstream changes.
  • TODO (Rust and Cairo): accept the leaf verifiers of all the registry's trace sizes, not only one (production covers 25–29). The multiverifier outputs each verified leaf's circuit hash unchecked, so the OS must check it against the registry's list of leaf verifier hashes, selecting it by a range-checked index, since an unchecked index reads cells the prover chooses. For now the OS accepts a single leaf verifier (canonical_small, trace log size 20).

Stack: #15092 ← this PR ← #15164 ← #15161 ← #15166 ← #15167 ← #15168 ← #15169 ← #15163 ← #15064 ← #15162

🤖 Generated with Claude Code

https://claude.ai/code/session_015X6kWZhBXFeNyPwSuKTohy

@cursor

cursor Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Comment-only changes with no runtime or verification logic modified.

Overview
Documentation-only update for proof-fact folding circuit hash constants in Rust (proof_fact_fold.rs) and Cairo (proof_fact_fold.cairo).

Rust now documents that LEAF_VERIFIER_CIRCUIT_HASH and MULTIVERIFIER_CIRCUIT_HASH match the proving repo’s canonical_small registry (circuit_registry.json at rev 2b495a36), aligned with the Cairo OS program. New TODOs call out importing hashes from the proving crate instead of duplicating them, switching from test canonical_small values to production registry when available, and verifying leaf verifier circuit hashes for every registry trace size (not only log size 20)—with range-checked indexing because multiverifier exposes leaf hashes unchecked.

Cairo gets a matching TODO on get_leaf_verifier_circuit_hash() about supporting all registry leaf verifiers via a range-checked index.

Reviewed by Cursor Bugbot for commit a281d7b. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 3dec722 to 984111c Compare September 2, 2026 11:43
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 984111c to 05ae64e Compare September 2, 2026 11:47
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 05ae64e to 2f011f1 Compare September 2, 2026 12:13
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 2f011f1 to c5a699f Compare September 2, 2026 12:29
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from c5a699f to 207de5d Compare September 2, 2026 12:45
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch 2 times, most recently from 028fc14 to 9898ff6 Compare September 2, 2026 13:41
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 9898ff6 to 800f216 Compare September 17, 2026 13:36
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 800f216 to 4a1bd94 Compare September 22, 2026 09:22
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 4a1bd94 to 495f2a8 Compare September 23, 2026 09:17
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 495f2a8 to e436fb3 Compare September 23, 2026 12:59
@einat-starkware einat-starkware changed the title starknet_os: pin the fold circuit hashes to a vendored registry and pin fold costs starknet_os: pin the circuit hashes to a vendored registry and pin the root entry cost Sep 23, 2026
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from c74489d to 91050c6 Compare September 24, 2026 13:28
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 91050c6 to 8a68a55 Compare September 24, 2026 17:20
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 8a68a55 to 7403cf0 Compare September 28, 2026 08:01
@einat-starkware
einat-starkware removed this pull request from stack #15094 September 28, 2026 08:16
@einat-starkware
einat-starkware added this pull request to stack #15156 September 28, 2026 08:17
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 7403cf0 to f561d1d Compare September 28, 2026 10:51
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from f561d1d to 53df634 Compare September 30, 2026 10:47
@einat-starkware
einat-starkware removed this pull request from stack #15156 September 30, 2026 10:51
@einat-starkware
einat-starkware changed the base branch from claude/privacy-proof-os-verify-gsxf2h-3-os-output to claude/privacy-proof-os-verify-gsxf2h-3-cairo-leaf-digest September 30, 2026 10:51
@einat-starkware
einat-starkware added this pull request to stack #15158 September 30, 2026 10:53
@einat-starkware einat-starkware changed the title starknet_os: pin the circuit hashes to a vendored registry and pin the digest cost apollo_starknet_os_program,starknet_os: pin the digest cost and cite the circuit hashes' source Sep 30, 2026
…ce and add todos

Records which proving registry the circuit hash constants come from, and adds todos
to import them from the proving repo once it exposes the registry from a crate, and
to accept the leaf verifiers of all the registry's trace sizes rather than one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015X6kWZhBXFeNyPwSuKTohy

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants