Skip to content

Commit df1d83a

Browse files
committed
feat: allow risc0 succinct proofs
1 parent 1c4440b commit df1d83a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

aggregation_mode/src/aggregators/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl ProgramOutput {
2727
pub enum ProofAggregationError {
2828
SP1Verification(sp1_sdk::SP1VerificationError),
2929
SP1Proving,
30-
Risc0Proving,
30+
Risc0Proving(String),
3131
UnsupportedProof,
3232
}
3333

aggregation_mode/src/aggregators/risc0_aggregator.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ pub(crate) fn aggregate_proofs(
6666
};
6767
env_builder
6868
.write(&input)
69-
.map_err(|_| ProofAggregationError::Risc0Proving)?;
69+
.map_err(|e| ProofAggregationError::Risc0Proving(e.to_string()))?;
7070

7171
let env = env_builder
7272
.build()
73-
.map_err(|_| ProofAggregationError::Risc0Proving)?;
73+
.map_err(|e| ProofAggregationError::Risc0Proving(e.to_string()))?;
7474

7575
let prover = default_prover();
76+
7677
let receipt = prover
7778
.prove_with_opts(env, RISC0_AGGREGATOR_PROGRAM_ELF, &ProverOpts::groth16())
78-
.map_err(|_| ProofAggregationError::Risc0Proving)?
79+
.map_err(|e| ProofAggregationError::Risc0Proving(e.to_string()))?
7980
.receipt;
8081

8182
let output = Risc0ProofReceiptAndImageId {
@@ -95,13 +96,13 @@ pub enum AlignedRisc0VerificationError {
9596
pub(crate) fn verify(
9697
proof: &Risc0ProofReceiptAndImageId,
9798
) -> Result<(), AlignedRisc0VerificationError> {
98-
// only composite proofs are supported for recursion
99-
if proof.receipt.inner.composite().is_err() {
100-
Err(AlignedRisc0VerificationError::UnsupportedProof)
101-
} else {
99+
// only stark proofs are supported for recursion
100+
if proof.receipt.inner.composite().is_ok() || proof.receipt.inner.succinct().is_ok() {
102101
proof
103102
.receipt
104103
.verify(proof.image_id)
105104
.map_err(|e| AlignedRisc0VerificationError::Verification(e.to_string()))
105+
} else {
106+
Err(AlignedRisc0VerificationError::UnsupportedProof)
106107
}
107108
}

0 commit comments

Comments
 (0)