Skip to content

Conversation

@noel2004
Copy link
Member

@noel2004 noel2004 commented Nov 25, 2025

This PR purpose a stable version for prover working along with GalileoV2 forking.

Current status:

  • depending on zkvm-prover v0.7.1
  • exit process while proving process panic to avoid a not-working prover lingers

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling to properly terminate the prover on critical failures instead of continuing with degraded state
  • Chores

    • Updated underlying proving SDK dependency to latest version
    • Increased processing segment capacity for improved resource efficiency

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

Updated scroll-proving-sdk dependency revision, modified panic handling in the prover query task to re-throw panics instead of returning error responses, and increased the segment length configuration from 2^21 to 2^22 in the universal handler.

Changes

Cohort / File(s) Change Summary
Dependency Update
crates/prover-bin/Cargo.toml
Updated scroll-proving-sdk git revision from 05648db to 22ad34e
Error Handling
crates/prover-bin/src/prover.rs
Modified LocalProver::query_task error handling to detect panics via is_panic() and resume unwinding; non-panic errors continue to return Failed status responses
Configuration
crates/prover-bin/src/zk_circuits_handler/universal.rs
Increased default segment_len in UniversalHandler::new from (1 << 21) - 100 to (1 << 22) - 100

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • crates/prover-bin/src/prover.rs: Verify panic detection and unwinding logic works correctly and doesn't suppress intended error handling for non-panic failures.
  • crates/prover-bin/src/zk_circuits_handler/universal.rs: Confirm the segment length increase from 2^21 to 2^22 aligns with upstream proving-sdk changes and doesn't introduce performance regressions.

Possibly related PRs

  • [Feat] Galileo forking #1753: Modifies the same prover-bin files, specifically adjusting segment_len in universal.rs and touching prover initialization paths.

Suggested reviewers

  • Thegaram
  • georgehao
  • lispc

Poem

🐰 A hop, a skip, a revision jump,
Dependencies dance to a newer thump,
Panics now echo through stacks that unwind,
And segments grow twice as large in mind!
The prover spins on with confident stride. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
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.
Description check ⚠️ Warning The PR description lacks required structure elements from the template, including explicit PR title with conventional commits format, deployment tag versioning checkbox, and breaking change label checkbox. Add PR title following conventional commits format (appears to be 'feat' or 'perf' type), check deployment tag versioning status, and indicate whether this is a breaking change.
Title check ❓ Inconclusive The title 'Optimization for prover' is too vague and generic. While the PR does include optimizations (segment length increase), it also contains bug fixes (panic handling) and dependency updates, making 'Optimization' an incomplete and potentially misleading summary of the overall changes. Revise the title to be more specific about the main changes, such as 'Improve prover stability and segment length configuration' or reference the PR's primary objective from its description.
✨ 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/prover_4.7

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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dceae1 and 9839bf7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml (1 hunks)
  • crates/prover-bin/Cargo.toml (1 hunks)
  • crates/prover-bin/src/prover.rs (1 hunks)
⏰ 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 (2)
Cargo.toml (1)

20-22: Dependency updates to pre-release v0.7.0-rc.4 are consistent and valid.

The three zkvm workspace dependencies are updated consistently to the same tag, which has been verified to exist in the scroll-tech/zkvm-prover repository. All references are syntactically correct and properly formatted.

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

12-12: Commit hash verified and properly pinned.

The commit 22ad34e exists and is correctly referenced. Since no tag exists for this commit, using the commit hash is the appropriate approach for deterministic builds.

Comment on lines +205 to +218
Err(e) => {
if e.is_panic() {
// simply re-throw panic for any panicking in proving prrocess,
// cause worker loop and the whole prover exit
std::panic::resume_unwind(e.into_panic());
}

QueryTaskResponse {
task_id: req.task_id,
status: TaskStatus::Failed,
error: Some(format!("proving task panicked: {}", e)),
..Default::default()
}
}
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

Incorrect error message for non-panic JoinError.

The else branch (lines 212-217) handles non-panic JoinErrors (e.g., task cancellation), but the error message incorrectly states "proving task panicked". This branch is only reached when e.is_panic() is false.

Also, minor typo on line 207: "prrocess" → "process".

                     Err(e) => {
                         if e.is_panic() {
-                            // simply re-throw panic for any panicking in proving prrocess,
+                            // simply re-throw panic for any panicking in proving process,
                             // cause worker loop and the whole prover exit
                             std::panic::resume_unwind(e.into_panic());
                         }

                         QueryTaskResponse {
                             task_id: req.task_id,
                             status: TaskStatus::Failed,
-                            error: Some(format!("proving task panicked: {}", e)),
+                            error: Some(format!("proving task failed: {}", e)),
                             ..Default::default()
                         }
                     }
📝 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
Err(e) => {
if e.is_panic() {
// simply re-throw panic for any panicking in proving prrocess,
// cause worker loop and the whole prover exit
std::panic::resume_unwind(e.into_panic());
}
QueryTaskResponse {
task_id: req.task_id,
status: TaskStatus::Failed,
error: Some(format!("proving task panicked: {}", e)),
..Default::default()
}
}
Err(e) => {
if e.is_panic() {
// simply re-throw panic for any panicking in proving process,
// cause worker loop and the whole prover exit
std::panic::resume_unwind(e.into_panic());
}
QueryTaskResponse {
task_id: req.task_id,
status: TaskStatus::Failed,
error: Some(format!("proving task failed: {}", e)),
..Default::default()
}
}
🤖 Prompt for AI Agents
In crates/prover-bin/src/prover.rs around lines 205 to 218, the non-panic
JoinError branch logs "proving task panicked" which is incorrect and there is a
typo "prrocess". Change the error message to reflect non-panic JoinError cases
(e.g., cancelled or join error) and include the JoinError details (e.g., via
e.to_string() or debug formatting) in the error field, and correct the comment
typo to "process". Keep the existing resume_unwind call for the is_panic() case
unchanged.

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: 0

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

20-28: Segment length doubled; please validate memory/perf impact and consider documenting the magic constant

segment_len going from (1 << 21) - 100 to (1 << 22) - 100 roughly doubles the segment size. Type and shape stay the same (Some(<int>)), so this should be API‑compatible, but it can materially change:

  • Peak memory usage per prover instance.
  • Per‑segment proving latency, and thus how well this runs on existing Galileo worker hardware.
  • Any implicit limits/expectations inside scroll_zkvm_prover::ProverConfig or the universal circuits.

I’d recommend:

  1. Running this value through your usual Galileo scenarios (max concurrency, largest expected proofs) to ensure no OOM or unacceptable latency regressions.
  2. Adding a short comment or central constant explaining why (1 << 22) - 100 is the right value for this fork, so future tuning is less guesswork.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9839bf7 and af63bc0.

📒 Files selected for processing (1)
  • crates/prover-bin/src/zk_circuits_handler/universal.rs (1 hunks)
⏰ 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

@noel2004 noel2004 changed the title [DO NOT MERGE] For prover 4.7 Optimization for prover Dec 3, 2025
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