Skip to content

Commit 1935850

Browse files
committed
feat: aggregated proof getter for ProofAggregationService
1 parent 93fcccd commit 1935850

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ contract AlignedProofAggregationService is
6262
(bytes32 merkleRoot) = abi.decode(sp1PublicValues, (bytes32));
6363
_newAggregatedProof(merkleRoot, blobTransactionHash);
6464
} catch {
65+
AggregatedProof storage proof = aggregatedProofs[currentAggregatedProofNumber];
66+
proof.status = AggregatedProofStatus.Failed;
6567
emit AggregatedProofFailed(currentAggregatedProofNumber);
6668
}
6769
}
6870

6971
function markCurrentAggregatedProofAsMissed() public onlyAlignedAggregator {
72+
AggregatedProof storage proof = aggregatedProofs[currentAggregatedProofNumber];
73+
proof.status = AggregatedProofStatus.Missed;
7074
emit AggregatedProofMissed(currentAggregatedProofNumber);
7175
currentAggregatedProofNumber += 1;
7276
}
@@ -80,6 +84,11 @@ contract AlignedProofAggregationService is
8084
currentAggregatedProofNumber += 1;
8185
}
8286

87+
function getAggregatedProof(uint64 proofNumber) public view returns (uint8, bytes32 blobHash, bytes32 merkleRoot) {
88+
AggregatedProof storage proof = aggregatedProofs[proofNumber];
89+
return (uint8(proof.status), proof.blobHash, proof.merkleRoot);
90+
}
91+
8392
function _authorizeUpgrade(address newImplementation)
8493
internal
8594
override

contracts/src/core/IAlignedProofAggregationService.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ interface IAlignedProofAggregationService {
3535
bytes calldata sp1ProofBytes
3636
) external;
3737

38+
function getAggregatedProof(uint64 proofNumber)
39+
external
40+
view
41+
returns (uint8 status, bytes32 blobHash, bytes32 merkleRoot);
42+
3843
function markCurrentAggregatedProofAsMissed() external;
3944

4045
/// @notice event that gets emitted after a successful aggregated proof verification

0 commit comments

Comments
 (0)