Skip to content

Conversation

@noel2004
Copy link
Member

@noel2004 noel2004 commented Dec 16, 2025

This PR purpose a stable version for prover after GalileoV2 forking.
This PR would replace #1761

Current status:

  • depending on zkvm-prover with openvm 1.4.2
  • drop the compatibility for guest built from openvm-1.3, performance gain from ~0.2MHz -> 0.7MHz (proving speed)
  • exit process while proving process panic to avoid a not-working prover lingers

Summary by CodeRabbit

Release Notes

  • New Features

    • Added debug mode for asset downloading to improve development workflows.
    • Added support for Galileo network configuration.
  • Bug Fixes

    • Improved error handling for panic scenarios in task processing.
  • Chores

    • Removed legacy witness encoding support; updated dependencies to specific commits.
    • Updated network segment size configuration.
    • Removed Feynman test network configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Walkthrough

This PR removes legacy witness encoding infrastructure from the zkprover, discontinues OpenVM 13 support, pins zkvm dependencies to specific commits, introduces test infrastructure for the Galileo fork, and deprecates Feynman test configurations.

Changes

Cohort / File(s) Summary
Dependency version pinning
Cargo.toml, crates/prover-bin/Cargo.toml
Updated workspace dependencies from tag-based to commit-based references; upgraded scroll-proving-sdk revision.
Legacy witness encoding removal
crates/libzkp/src/lib.rs, crates/libzkp/src/tasks/batch.rs, crates/libzkp/src/tasks/bundle.rs, crates/libzkp/src/tasks/chunk.rs
Eliminated legacy witness mode detection, LegacyBatchWitness/LegacyBundleWitness/LegacyChunkWitness exports, and conditional serialization paths; now exclusively uses encode_task_to_witness.
OpenVM 13 removal and handler refactor
crates/prover-bin/src/prover.rs, crates/prover-bin/src/zk_circuits_handler/universal.rs
Removed is_openvm_v13 parameter from UniversalHandler::new, added debug_mode field to AssetsLocationData, rejected OpenVM 13 parameters with error bail, and increased segment_len from (1 << 21) - 100 to (1 << 22) - 100.
Galileo test configuration
tests/prover-e2e/mainnet-galileo/.make.env, tests/prover-e2e/mainnet-galileo/config.json, tests/prover-e2e/mainnet-galileo/config.template.json, tests/prover-e2e/mainnet-galileo/genesis.json
Introduced new Galileo fork test suite with updated codec_version (8 → 9), fork-specific genesis state, and fetch_config endpoint.
Feynman test configuration deprecation
tests/prover-e2e/sepolia-feynman/.make.env, tests/prover-e2e/sepolia-feynman/00100_import_blocks.sql, tests/prover-e2e/sepolia-feynman/genesis.json
Removed Feynman-era test environment variables, SQL migration seed data, and genesis configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring attention:

  • Verify OpenVM 13 rejection logic in prover.rs doesn't inadvertently break existing workflows
  • Confirm segment_len increase from (1 << 21) to (1 << 22) aligns with performance/memory expectations
  • Validate that debug_mode skip logic in get_asset doesn't mask legitimate download failures
  • Ensure all legacy witness encoding removal paths have corresponding modern serialization coverage
  • Check that Galileo fork configuration (codec_version 9, genesis state) is correct and complete for end-to-end testing

Possibly related PRs

Suggested reviewers

  • Thegaram
  • yiweichi
  • jonastheis

Poem

🐰 Legacy paths fade like morning dew,
Galileo blooms where Feynman flew,
OpenVM marches toward the light,
Witness chains now sharp and bright,
The prover hops to futures new! ✨

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Optimization for prover (override #1761)' lacks conventional commit type prefix required by the repository standards. Prefix the title with a conventional commit type (e.g., 'perf: Optimization for prover' or 'feat: Optimization for prover'). See the PR description template for allowed types.
Description check ⚠️ Warning The PR description is missing required sections from the template, including the detailed 'Purpose or design rationale' section explaining what/why/how, and unchecked checkboxes for PR title type, deployment tag versioning, and breaking change label. Complete the description template by adding the 'Purpose or design rationale' section with detailed explanation and checking appropriate checkboxes for PR title type, deployment versioning, and breaking change status.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/zkvm_prover_142

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 and usage tips.

@noel2004 noel2004 marked this pull request as ready for review December 17, 2025 09:47
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
crates/prover-bin/src/prover.rs (1)

85-91: Consider using tracing for consistency.

The println! here is inconsistent with the rest of the codebase which uses the tracing crate. Consider using tracing::debug! for observability consistency.

                     if self.debug_mode {
-                        println!(
+                        tracing::debug!(
                             "File {} already exists, skipping download under debugmode",
                             filename
                         );
                         continue;
                     }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7de388e and 74a3d7a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • Cargo.toml (1 hunks)
  • crates/libzkp/src/lib.rs (1 hunks)
  • crates/libzkp/src/tasks/batch.rs (2 hunks)
  • crates/libzkp/src/tasks/bundle.rs (2 hunks)
  • crates/libzkp/src/tasks/chunk.rs (2 hunks)
  • crates/prover-bin/Cargo.toml (1 hunks)
  • crates/prover-bin/src/prover.rs (5 hunks)
  • crates/prover-bin/src/zk_circuits_handler/universal.rs (1 hunks)
  • tests/prover-e2e/mainnet-galileo/.make.env (1 hunks)
  • tests/prover-e2e/mainnet-galileo/config.json (1 hunks)
  • tests/prover-e2e/mainnet-galileo/config.template.json (2 hunks)
  • tests/prover-e2e/mainnet-galileo/genesis.json (1 hunks)
  • tests/prover-e2e/sepolia-feynman/.make.env (0 hunks)
  • tests/prover-e2e/sepolia-feynman/00100_import_blocks.sql (0 hunks)
  • tests/prover-e2e/sepolia-feynman/genesis.json (0 hunks)
💤 Files with no reviewable changes (3)
  • tests/prover-e2e/sepolia-feynman/genesis.json
  • tests/prover-e2e/sepolia-feynman/.make.env
  • tests/prover-e2e/sepolia-feynman/00100_import_blocks.sql
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-16T02:09:51.657Z
Learnt from: noel2004
Repo: scroll-tech/scroll PR: 1736
File: crates/libzkp/src/verifier/universal.rs:35-45
Timestamp: 2025-09-16T02:09:51.657Z
Learning: The verify_stark_proof method in scroll-zkvm-verifier returns Result<(), Error> indicating success/failure, not Result<bool, Error>. When it succeeds, verification passed; when it fails, it returns an error.

Applied to files:

  • crates/libzkp/src/tasks/batch.rs
  • crates/libzkp/src/tasks/bundle.rs
🧬 Code graph analysis (4)
crates/libzkp/src/tasks/batch.rs (2)
coordinator/internal/types/block.go (1)
  • BatchInfo (4-8)
crates/libzkp/src/tasks.rs (1)
  • encode_task_to_witness (19-22)
crates/prover-bin/src/prover.rs (4)
crates/prover-bin/src/types.rs (2)
  • default (62-64)
  • default (105-107)
crates/libzkp/src/lib.rs (1)
  • new (24-40)
crates/prover-bin/src/zk_circuits_handler/universal.rs (1)
  • new (19-31)
crates/libzkp/src/tasks.rs (1)
  • new (53-58)
crates/prover-bin/src/zk_circuits_handler/universal.rs (2)
crates/libzkp/src/lib.rs (1)
  • new (24-40)
crates/libzkp/src/tasks.rs (1)
  • new (53-58)
crates/libzkp/src/tasks/bundle.rs (1)
crates/libzkp/src/tasks.rs (1)
  • encode_task_to_witness (19-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: tests
🔇 Additional comments (19)
crates/prover-bin/src/zk_circuits_handler/universal.rs (2)

19-19: Removal of OpenVM 1.3 compatibility parameter looks correct.

This aligns with the PR objective to remove OpenVM 1.3 support, simplifying the constructor signature.


22-22: Verify the segment length increase is intentional.

The segment_len is doubled from (1 << 21) - 100 (~2M) to (1 << 22) - 100 (~4M). This likely impacts memory usage and proving performance. Confirm this change is tested and aligns with the reported proving speed improvement (0.2 MHz → 0.7 MHz).

crates/prover-bin/src/prover.rs (4)

33-35: LGTM - debug_mode field addition.

The debug_mode field with #[serde(default)] provides backward-compatible configuration for skipping network verification during local development.


214-227: Critical fix for panic propagation - LGTM.

Using resume_unwind correctly ensures the process exits when the proving task panics, preventing a non-working prover from lingering. This aligns with the PR objective.


294-296: Proper guard for OpenVM 1.3 deprecation.

This correctly rejects tasks requesting OpenVM 1.3 snark params. Note that libzkp::DynamicFeature::new still parses and warns about the openvm_13 feature flag (see crates/libzkp/src/lib.rs lines 29-32), which provides a migration path with clear warnings.


323-323: LGTM - Updated to match simplified constructor.

The call correctly matches the updated UniversalHandler::new signature that no longer requires the is_openvm_v13 parameter.

crates/prover-bin/Cargo.toml (1)

12-12: Commit 22ad34e is valid and exists in scroll-proving-sdk.

The dependency update to commit 22ad34ebdeb3d9a0ccb2993bb46d8d2522c1e667 is confirmed. Review the actual changes to ensure they include the expected GalileoV2 fork compatibility updates.

Cargo.toml (1)

20-23: Dependency pinning to specific commit.

The switch from tag-based (v0.7.1) to rev-based (2e8e29f) pinning ensures reproducible builds. The comment documents the OpenVM version relationship.

However, verify that commit 2e8e29f exists in the scroll-tech/zkvm-prover repository and that the OpenVM 1.4.2 reference is accurate.

tests/prover-e2e/mainnet-galileo/config.json (1)

8-13: LGTM!

The fetch_config addition with the mainnet RPC endpoint and the codec_version update to 9 are consistent with the Galileo fork migration.

tests/prover-e2e/mainnet-galileo/.make.env (1)

1-3: LGTM!

The block range and fork name configuration look appropriate for the Galileo e2e tests. Note that SCROLL_FORK_NAME uses = (non-overridable) while block variables use ?= (overridable) - this appears intentional to enforce the galileo fork context.

tests/prover-e2e/mainnet-galileo/config.template.json (1)

13-14: LGTM!

The verifier configuration properly references the Galileo assets and fork name.

tests/prover-e2e/mainnet-galileo/genesis.json (1)

1-111: LGTM overall!

The genesis configuration is comprehensive and includes:

  • Proper chainId (534352) matching other config files
  • Complete fork activation schedule
  • L1/L2 configuration with message queue addresses
  • Pre-deployed system contracts with appropriate storage initialization
crates/libzkp/src/tasks/chunk.rs (2)

1-8: LGTM - Import cleanup aligns with legacy encoding removal.

The removal of LegacyChunkWitness and RancorError from imports is consistent with eliminating the legacy witness encoding path.


117-130: LGTM - Simplified witness serialization.

The removal of the conditional legacy witness encoding path simplifies the code. The function now always uses encode_task_to_witness, which is consistent with the PR's goal of removing OpenVM 1.3 compatibility.

crates/libzkp/src/tasks/batch.rs (2)

1-13: LGTM - Consistent import cleanup.

The removal of LegacyBatchWitness from imports mirrors the changes in chunk.rs, maintaining consistency across task types.


117-134: LGTM - Witness encoding simplified.

The batch task now consistently uses encode_task_to_witness for serialization, matching the approach in chunk and bundle tasks.

crates/libzkp/src/tasks/bundle.rs (2)

1-8: LGTM - Import cleanup completes the trilogy.

The removal of LegacyBundleWitness completes the consistent cleanup across all three task types (chunk, batch, bundle).


27-44: LGTM - Consistent implementation across all task types.

The bundle task follows the same pattern as chunk and batch tasks, using encode_task_to_witness exclusively and properly propagating fork context.

crates/libzkp/src/lib.rs (1)

23-40: OpenVM 1.3 flag usage is consistent with PR objectives.

The flag is actively used: when use_openvm_13 is set to true, the prover explicitly rejects the task with the error "prover do not support snark params base on openvm 13" (crates/prover-bin/src/prover.rs:294-295). This implementation correctly removes OpenVM 1.3 support by preventing any guest built from openvm-1.3 from being processed, which aligns with the stated PR goal.

"chain_id": 534351,
"chain_id": 534352,
"l2geth": {
"endpoint": "<serach a public rpc endpoint like alchemy>"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo in placeholder comment.

Minor typo: "serach" should be "search".

     "l2geth": {
-      "endpoint": "<serach a public rpc endpoint like alchemy>"
+      "endpoint": "<search a public rpc endpoint like alchemy>"
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"endpoint": "<serach a public rpc endpoint like alchemy>"
"l2geth": {
"endpoint": "<search a public rpc endpoint like alchemy>"
}
🤖 Prompt for AI Agents
In tests/prover-e2e/mainnet-galileo/config.template.json around line 29, the
placeholder comment contains a typo ("serach"); update the placeholder to read
"search a public rpc endpoint like alchemy" so the comment is spelled correctly
and clearer to users.

Comment on lines +23 to +25
"feynmanTime": 1755576000,
"GalileoTime": 1765868400,
"GalileoV2Time": 1766041200,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all genesis files and check for fork time naming patterns
echo "=== Searching for fork time patterns in genesis files ==="
rg "feynmanTime|GalileoTime|galileoTime|GalileoV2Time" --type json -B2 -A2

Repository: scroll-tech/scroll

Length of output: 2143


Change fork time field names to lowercase for consistency.

Lines 23-25 use inconsistent capitalization: feynmanTime (lowercase) vs GalileoTime and GalileoV2Time (PascalCase). All other genesis files in the repo (sepolia-galileo, sepolia-galileoV2) use lowercase naming (galileoTime, galileoV2Time), and this matches upstream Scroll protocol naming. Change to: feynmanTime, galileoTime, galileoV2Time.

🤖 Prompt for AI Agents
In tests/prover-e2e/mainnet-galileo/genesis.json around lines 23 to 25, the fork
time field names use inconsistent capitalization; change "GalileoTime" to
"galileoTime" and "GalileoV2Time" to "galileoV2Time" so all three keys follow
lowercase naming ("feynmanTime", "galileoTime", "galileoV2Time") consistent with
other genesis files and upstream Scroll naming; update the JSON keys accordingly
without altering their numeric values.

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