Skip to content

Feat/remove public inputs from verify function#1

Merged
pedrobergamini merged 7 commits into
mainfrom
feat/remove-public-inputs-from-verify-function
Jun 15, 2025
Merged

Feat/remove public inputs from verify function#1
pedrobergamini merged 7 commits into
mainfrom
feat/remove-public-inputs-from-verify-function

Conversation

@pedrobergamini

@pedrobergamini pedrobergamini commented Jun 15, 2025

Copy link
Copy Markdown
Owner

Motivation

Description

Closes #issue_number

Summary by CodeRabbit

  • New Features

    • Centralized construction of public inputs for proof verification, ensuring consistency across different proof systems.
  • Bug Fixes

    • Improved handling of proof verification inputs to reduce errors and inconsistencies.
  • Documentation

    • Updated comments and documentation to reflect changes in proof input handling and function signatures.
  • Refactor

    • Simplified and unified function signatures and calldata structures for batch verification.
    • Updated internal logic to use encoded byte slices for output commits.
  • Chores

    • Adjusted constant values and documentation to align with new function signatures and input handling.

@coderabbitai

coderabbitai Bot commented Jun 15, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

The changes update the batch verification process across the prover, contract, and sequencer layers. The verifyBatch interface and implementation are refactored to centralize public input construction, removing separate calldata fields in favor of internally derived inputs. Corresponding updates are made to proof generation, calldata formatting, and function signatures to ensure consistency throughout the stack.

Changes

File(s) Change Summary
crates/l2/contracts/src/l1/OnChainProposer.sol Refactored verifyBatch to internally construct unified public inputs; removed separate calldata parameters; added _getPublicInputsFromCommitment function for input construction.
crates/l2/contracts/src/l1/interfaces/IOnChainProposer.sol Updated verifyBatch interface: removed separate public input parameters; updated documentation to reflect new input construction approach.
crates/l2/prover/src/backends/risc0.rs Changed to_batch_proof and to_calldata to remove journal from calldata and update types; now returns BatchProof and omits journal field.
crates/l2/prover/src/backends/sp1.rs Modified to_calldata to replace public values with verifying key hash in calldata; updated comments accordingly.
crates/l2/prover/zkvm/interface/risc0/src/main.rs
crates/l2/prover/zkvm/interface/sp1/src/main.rs
Changed commit calls from commit to commit_slice for encoded output in main functions.
crates/l2/sequencer/l1_proof_sender.rs Updated VERIFY_FUNCTION_SIGNATURE to match new verifyBatch signature with fewer parameters.
crates/l2/utils/prover/proving_systems.rs Updated empty_calldata method: changed returned vectors to match new contract interface; updated documentation and internal comments.

Sequence Diagram(s)

sequenceDiagram
    participant Sequencer
    participant OnChainProposer
    participant Risc0Verifier
    participant SP1Verifier
    participant TDXVerifier

    Sequencer->>OnChainProposer: verifyBatch(batchNumber, risc0BlockProof, risc0ImageId, sp1ProofBytes, tdxSignature)
    OnChainProposer->>OnChainProposer: _getPublicInputsFromCommitment(batchNumber)
    OnChainProposer->>Risc0Verifier: verifyProof(risc0BlockProof, risc0ImageId, sha256(publicInputs))
    OnChainProposer->>SP1Verifier: verifyProof(sp1ProofBytes, publicInputs)
    OnChainProposer->>TDXVerifier: verifyProof(tdxSignature, publicInputs)
    OnChainProposer-->>Sequencer: Verification result
Loading

Poem

A bunny hopped through code so neat,
Refactored proofs—no more repeat!
Public inputs now combined,
Calldata trimmed, all realigned.
With hashes, bytes, and less to send,
The chain grows leaner—onward, friend!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fdfbcc2 and 97cb2d4.

📒 Files selected for processing (8)
  • crates/l2/contracts/src/l1/OnChainProposer.sol (2 hunks)
  • crates/l2/contracts/src/l1/interfaces/IOnChainProposer.sol (1 hunks)
  • crates/l2/prover/src/backends/risc0.rs (3 hunks)
  • crates/l2/prover/src/backends/sp1.rs (1 hunks)
  • crates/l2/prover/zkvm/interface/risc0/src/main.rs (1 hunks)
  • crates/l2/prover/zkvm/interface/sp1/src/main.rs (1 hunks)
  • crates/l2/sequencer/l1_proof_sender.rs (1 hunks)
  • crates/l2/utils/prover/proving_systems.rs (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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.

@pedrobergamini pedrobergamini merged commit 7ece6a1 into main Jun 15, 2025
6 of 13 checks passed
@pedrobergamini pedrobergamini deleted the feat/remove-public-inputs-from-verify-function branch June 15, 2025 23:44
pedrobergamini added a commit that referenced this pull request Aug 24, 2025
…rom-verify-function

Feat/remove public inputs from verify function
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