Skip to content

feat(openvm-prover): add verified proving checkpoints - #2340

Open
Bruno12221 wants to merge 2 commits into
theinterfold:mainfrom
Bruno12221:codex/openvm-checkpoints
Open

Bruno12221 wants to merge 2 commits into
theinterfold:mainfrom
Bruno12221:codex/openvm-checkpoints

Conversation

@Bruno12221

@Bruno12221 Bruno12221 commented Oct 22, 2026 •

Copy link
Copy Markdown

What and why

Add optional, verified checkpoints at the existing application, aggregation and root proof
boundaries. The one-shot command currently saves only the final seal, so a late failure can require
repeating earlier proving work.

The motivation came from running a pilot for sealed-bid NFT auctions locally, where long proof
runs and compression memory requirements made the full pipeline difficult to run uninterrupted.
Developers running locally can encounter these constraints even when a production prover has ample
RAM and compute.

Saving completed stages makes it possible to:

  • Retry a failed stage using the last complete checkpoint, keeping earlier proving work.
  • Stop between stages and continue later on the same machine, including scheduling compression
    when sufficient memory is available.
  • Run stages in separate processes and investigate failures at a specific stage.
  • Optionally move a completed checkpoint and matching artifacts to another machine for compression.

The new commands are prove-app, aggregate-stark, prove-root and compress-root. Each saved or
imported proof is cryptographically verified against the expected application identity and exact
journal. Manifests bind the SDK revision and artifact/file hashes, and are published last after
synchronizing checkpoint files. Outputs cannot overwrite existing paths, and publication
capabilities are checked before expensive proving.

The patch also includes a small pinned guest, an opt-in reproduction workflow and an actual-contract
receipt test. Existing one-shot commands remain available.

Verification

Tested on Ubuntu with Rust 1.91.1 and locked dependencies:

  • 32 regular tests passed in both ordinary debug and release profiles; all five ignored genuine-proof
    tests were explicitly invoked and passed with earlier and newly generated fixtures.
  • The checked-in guest rebuilt for RISC-V and completed all four proving stages in separate worker
    processes, including checkpoint relocation and compression resumed in a fresh supervisor after a
    completed root.
  • Independent worker verification reproduced identical seal bytes. Actual Solidity verification
    accepted the genuine receipt and rejected changed proof, journal and identity inputs, with
    independent checks also passing on macOS.
  • All 36 CLI compatibility/failure cases passed, along with formatting, documentation-link and
    new-source license checks.

The fresh qualification used a small synthetic guest. Compression sampled about 27.5 GiB
process-group RSS on a 32 GB machine; no speedup comparison was performed. Restart testing used a
planned stop at a completed boundary, and relocation used directories on one physical host. Contract
checks used an isolated project with the exact repository test, helpers and unchanged contracts.
Full repository CI, abrupt power loss, and CUDA compilation/runtime have not been tested.

Compatibility

Existing prove/verify behavior, journal binding, receipt encoding and deployed verifier identities
remain unchanged. No contract, circuit, peer/replay schema or protocol release-counter changes are
introduced. The new local checkpoint schema pins the current SDK revision and requires matching
artifacts. Existing workers can continue using their original one-shot flow.

This is a manual worker CLI feature; automatic HTTP recovery remains outside its scope. Imported
proof byte limits do not bound decoded memory or CPU time. Worker dependency versions are unchanged;
inherited SDK advisories remain unresolved. Compatibility was reviewed against the encrypted
computation and protocol-history domain documents.

Summary by CodeRabbit

  • New Features
    • Added staged proof generation for application, aggregate, and root proofs, followed by compression into an EVM-verifiable seal.
    • Added checkpoints that let you continue proving from saved stages. Checkpoints validate proof data and configuration artifacts, reject altered or unsupported files, and apply size limits to imported proofs.
  • Documentation
    • Added guides for staged proving, checkpoint creation and recovery, and opt-in workflows for checkpoint qualification and seal verification. Clarified that interrupted stages are not resumed automatically.

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Bruno12221 is attempting to deploy a commit to the Gnosis Guild Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 17cd0ae and aa80289.

Files ignored due to path filters: 2
  • crates/openvm-prover/Cargo.lock is excluded by !**/*.lock
  • crates/openvm-prover/tests/checkpoints/guest/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 12
  • crates/openvm-prover/Cargo.toml
  • crates/openvm-prover/README.md
  • crates/openvm-prover/src/checkpoint.rs
  • crates/openvm-prover/src/main.rs
  • crates/openvm-prover/src/stages.rs
  • crates/openvm-prover/tests/checkpoints/README.md
  • crates/openvm-prover/tests/checkpoints/guest/Cargo.toml
  • crates/openvm-prover/tests/checkpoints/guest/openvm.toml
  • crates/openvm-prover/tests/checkpoints/guest/src/main.rs
  • crates/openvm-prover/tests/checkpoints/run.py
  • docs/architecture/encrypted-computation.md
  • packages/interfold-contracts/test/Deployment/OpenVmCheckpoint.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The prover adds four staged actions for application proving, STARK aggregation, root proving, and root compression. It stores verified intermediate proofs in integrity-checked local checkpoints. New qualification workflows exercise checkpoint relocation, proof verification, and contract acceptance.

Changes: Staged proving and checkpoint qualification

Layer / File(s) Summary
Checkpoint identity and bounded reads
crates/openvm-prover/Cargo.toml, crates/openvm-prover/src/checkpoint.rs
Checkpoint manifests bind proof stages to the OpenVM version and revision, application commitment, journal, configuration artifacts, and required files. Reads validate file type, size limits, and content digests.
Checkpoint writes and publication
crates/openvm-prover/src/checkpoint.rs
Checkpoint writes record file digests and publish the manifest after syncing complete files. Publication checks destination paths and filesystem support, and tests cover interrupted writes, collisions, and file permissions.
CLI and verified proof stages
crates/openvm-prover/src/main.rs, crates/openvm-prover/src/stages.rs, crates/openvm-prover/README.md, docs/architecture/encrypted-computation.md
The CLI routes four actions through staged proving. Handlers verify proof data against configured commitments and the journal before saving checkpoints. Root compression verifies the root proof and EVM proof before publishing a seal.
Checkpoint and contract qualification
crates/openvm-prover/tests/checkpoints/*, crates/openvm-prover/README.md, packages/interfold-contracts/test/Deployment/OpenVmCheckpoint.spec.ts
The opt-in workflow builds a guest fixture, exercises proof stages and relocated checkpoints, and verifies a receipt. The contract test checks a genuine seal and rejects altered inputs.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ProverCLI
  participant stages_run
  participant Checkpoint
  participant OpenVM_SDK
  participant EVM_verifier
  ProverCLI->>stages_run: Dispatch stage with input, journal, and output
  stages_run->>Checkpoint: Open prior checkpoint or create output checkpoint
  stages_run->>OpenVM_SDK: Prove and natively verify proof
  OpenVM_SDK-->>stages_run: Return proof and verification result
  stages_run->>Checkpoint: Save proof and publish completed manifest
  stages_run->>EVM_verifier: Generate and verify root seal during compression
  EVM_verifier-->>stages_run: Return verified seal
Loading

Suggested reviewers: ctrlc03

Merge Risk: Minimal · up to aa802

No identified issue blocks merging the staged checkpoint workflow after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 1.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 82 functions across 6 files. (6 skipped: 6… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding verified proving checkpoints to openvm-prover.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 1.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 82 functions across 6 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/interfold-contracts/test/Deployment/OpenVmCheckpoint.spec.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

🔧 Clippy (1.99.0)

Clippy execution failed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Bruno12221
Bruno12221 force-pushed the codex/openvm-checkpoints branch from bd880ed to 5f25881 Compare October 22, 2026 13:45
@ctrlc03
ctrlc03 marked this pull request as ready for review October 23, 2026 14:04
@ctrlc03

ctrlc03 commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ctrlc03

ctrlc03 commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

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.

2 participants