Skip to content

Commit 8ba0339

Browse files
committed
feat: take blob versioned hash instead of blob tx in verify contract
1 parent 28757e0 commit 8ba0339

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

contracts/src/core/AlignedProofAggregationService.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ contract AlignedProofAggregationService is
4646
}
4747

4848
function verify(
49-
bytes32 blobTransactionHash,
49+
bytes32 blobVersionedHash,
5050
bytes32 sp1ProgramVKey,
5151
bytes calldata sp1PublicValues,
5252
bytes calldata sp1ProofBytes
5353
) public onlyAlignedAggregator {
5454
// In dev mode, poofs are mocked, so we skip the verification part
5555
if (sp1VerifierAddress == VERIFIER_MOCK_ADDRESS) {
5656
(bytes32 merkleRoot) = abi.decode(sp1PublicValues, (bytes32));
57-
_newAggregatedProof(merkleRoot, blobTransactionHash);
57+
_newAggregatedProof(merkleRoot, blobVersionedHash);
5858
return;
5959
}
6060

6161
try ISP1Verifier(sp1VerifierAddress).verifyProof(sp1ProgramVKey, sp1PublicValues, sp1ProofBytes) {
6262
(bytes32 merkleRoot) = abi.decode(sp1PublicValues, (bytes32));
63-
_newAggregatedProof(merkleRoot, blobTransactionHash);
63+
_newAggregatedProof(merkleRoot, blobVersionedHash);
6464
} catch {
6565
AggregatedProof storage proof = aggregatedProofs[currentAggregatedProofNumber];
6666
proof.status = AggregatedProofStatus.Failed;

contracts/src/core/IAlignedProofAggregationService.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ interface IAlignedProofAggregationService {
2424
/// @notice Method to verify an aggregated proof from aligned
2525
/// @dev This function is called by the aligned proof aggregator after collecting the proofs and aggregating them
2626
/// to be verified on-chain. We expect the blobTransactionHash to be called before
27-
/// @param blobTransactionHash the hash of the blob transaction that contains the leaves that compose the merkle root.
27+
/// @param blobVersionedHash the versioned hash of the blob transaction that contains the leaves that compose the merkle root.
2828
/// @param sp1ProgramVKey Public verifying key
2929
/// @param sp1PublicValues Values used to perform the execution
3030
/// @param sp1ProofBytes Groth16 proof
3131
function verify(
32-
bytes32 blobTransactionHash,
32+
bytes32 blobVersionedHash,
3333
bytes32 sp1ProgramVKey,
3434
bytes calldata sp1PublicValues,
3535
bytes calldata sp1ProofBytes
@@ -43,10 +43,10 @@ interface IAlignedProofAggregationService {
4343
function markCurrentAggregatedProofAsMissed() external;
4444

4545
/// @notice event that gets emitted after a successful aggregated proof verification
46-
event NewAggregatedProofVerified(uint64 indexed proofNumber, bytes32 merkleRoot, bytes32 blobTransactionHash);
47-
/// @notice event that gets emitted after a successful aggregated proof verification
46+
event NewAggregatedProofVerified(uint64 indexed proofNumber, bytes32 merkleRoot, bytes32 blobVersionedHash);
47+
/// @notice event that gets emitted when an aggregated proof could not be sent to the contract.
4848
event AggregatedProofMissed(uint64 indexed proofNumber);
49-
/// @notice event that gets emitted after a successful aggregated proof verification
49+
/// @notice event that gets emitted after a failed aggregated proof verification
5050
event AggregatedProofFailed(uint64 indexed proofNumber);
5151

5252
error OnlyAlignedAggregator(address sender);

0 commit comments

Comments
 (0)