Skip to content

refactor(l2): reconstruct public inputs from batchCommitmentInfo#5804

Merged
avilagaston9 merged 8 commits into
mainfrom
feat/l2/remove_public_inputs_from_verify_batch
Jan 13, 2026
Merged

refactor(l2): reconstruct public inputs from batchCommitmentInfo#5804
avilagaston9 merged 8 commits into
mainfrom
feat/l2/remove_public_inputs_from_verify_batch

Conversation

@avilagaston9

@avilagaston9 avilagaston9 commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Motivation

Currently, verifyBatch() receives the public inputs as a parameter and they are compared against batchCommitmentInfo before verifying the proof. This PR constructs the public inputs from batchCommitmentInfo instead of receiving them as a parameter.

Description

  • Removes _verifyPublicData() from the OnChainProposer contract.
  • Creates _getPublicInputsFromCommitment() to construct the public inputs.
  • Modifies the prover and sequencer to avoid sending public inputs.

Checklist

  • Updated STORE_SCHEMA_VERSION (crates/storage/lib.rs) if the PR includes breaking changes to the Store requiring a re-sync.

Thanks @pedrobergamini for your contribution!

Closes #2804

@github-actions

github-actions Bot commented Jan 9, 2026

Copy link
Copy Markdown

Lines of code report

Total lines added: 0
Total lines removed: 11
Total lines changed: 11

Detailed view
+-------------------------------------------------+-------+------+
| File                                            | Lines | Diff |
+-------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/backend/exec.rs     | 57    | -1   |
+-------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/backend/risc0.rs    | 129   | -1   |
+-------------------------------------------------+-------+------+
| ethrex/crates/l2/prover/src/backend/sp1.rs      | 150   | -3   |
+-------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/l1_proof_verifier.rs | 343   | -6   |
+-------------------------------------------------+-------+------+

@github-actions github-actions Bot added the L2 Rollup client label Jan 12, 2026
@avilagaston9 avilagaston9 self-assigned this Jan 12, 2026
Co-authored-by: pedrobergamini <41773103+pedrobergamini@users.noreply.github.com>
@avilagaston9 avilagaston9 force-pushed the feat/l2/remove_public_inputs_from_verify_batch branch from 42c1678 to 429deea Compare January 12, 2026 15:09
@avilagaston9 avilagaston9 marked this pull request as ready for review January 12, 2026 17:45
Copilot AI review requested due to automatic review settings January 12, 2026 17:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the proof verification process by reconstructing public inputs from committed batch data on-chain instead of receiving them as parameters. This simplifies the verification flow and reduces calldata size.

Changes:

  • Removed _verifyPublicData() function and replaced it with _getPublicInputsFromCommitment() to reconstruct public inputs from stored commitments
  • Updated verifyBatch() and verifyBatchesAligned() function signatures to remove public input parameters
  • Modified prover backends (SP1, RISC0, TDX, Exec) and sequencer to stop sending public inputs to the contract

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
crates/l2/contracts/src/l1/OnChainProposer.sol Replaced public input validation with reconstruction logic, added _getPublicInputsFromCommitment()
crates/l2/contracts/src/l1/based/OnChainProposer.sol Similar changes for based sequencer variant with simplified batch commitment structure
crates/l2/contracts/src/l1/Timelock.sol Updated function signatures to match new OnChainProposer interface
crates/l2/contracts/src/l1/interfaces/IOnChainProposer.sol Updated interface definitions to remove public input parameters
crates/l2/contracts/src/l1/based/interfaces/IOnChainProposer.sol Updated based interface to match changes
crates/l2/contracts/src/l1/interfaces/ITimelock.sol Updated timelock interface to match changes
crates/l2/prover/src/backend/sp1.rs Removed public values from proof calldata
crates/l2/prover/src/backend/risc0.rs Removed journal from proof calldata
crates/l2/prover/src/backend/exec.rs Updated to send empty calldata for exec prover
crates/l2/common/src/prover.rs Updated empty_calldata() to return single empty bytes value
crates/l2/sequencer/l1_proof_sender.rs Updated verifyBatch function signature to remove public input parameters
crates/l2/sequencer/l1_proof_verifier.rs Updated verifyBatchesAligned to use batch number range instead of public inputs list
crates/l2/tee/quote-gen/src/main.rs Removed public values from TDX proof calldata
docs/l2/fundamentals/contracts.md Removed documentation for deleted _verifyPublicData() function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/l2/contracts/src/l1/OnChainProposer.sol Outdated
Comment thread crates/l2/contracts/src/l1/based/OnChainProposer.sol Outdated
Comment thread docs/l2/fundamentals/contracts.md Outdated
Comment thread crates/l2/contracts/src/l1/based/OnChainProposer.sol Outdated
Comment thread crates/l2/contracts/src/l1/OnChainProposer.sol Outdated
@ManuelBilbao ManuelBilbao added this pull request to the merge queue Jan 13, 2026
@avilagaston9 avilagaston9 removed this pull request from the merge queue due to a manual request Jan 13, 2026
@avilagaston9 avilagaston9 added this pull request to the merge queue Jan 13, 2026
Merged via the queue into main with commit 3c0d089 Jan 13, 2026
55 checks passed
@avilagaston9 avilagaston9 deleted the feat/l2/remove_public_inputs_from_verify_batch branch January 13, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L2 Rollup client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

L2: remove public inputs from verify() function in OnChainProposer

4 participants