Skip to content

Commit 3f483e0

Browse files
committed
fix: address clippy warnings
1 parent 82ffe4e commit 3f483e0

4 files changed

Lines changed: 12 additions & 21 deletions

File tree

aggregation_mode/src/aggregators/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ pub mod sp1_aggregator;
44
use std::fmt::Display;
55

66
use lambdaworks_crypto::merkle_tree::traits::IsMerkleTreeBackend;
7-
use risc0_aggregator::{
8-
AlignedRisc0VerificationError, Risc0AggregationError, Risc0ProofReceiptAndImageId,
9-
};
7+
use risc0_aggregator::{Risc0AggregationError, Risc0ProofReceiptAndImageId};
108
use sha3::{Digest, Keccak256};
11-
use sp1_aggregator::{
12-
AlignedSP1VerificationError, SP1AggregationError, SP1ProofWithPubValuesAndElf,
13-
};
9+
use sp1_aggregator::{SP1AggregationError, SP1ProofWithPubValuesAndElf};
1410
use tracing::info;
1511

1612
#[derive(Clone, Debug)]

aggregation_mode/src/aggregators/risc0_aggregator.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ impl Risc0ProofReceiptAndImageId {
2424
receipt: Receipt,
2525
) -> Result<Self, AlignedRisc0VerificationError> {
2626
let is_supported_proof =
27-
proof.receipt.inner.composite().is_ok() || proof.receipt.inner.succinct().is_ok();
27+
receipt.inner.composite().is_ok() || receipt.inner.succinct().is_ok();
2828

2929
if is_supported_proof {
30-
proof
31-
.receipt
32-
.verify(proof.image_id)
30+
receipt
31+
.verify(image_id)
3332
.map_err(|e| AlignedRisc0VerificationError::Verification(e.to_string()))?;
3433
} else {
3534
return Err(AlignedRisc0VerificationError::UnsupportedProof);

aggregation_mode/src/aggregators/sp1_aggregator.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const CHUNK_PROGRAM_ELF: &[u8] =
1313
const USER_PROOFS_PROGRAM_ELF: &[u8] =
1414
include_bytes!("../../aggregation_programs/sp1/elf/sp1_user_proofs_aggregator_program");
1515

16+
#[allow(dead_code)]
1617
static SP1_PROVER_CLIENT: LazyLock<EnvProver> = LazyLock::new(ProverClient::from_env);
18+
1719
/// Separate prover instance configured to always use the CPU.
1820
/// This is used for verification, which is performed in parallel and
1921
/// cannot be done on the GPU.
@@ -49,18 +51,12 @@ impl SP1ProofWithPubValuesAndElf {
4951
) -> Result<Self, AlignedSP1VerificationError> {
5052
let client = &*SP1_PROVER_CLIENT_CPU;
5153

52-
let (_pk, vk) = client.setup(&sp1_proof_with_pub_values_and_elf.elf);
54+
let (_pk, vk) = client.setup(&elf);
5355

5456
// only sp1 compressed proofs are supported for aggregation now
55-
match sp1_proof_with_pub_values_and_elf
56-
.proof_with_pub_values
57-
.proof
58-
{
57+
match proof_with_pub_values.proof {
5958
sp1_sdk::SP1Proof::Compressed(_) => client
60-
.verify(
61-
&sp1_proof_with_pub_values_and_elf.proof_with_pub_values,
62-
&vk,
63-
)
59+
.verify(&proof_with_pub_values, &vk)
6460
.map_err(AlignedSP1VerificationError::Verification),
6561
_ => Err(AlignedSP1VerificationError::UnsupportedProof),
6662
}?;

aggregation_mode/src/backend/fetcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl ProofsFetcher {
132132
};
133133

134134
match sp1_proof {
135-
Ok(proof) => Some(AlignedProof::SP1(sp1_proof)),
135+
Ok(proof) => Some(AlignedProof::SP1(proof.into())),
136136
Err(err) => {
137137
error!("Could not add proof, verification failed: {:?}", err);
138138
None
@@ -161,7 +161,7 @@ impl ProofsFetcher {
161161
};
162162

163163
match risc0_proof {
164-
Ok(proof) => Some(AlignedProof::Risc0(risc0_proof)),
164+
Ok(proof) => Some(AlignedProof::Risc0(proof.into())),
165165
Err(err) => {
166166
error!("Could not add proof, verification failed: {:?}", err);
167167
None

0 commit comments

Comments
 (0)