Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions contracts/src/core/AlignedProofAggregationService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,27 @@ contract AlignedProofAggregationService is
/// @param _risc0VerifierAddress The new address for the Risc0 verifier contract
function setRisc0VerifierAddress(address _risc0VerifierAddress) external onlyOwner {
risc0VerifierAddress = _risc0VerifierAddress;
emit Risc0VerifierAddressUpdated(_risc0VerifierAddress);
}

/// @notice Sets the image id of the Risc0 program
/// @param _risc0AggregatorProgramImageId The new imageid for the Risc0 aggregator program
function setRisc0AggregatorProgramImageId(bytes32 _risc0AggregatorProgramImageId) external onlyOwner {
risc0AggregatorProgramImageId = _risc0AggregatorProgramImageId;
emit Risc0AggregatorProgramImageIdUpdated(_risc0AggregatorProgramImageId);
}

/// @notice Sets the address of the SP1 verifier contract
/// @param _sp1VerifierAddress The new address for the SP1 verifier contract
function setSP1VerifierAddress(address _sp1VerifierAddress) external onlyOwner {
sp1VerifierAddress = _sp1VerifierAddress;
emit SP1VerifierAddressUpdated(_sp1VerifierAddress);
}

/// @notice Sets the vk hash of the sp1 program
/// @param _sp1AggregatorProgramVKHash The new vk hash for the sp1 aggregator program
function setSP1AggregatorProgramVKHash(bytes32 _sp1AggregatorProgramVKHash) external onlyOwner {
sp1AggregatorProgramVKHash = _sp1AggregatorProgramVKHash;
emit SP1AggregatorProgramVKHashUpdated(_sp1AggregatorProgramVKHash);
}
}
33 changes: 31 additions & 2 deletions contracts/src/core/IAlignedProofAggregationService.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
pragma solidity ^0.8.12;

interface IAlignedProofAggregationService {

/// @notice event that gets emitted after a successful aggregated proof verification
event AggregatedProofVerified(bytes32 indexed merkleRoot, bytes32 blobVersionedHash);

/// @notice Event emitted when the Risc0 verifier address is updated
event Risc0VerifierAddressUpdated(address indexed newAddress);

/// @notice Event emitted when the SP1 verifier address is updated
event SP1VerifierAddressUpdated(address indexed newAddress);

/// @notice Event emitted when the Risc0 aggregator program image ID is updated
event Risc0AggregatorProgramImageIdUpdated(bytes32 indexed newImageId);

/// @notice Event emitted when the SP1 aggregator program VK hash is updated
event SP1AggregatorProgramVKHashUpdated(bytes32 indexed newVKHash);

/// @notice Method to verify an aggregated proof from aligned
/// @dev This function is called by the aligned proof aggregator after collecting the proofs and aggregating them
/// to be verified on-chain. We expect the blobTransactionHash to be called before
Expand All @@ -13,8 +29,21 @@ interface IAlignedProofAggregationService {
function verifyRisc0(bytes32 blobVersionedHash, bytes calldata risc0ReceiptSeal, bytes calldata risc0JournalBytes)
external;

/// @notice event that gets emitted after a successful aggregated proof verification
event AggregatedProofVerified(bytes32 indexed merkleRoot, bytes32 blobVersionedHash);
/// @notice Sets the address of the Risc0 verifier contract
/// @param _risc0VerifierAddress The new address for the Risc0 verifier contract
function setRisc0VerifierAddress(address _risc0VerifierAddress) external;

/// @notice Sets the image id of the Risc0 program
/// @param _risc0AggregatorProgramImageId The new imageid for the Risc0 aggregator program
function setRisc0AggregatorProgramImageId(bytes32 _risc0AggregatorProgramImageId) external;

/// @notice Sets the address of the SP1 verifier contract
/// @param _sp1VerifierAddress The new address for the SP1 verifier contract
function setSP1VerifierAddress(address _sp1VerifierAddress) external;

/// @notice Sets the vk hash of the sp1 program
/// @param _sp1AggregatorProgramVKHash The new vk hash for the sp1 aggregator program
function setSP1AggregatorProgramVKHash(bytes32 _sp1AggregatorProgramVKHash) external;

error OnlyAlignedAggregator(address sender);
}
Loading