Skip to content

feat(zk-backend): two-stage groth16 dry-run#3869

Open
mw2000 wants to merge 1 commit into
mw2000/zk-narrow-submitfrom
mw2000/zk-groth16-dryrun
Open

feat(zk-backend): two-stage groth16 dry-run#3869
mw2000 wants to merge 1 commit into
mw2000/zk-narrow-submitfrom
mw2000/zk-groth16-dryrun

Conversation

@mw2000

@mw2000 mw2000 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extend the dry-run backend to advance SnarkGroth16 jobs from the STARK range stage to a SNARK aggregation stage via submit_next, storing a per-stage result keyed by backend session id.
  • Lets the host orchestrator (introduced in the base PR) exercise the full composed range-to-aggregation flow locally without a real proving backend.

Made with Cursor

Comment thread crates/proof/zk/backend/src/succinct/dry_run.rs Outdated
Comment thread crates/proof/zk/backend/src/succinct/dry_run.rs Outdated
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from c57445f to e990def Compare July 7, 2026 22:02
Comment thread crates/proof/zk/backend/src/succinct/dry_run.rs Outdated
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from e990def to f2adb7f Compare July 7, 2026 22:11
@mw2000 mw2000 force-pushed the mw2000/zk-host-groth16-orchestration-host branch 5 times, most recently from 40549d5 to e806c5d Compare July 7, 2026 23:06
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from f2adb7f to 983d611 Compare July 7, 2026 23:19
Comment thread crates/proof/zk/backend/src/succinct/dry_run.rs Outdated
@mw2000 mw2000 force-pushed the mw2000/zk-host-groth16-orchestration-host branch from e806c5d to 53ee3d8 Compare July 8, 2026 17:50
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from e9be5b5 to e4402c9 Compare July 8, 2026 17:50
mw2000 added a commit that referenced this pull request Jul 8, 2026
Snark dry-run completion lands in the stacked #3869 backend work, so keep the helper able to submit snark_groth16 requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mw2000 mw2000 force-pushed the mw2000/zk-host-groth16-orchestration-host branch from 53ee3d8 to e1c3714 Compare July 8, 2026 18:02
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from e4402c9 to 3c54cad Compare July 8, 2026 18:02
@mw2000 mw2000 force-pushed the mw2000/zk-host-groth16-orchestration-host branch from e1c3714 to 910ebeb Compare July 8, 2026 20:04
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from 3c54cad to 02c9eb5 Compare July 8, 2026 20:05
Base automatically changed from mw2000/zk-host-groth16-orchestration-host to main July 9, 2026 12:38
@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from 02c9eb5 to c41af3a Compare July 9, 2026 16:35
Comment thread crates/proof/zk/backend/src/succinct/dry_run.rs Outdated
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from c41af3a to c45cb93 Compare July 9, 2026 17:12
@mw2000 mw2000 changed the base branch from main to mw2000/zk-narrow-submit July 9, 2026 17:12
Add two-stage (STARK range -> SNARK aggregation) dry-run support, trim
docs/tests to essentials, and re-parent onto the narrowed submit base.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mw2000 mw2000 force-pushed the mw2000/zk-groth16-dryrun branch from c45cb93 to f436fef Compare July 9, 2026 18:18
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Summary

PR: feat(zk-backend): two-stage groth16 dry-run

This PR extends the dry-run ZK backend to support the two-stage STARK-to-SNARK flow via submit_next. The implementation is clean and well-tested.

What looks good

  • Atomicity: advance_range_to_snark correctly holds a single Mutex lock across the entire check-remove-insert sequence, preventing any TOCTOU window.
  • Idempotency: The early return when backend_session_id already exists in the store satisfies the ZkProver::submit_next idempotency contract documented on the trait.
  • Naming: The DRY_RUN_PREFIXDRY_RUN_STARK_PREFIX rename with a new DRY_RUN_SNARK_PREFIX is clean and complete — no stale references remain in the codebase.
  • Testability: Extracting advance_range_to_snark as a static method taking &Mutex<...> rather than &self allows unit tests to exercise the logic without constructing a full DryRunZkProver. Good design.
  • Test coverage: Both the happy-path swap and the idempotent-resume case are covered.

No new issues found

The existing inline comments from the prior review round have been addressed in the current code. No additional concerns to raise.

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.

2 participants