Skip to content

Commit

Permalink
refactor: OnChainProposer verify function
Browse files Browse the repository at this point in the history
  • Loading branch information
fborello-lambda committed Dec 5, 2024
1 parent 6a3c79f commit c2d5a9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 4 additions & 6 deletions crates/l2/contracts/src/l1/OnChainProposer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ contract OnChainProposer is IOnChainProposer, ReentrancyGuard {
uint256 blockNumber,
bytes calldata blockProof,
bytes32 imageId,
bytes32 journalDigest
bytes32 journalDigest,
bytes32 programVKey,
bytes calldata publicValues,
bytes calldata proofBytes
) external override onlySequencer {
require(
blockNumber == lastVerifiedBlock + 1,
Expand All @@ -191,11 +194,6 @@ contract OnChainProposer is IOnChainProposer, ReentrancyGuard {
}

if (SP1VERIFIER != DEV_MODE) {
// TODO: remove
// used as placeholders
bytes32 programVKey = bytes32(0);
bytes memory publicValues;
bytes memory proofBytes;
// If the verification fails, it will revert.
ISP1Verifier(SP1VERIFIER).verifyProof(
programVKey,
Expand Down
9 changes: 8 additions & 1 deletion crates/l2/contracts/src/l1/interfaces/IOnChainProposer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,17 @@ interface IOnChainProposer {
/// @param blockProof is the proof of the block to be verified.
/// @param imageId Digest of the zkVM imageid.
/// @param journalDigest Digest of the public_inputs aka journal
/// ----------------------------------------------------------------------
/// @param programVKey Public verifying key
/// @param publicValues Values used to perform the execution
/// @param proofBytes Groth16 proof
function verify(
uint256 blockNumber,
bytes calldata blockProof,
bytes32 imageId,
bytes32 journalDigest
bytes32 journalDigest,
bytes32 programVKey,
bytes calldata publicValues,
bytes calldata proofBytes
) external;
}

0 comments on commit c2d5a9d

Please sign in to comment.