Skip to content

Commit e634e58

Browse files
Check if the verifier type matches the one received by param on deleteProgramId
1 parent aceefe1 commit e634e58

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

contracts/src/core/AlignedProofAggregationService.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,12 @@ contract AlignedProofAggregationService is
194194
function deleteProgramId(bytes32 programId, IAlignedProofAggregationService.VerifierType verifierType) external onlyOwner validVerifierType(verifierType) {
195195
// Preserve the verifier type so we can emit it with the event
196196
uint8 verifierTypeRaw = programIds[programId];
197+
uint8 rawReceivedVerifierType = uint8(verifierType);
197198

198-
// TODO: Check if the verifier type matches the one received by param
199+
// Check if the obtained verifier type matches the one received by param
200+
if (verifierTypeRaw != rawReceivedVerifierType) {
201+
revert IAlignedProofAggregationService.VerifierTypeMismatch(verifierTypeRaw, rawReceivedVerifierType);
202+
}
199203

200204
delete programIds[programId];
201205
emit ProgramIdDeleted(programId, IAlignedProofAggregationService.VerifierType(verifierTypeRaw));

contracts/src/core/IAlignedProofAggregationService.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ interface IAlignedProofAggregationService {
5959

6060
error InvalidVerifierType(uint8 actual);
6161

62+
error VerifierTypeMismatch(uint8 expected, uint8 received);
63+
6264
enum VerifierType {
6365
INVALID, // If a given program does not exist in the `programId` map, it defaults to 0. This prevents non-existing keys to be considered valid in case SP1 or RISC0 were in this position
6466
SP1,

0 commit comments

Comments
 (0)