Skip to content

Commit 5607821

Browse files
authored
Add missing functions and events (#1930)
1 parent 9fcdd63 commit 5607821

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,27 @@ contract AlignedProofAggregationService is
124124
/// @param _risc0VerifierAddress The new address for the Risc0 verifier contract
125125
function setRisc0VerifierAddress(address _risc0VerifierAddress) external onlyOwner {
126126
risc0VerifierAddress = _risc0VerifierAddress;
127+
emit Risc0VerifierAddressUpdated(_risc0VerifierAddress);
127128
}
128129

129130
/// @notice Sets the image id of the Risc0 program
130131
/// @param _risc0AggregatorProgramImageId The new imageid for the Risc0 aggregator program
131132
function setRisc0AggregatorProgramImageId(bytes32 _risc0AggregatorProgramImageId) external onlyOwner {
132133
risc0AggregatorProgramImageId = _risc0AggregatorProgramImageId;
134+
emit Risc0AggregatorProgramImageIdUpdated(_risc0AggregatorProgramImageId);
135+
}
136+
137+
/// @notice Sets the address of the SP1 verifier contract
138+
/// @param _sp1VerifierAddress The new address for the SP1 verifier contract
139+
function setSP1VerifierAddress(address _sp1VerifierAddress) external onlyOwner {
140+
sp1VerifierAddress = _sp1VerifierAddress;
141+
emit SP1VerifierAddressUpdated(_sp1VerifierAddress);
133142
}
134143

135144
/// @notice Sets the vk hash of the sp1 program
136145
/// @param _sp1AggregatorProgramVKHash The new vk hash for the sp1 aggregator program
137146
function setSP1AggregatorProgramVKHash(bytes32 _sp1AggregatorProgramVKHash) external onlyOwner {
138147
sp1AggregatorProgramVKHash = _sp1AggregatorProgramVKHash;
148+
emit SP1AggregatorProgramVKHashUpdated(_sp1AggregatorProgramVKHash);
139149
}
140150
}

contracts/src/core/IAlignedProofAggregationService.sol

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
pragma solidity ^0.8.12;
22

33
interface IAlignedProofAggregationService {
4+
5+
/// @notice event that gets emitted after a successful aggregated proof verification
6+
event AggregatedProofVerified(bytes32 indexed merkleRoot, bytes32 blobVersionedHash);
7+
8+
/// @notice Event emitted when the Risc0 verifier address is updated
9+
event Risc0VerifierAddressUpdated(address indexed newAddress);
10+
11+
/// @notice Event emitted when the SP1 verifier address is updated
12+
event SP1VerifierAddressUpdated(address indexed newAddress);
13+
14+
/// @notice Event emitted when the Risc0 aggregator program image ID is updated
15+
event Risc0AggregatorProgramImageIdUpdated(bytes32 indexed newImageId);
16+
17+
/// @notice Event emitted when the SP1 aggregator program VK hash is updated
18+
event SP1AggregatorProgramVKHashUpdated(bytes32 indexed newVKHash);
19+
420
/// @notice Method to verify an aggregated proof from aligned
521
/// @dev This function is called by the aligned proof aggregator after collecting the proofs and aggregating them
622
/// to be verified on-chain. We expect the blobTransactionHash to be called before
@@ -13,8 +29,21 @@ interface IAlignedProofAggregationService {
1329
function verifyRisc0(bytes32 blobVersionedHash, bytes calldata risc0ReceiptSeal, bytes calldata risc0JournalBytes)
1430
external;
1531

16-
/// @notice event that gets emitted after a successful aggregated proof verification
17-
event AggregatedProofVerified(bytes32 indexed merkleRoot, bytes32 blobVersionedHash);
32+
/// @notice Sets the address of the Risc0 verifier contract
33+
/// @param _risc0VerifierAddress The new address for the Risc0 verifier contract
34+
function setRisc0VerifierAddress(address _risc0VerifierAddress) external;
35+
36+
/// @notice Sets the image id of the Risc0 program
37+
/// @param _risc0AggregatorProgramImageId The new imageid for the Risc0 aggregator program
38+
function setRisc0AggregatorProgramImageId(bytes32 _risc0AggregatorProgramImageId) external;
39+
40+
/// @notice Sets the address of the SP1 verifier contract
41+
/// @param _sp1VerifierAddress The new address for the SP1 verifier contract
42+
function setSP1VerifierAddress(address _sp1VerifierAddress) external;
43+
44+
/// @notice Sets the vk hash of the sp1 program
45+
/// @param _sp1AggregatorProgramVKHash The new vk hash for the sp1 aggregator program
46+
function setSP1AggregatorProgramVKHash(bytes32 _sp1AggregatorProgramVKHash) external;
1847

1948
error OnlyAlignedAggregator(address sender);
2049
}

0 commit comments

Comments
 (0)