Skip to content

upgrade 0809: use feynman guest rkyv #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

upgrade 0809: use feynman guest rkyv #1718

wants to merge 3 commits into from

Conversation

lispc
Copy link
Contributor

@lispc lispc commented Aug 8, 2025

Purpose or design rationale of this PR

using this commit scroll-tech/zkvm-prover@72f9abb

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Chores

    • Updated workspace dependencies to use a fixed version tag for improved stability.
  • Refactor

    • Adjusted witness serialization to consistently use the "Feynman" fork context during task processing, ensuring uniform handling across relevant operations.

Copy link

coderabbitai bot commented Aug 8, 2025

Walkthrough

This change updates workspace dependencies in Cargo.toml to use a specific Git tag (0.5.4) instead of a branch. Additionally, in two Rust source files, the witness serialization now explicitly uses Some(ForkName::Feynman) instead of None, specifying the fork context during serialization.

Changes

Cohort / File(s) Change Summary
Dependency Version Pinning
Cargo.toml
Updated dependencies for scroll-zkvm-prover-euclid, scroll-zkvm-verifier-euclid, and scroll-zkvm-types to use Git tag 0.5.4 instead of branch feat/0.5.1.
Witness Serialization Fork Context
crates/libzkp/src/tasks/bundle.rs, crates/libzkp/src/tasks/chunk.rs
Modified witness serialization to use Some(ForkName::Feynman) instead of None, specifying the fork name context during serialization.

Sequence Diagram(s)

sequenceDiagram
    participant Task as ProvingTask Conversion
    participant Witness as Witness Data
    participant Serializer as rkyv_serialize

    Task->>Witness: Prepare witness for serialization
    Task->>Serializer: Serialize(witness, Some(ForkName::Feynman))
    Serializer-->>Task: Serialized witness data (with Feynman fork context)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

  • feat: openvm v0.3.0 #1648: Updates similar dependencies in Cargo.toml files to an earlier version tag (v0.3.0), showing a pattern of dependency version management for related crates.

Suggested reviewers

  • georgehao

Poem

In the garden where code and carrots blend,
A fork named Feynman, now our friend.
Dependencies tagged, no longer adrift,
Serialization given a contextual lift.
With every hop, the changes align—
A rabbit’s delight in versioned design! 🥕

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/0809/upgrade

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lispc lispc marked this pull request as ready for review August 10, 2025 23:37
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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6897cc5 and 059a467.

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

6-6: Import addition looks correct

New import of ForkName is necessary for fork-aware serialization. No concerns.

Comment on lines +20 to +22
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-prover" }
scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-verifier" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4" }
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Pin git dependencies to the exact commit for reproducibility and supply-chain safety

Using a tag is better than a branch, but tags can be retagged. Since the PR references commit 72f9abb00f0ef7c5e46b7856d58bb86cbb332509, prefer rev to guarantee determinism.

Apply this diff:

-scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-prover" }
-scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-verifier" }
-scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4" }
+scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509", package = "scroll-zkvm-prover" }
+scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509", package = "scroll-zkvm-verifier" }
+scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509" }

Verification script to confirm the tag’s commit (optional):


🏁 Script executed:

#!/bin/bash
set -euo pipefail
REPO="https://github.com/scroll-tech/zkvm-prover"
TAG="0.5.4"
EXPECTED="72f9abb00f0ef7c5e46b7856d58bb86cbb332509"

echo "Tag -> commit:"
git ls-remote "$REPO" "refs/tags/$TAG" | awk '{print $1, $2}'
echo "Expected: $EXPECTED"

if git ls-remote "$REPO" "refs/tags/$TAG" | grep -q "^$EXPECTED"; then
  echo "OK: Tag $TAG points to expected commit."
else
  echo "WARN: Tag $TAG does not match expected commit."
fi

Length of output: 658


Pin git dependencies to an exact commit using rev

Confirmed that tag 0.5.4 currently points to commit 72f9abb00f0ef7c5e46b7856d58bb86cbb332509. To guard against future retagging and ensure full reproducibility, switch from tag to rev.

• Update in Cargo.toml (around lines 20–22):

-scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-prover" }
-scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-verifier" }
-scroll-zkvm-types           = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4" }
+scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509", package = "scroll-zkvm-prover" }
+scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509", package = "scroll-zkvm-verifier" }
+scroll-zkvm-types           = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509" }
📝 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
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-prover" }
scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4", package = "scroll-zkvm-verifier" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "0.5.4" }
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509", package = "scroll-zkvm-prover" }
scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509", package = "scroll-zkvm-verifier" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "72f9abb00f0ef7c5e46b7856d58bb86cbb332509" }
🤖 Prompt for AI Agents
In Cargo.toml around lines 20 to 22, the git dependencies use the tag "0.5.4"
which can be moved to point to a specific commit for better reproducibility.
Replace the "tag" field with "rev" and set its value to the commit hash
"72f9abb00f0ef7c5e46b7856d58bb86cbb332509" for all three dependencies to pin
them to that exact commit.

@@ -83,7 +83,7 @@ impl TryFrom<BundleProvingTask> for ProvingTask {
.into_iter()
.map(|w_proof| w_proof.proof.into_root_proof().expect("expect root proof"))
.collect(),
serialized_witness: vec![witness.rkyv_serialize(None)?.to_vec()],
serialized_witness: vec![witness.rkyv_serialize(Some(ForkName::Feynman))?.to_vec()],
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Hard-coding Feynman here ignores the task’s provided fork_name; use the actual fork to avoid mismatches

Serialization should respect the task’s fork to keep witness and metadata consistent. Hard-coding Feynman can produce invalid or unverifiable artifacts when fork_name != "feynman".

Apply this diff within the selected line:

-            serialized_witness: vec![witness.rkyv_serialize(Some(ForkName::Feynman))?.to_vec()],
+            serialized_witness: vec![witness.rkyv_serialize(Some(fork))?.to_vec()],

And add this line before constructing ProvingTask (outside the selected range):

let fork = ForkName::from(value.fork_name.as_str());

Optional repo-wide sanity check:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "Calls to rkyv_serialize and their fork arg:"
rg --line-number 'rkyv_serialize\(' -A 1

echo
echo "Places using Some(ForkName::Feynman):"
rg --line-number 'Some\(ForkName::Feynman\)'

echo
echo "Places constructing ForkName dynamically:"
rg --line-number 'ForkName::from\('

Length of output: 1308


Replace hard-coded Feynman with the task’s actual fork_name

Serialization must use the configured fork to keep witness and metadata in sync. Update both occurrences where ForkName::Feynman is passed to rkyv_serialize:

Files needing changes:

  • crates/libzkp/src/tasks/bundle.rs (line 86)
  • crates/libzkp/src/tasks/chunk.rs (line 75)

Apply this diff in each file:

- serialized_witness: vec![witness.rkyv_serialize(Some(ForkName::Feynman))?.to_vec()],
+ serialized_witness: vec![witness.rkyv_serialize(Some(fork_name))?.to_vec()],

Both modules already bind fork_name earlier (e.g. let fork_name = ForkName::from(self.fork_name.as_str());), so no new variable is needed.

Optional sanity check to confirm all instances:

rg --line-number 'rkyv_serialize\(' -A 1
rg --line-number 'Some\(ForkName::Feynman\)'
rg --line-number 'ForkName::from\('
🤖 Prompt for AI Agents
In crates/libzkp/src/tasks/bundle.rs at line 86, replace the hard-coded
ForkName::Feynman argument passed to rkyv_serialize with the existing fork_name
variable to ensure serialization uses the configured fork. Locate the
rkyv_serialize calls and substitute Some(ForkName::Feynman) with
Some(fork_name). Repeat the same change in crates/libzkp/src/tasks/chunk.rs at
line 75. No new variable declaration is needed since fork_name is already
defined earlier in both files.

@@ -71,7 +72,7 @@ impl TryFrom<ChunkProvingTask> for ProvingTask {
identifier: value.identifier(),
fork_name: value.fork_name,
aggregated_proofs: Vec::new(),
serialized_witness: vec![witness.rkyv_serialize(None)?.to_vec()],
serialized_witness: vec![witness.rkyv_serialize(Some(ForkName::Feynman))?.to_vec()],
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Same issue: serialization must use the task’s fork, not a hard-coded Feynman

Align serialization with the provided fork_name to prevent cross-fork inconsistencies and verification failures.

Apply this diff within the selected line:

-            serialized_witness: vec![witness.rkyv_serialize(Some(ForkName::Feynman))?.to_vec()],
+            serialized_witness: vec![witness.rkyv_serialize(Some(fork))?.to_vec()],

And add this line before constructing ProvingTask (outside the selected range):

let fork = ForkName::from(value.fork_name.as_str());

Optional check for consistency across the repo:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "All rkyv_serialize calls and fork argument:"
rg --line-number 'rkyv_serialize\(' -A 1

Length of output: 558


Use the provided fork name for serialization instead of hard-coding Feynman

Both crate/libzkp/src/tasks/chunk.rs and crate/libzkp/src/tasks/bundle.rs currently serialize the witness with ForkName::Feynman. This will break cross-fork proofs if a different fork is requested. You need to:

• Extract the fork from value.fork_name before building the task
• Pass that fork into rkyv_serialize instead of ForkName::Feynman

Locations to update:

  • crates/libzkp/src/tasks/chunk.rs (around line 75)
  • crates/libzkp/src/tasks/bundle.rs (around line 86)

Example diff for both files:

@@ before constructing the ProvingTask
-            serialized_witness: vec![witness.rkyv_serialize(Some(ForkName::Feynman))?.to_vec()],
+            serialized_witness: vec![witness.rkyv_serialize(Some(fork))?.to_vec()],

Make sure you add, just above the task construction in each file:

let fork = ForkName::from(value.fork_name.as_str());

This ensures serialization always uses the fork specified by the caller.

🤖 Prompt for AI Agents
In crates/libzkp/src/tasks/chunk.rs at line 75, replace the hard-coded
ForkName::Feynman in the witness serialization with a dynamic fork value. First,
extract the fork by adding let fork = ForkName::from(value.fork_name.as_str());
just above the task construction, then pass this fork variable into
rkyv_serialize instead of ForkName::Feynman. This change ensures the
serialization respects the requested fork and prevents cross-fork proof issues.

@lispc lispc marked this pull request as draft August 11, 2025 00:04
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.

1 participant