Skip to content

Commit a19b5a6

Browse files
committed
fix: run cargo fmt
1 parent 088dbd8 commit a19b5a6

File tree

6 files changed

+36
-17
lines changed

6 files changed

+36
-17
lines changed

aggregation_mode/src/aggregators/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pub mod sp1_aggregator;
21
pub mod lib;
2+
pub mod sp1_aggregator;
33

44
use sp1_aggregator::{AlignedSP1VerificationError, SP1ProofWithPubValuesAndElf};
55
pub enum ZKVMEngine {
@@ -26,7 +26,11 @@ pub enum AlignedVerificationError {
2626
impl AlignedProof {
2727
pub fn verify(&self) -> Result<(), AlignedVerificationError> {
2828
match self {
29-
AlignedProof::SP1(proof) => sp1_aggregator::verify(proof).map_err(|arg0: sp1_aggregator::AlignedSP1VerificationError| AlignedVerificationError::Sp1(arg0)),
29+
AlignedProof::SP1(proof) => sp1_aggregator::verify(proof).map_err(
30+
|arg0: sp1_aggregator::AlignedSP1VerificationError| {
31+
AlignedVerificationError::Sp1(arg0)
32+
},
33+
),
3034
}
3135
}
3236
}

aggregation_mode/src/aggregators/sp1_aggregator.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ use sp1_sdk::{
66

77
use super::lib::{AggregatedProof, ProgramOutput, ProofAggregationError};
88

9-
const PROGRAM_ELF: &[u8] = include_bytes!("../../aggregation_programs/sp1/elf/sp1_aggregator_program");
9+
const PROGRAM_ELF: &[u8] =
10+
include_bytes!("../../aggregation_programs/sp1/elf/sp1_aggregator_program");
1011

1112
pub struct SP1ProofWithPubValuesAndElf {
1213
pub proof_with_pub_values: SP1ProofWithPublicValues,
13-
pub elf: Vec<u8>
14+
pub elf: Vec<u8>,
1415
}
1516

1617
impl SP1ProofWithPubValuesAndElf {
@@ -98,15 +99,23 @@ pub enum AlignedSP1VerificationError {
9899
UnsupportedProof,
99100
}
100101

101-
pub(crate) fn verify(sp1_proof_with_pub_values_and_elf: &SP1ProofWithPubValuesAndElf) -> Result<(), AlignedSP1VerificationError> {
102+
pub(crate) fn verify(
103+
sp1_proof_with_pub_values_and_elf: &SP1ProofWithPubValuesAndElf,
104+
) -> Result<(), AlignedSP1VerificationError> {
102105
let client = ProverClient::from_env();
103106

104107
let (_pk, vk) = client.setup(&sp1_proof_with_pub_values_and_elf.elf);
105108

106109
// only sp1 compressed proofs are supported for aggregation now
107-
match sp1_proof_with_pub_values_and_elf.proof_with_pub_values.proof {
110+
match sp1_proof_with_pub_values_and_elf
111+
.proof_with_pub_values
112+
.proof
113+
{
108114
sp1_sdk::SP1Proof::Compressed(_) => client
109-
.verify(&sp1_proof_with_pub_values_and_elf.proof_with_pub_values, &vk)
115+
.verify(
116+
&sp1_proof_with_pub_values_and_elf.proof_with_pub_values,
117+
&vk,
118+
)
110119
.map_err(AlignedSP1VerificationError::Verification),
111120
_ => Err(AlignedSP1VerificationError::UnsupportedProof),
112121
}

aggregation_mode/src/backend/fetcher.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use super::{
55
types::{AlignedLayerServiceManager, AlignedLayerServiceManagerContract, RPCProvider},
66
};
77
use crate::{
8-
aggregators::{sp1_aggregator::SP1ProofWithPubValuesAndElf, AlignedProof}, backend::s3::get_aligned_batch_from_s3
8+
aggregators::{sp1_aggregator::SP1ProofWithPubValuesAndElf, AlignedProof},
9+
backend::s3::get_aligned_batch_from_s3,
910
};
1011
use aligned_sdk::core::types::ProvingSystemId;
1112
use alloy::{
@@ -88,7 +89,10 @@ impl ProofsFetcher {
8889
ProvingSystemId::SP1 => {
8990
let elf = p.vm_program_code?;
9091
let proof_with_pub_values = bincode::deserialize(&p.proof).ok()?;
91-
let sp1_proof = SP1ProofWithPubValuesAndElf { proof_with_pub_values, elf };
92+
let sp1_proof = SP1ProofWithPubValuesAndElf {
93+
proof_with_pub_values,
94+
elf,
95+
};
9296

9397
Some(AlignedProof::SP1(sp1_proof))
9498
}

aggregation_mode/src/backend/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use crate::aggregators::{
1111
};
1212

1313
use alloy::{
14-
consensus::{BlobTransactionSidecar},
14+
consensus::BlobTransactionSidecar,
1515
eips::eip4844::BYTES_PER_BLOB,
1616
hex,
1717
network::EthereumWallet,
18-
primitives::{Address},
18+
primitives::Address,
1919
providers::{PendingTransactionError, ProviderBuilder},
2020
rpc::types::TransactionReceipt,
2121
signers::local::LocalSigner,

aggregation_mode/src/backend/s3.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub enum GetBatchProofsError {
66
Deserialization,
77
EmptyBody,
88
StatusFailed,
9-
ReqwestClientFailed
9+
ReqwestClientFailed,
1010
}
1111

1212
// needed to make S3 bucket work
@@ -16,11 +16,13 @@ pub async fn get_aligned_batch_from_s3(
1616
url: String,
1717
) -> Result<Vec<VerificationData>, GetBatchProofsError> {
1818
let client = reqwest::Client::builder()
19-
.user_agent(DEFAULT_USER_AGENT)
20-
.build()
21-
.map_err(|_| GetBatchProofsError::ReqwestClientFailed)?;
19+
.user_agent(DEFAULT_USER_AGENT)
20+
.build()
21+
.map_err(|_| GetBatchProofsError::ReqwestClientFailed)?;
2222

23-
let response = client.get(url).send()
23+
let response = client
24+
.get(url)
25+
.send()
2426
.await
2527
.map_err(|_| GetBatchProofsError::Fetching)?;
2628
if !response.status().is_success() {

aggregation_mode/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pub mod backend;
21
pub mod aggregators;
2+
pub mod backend;

0 commit comments

Comments
 (0)