refactor(l2): reconstruct public inputs from batchCommitmentInfo#5804
Merged
avilagaston9 merged 8 commits intoJan 13, 2026
Conversation
Lines of code reportTotal lines added: Detailed view |
Co-authored-by: pedrobergamini <41773103+pedrobergamini@users.noreply.github.com>
42c1678 to
429deea
Compare
Contributor
There was a problem hiding this comment.
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()andverifyBatchesAligned()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.
ilitteri
approved these changes
Jan 12, 2026
ManuelBilbao
approved these changes
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently,
verifyBatch()receives the public inputs as a parameter and they are compared againstbatchCommitmentInfobefore verifying the proof. This PR constructs the public inputs frombatchCommitmentInfoinstead of receiving them as a parameter.Description
_verifyPublicData()from theOnChainProposercontract._getPublicInputsFromCommitment()to construct the public inputs.Checklist
STORE_SCHEMA_VERSION(crates/storage/lib.rs) if the PR includes breaking changes to theStorerequiring a re-sync.Thanks @pedrobergamini for your contribution!
Closes #2804