Skip to content

Commit e45055e

Browse files
Add events to setters and update the contract interface
1 parent 6ec3c81 commit e45055e

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

contracts/src/core/AlignedProofAggregationService.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ contract AlignedProofAggregationService is
174174

175175
function addProgramId(bytes32 programId, VerifierType verifierType) external onlyOwner {
176176
programIds[programId] = uint8(verifierType);
177+
emit ProgramIdAdded(programId, verifierType);
177178
}
178179

179180
function deleteProgramId(bytes32 programId) external onlyOwner {
180181
// Check if we should verify its existence before deleting
181182
delete programIds[programId];
183+
emit ProgramIdDeleted(programId);
182184
}
183185
}

contracts/src/core/IAlignedProofAggregationService.sol

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ interface IAlignedProofAggregationService {
1111
/// @notice Event emitted when the SP1 verifier address is updated
1212
event SP1VerifierAddressUpdated(address indexed newAddress);
1313

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);
14+
/// @notice Event emitted when a new program ID is added
15+
event ProgramIdAdded(bytes32 indexed programId, AlignedProofAggregationService.VerifierType verifierType);
16+
17+
/// @notice Event emitted when a program ID is deleted
18+
event ProgramIdDeleted(bytes32 indexed programId);
1919

2020
/// @notice Method to verify an aggregated proof from aligned
2121
/// @dev This function is called by the aligned proof aggregator after collecting the proofs and aggregating them
@@ -38,17 +38,18 @@ interface IAlignedProofAggregationService {
3838
/// @param _risc0VerifierAddress The new address for the Risc0 verifier contract
3939
function setRisc0VerifierAddress(address _risc0VerifierAddress) external;
4040

41-
/// @notice Sets the image id of the Risc0 program
42-
/// @param _risc0AggregatorProgramImageId The new imageid for the Risc0 aggregator program
43-
function setRisc0AggregatorProgramImageId(bytes32 _risc0AggregatorProgramImageId) external;
44-
4541
/// @notice Sets the address of the SP1 verifier contract
4642
/// @param _sp1VerifierAddress The new address for the SP1 verifier contract
4743
function setSP1VerifierAddress(address _sp1VerifierAddress) external;
4844

49-
/// @notice Sets the vk hash of the sp1 program
50-
/// @param _sp1AggregatorProgramVKHash The new vk hash for the sp1 aggregator program
51-
function setSP1AggregatorProgramVKHash(bytes32 _sp1AggregatorProgramVKHash) external;
45+
/// @notice Adds a new program ID with its verifier type
46+
/// @param programId The program ID to add
47+
/// @param verifierType The type of verifier (SP1 or RISC0)
48+
function addProgramId(bytes32 programId, uint8 verifierType) external;
49+
50+
/// @notice Deletes an existing program ID
51+
/// @param programId The program ID to delete
52+
function deleteProgramId(bytes32 programId) external;
5253

5354
error OnlyAlignedAggregator(address sender);
5455
}

0 commit comments

Comments
 (0)