Skip to content

Commit 393f9a9

Browse files
committed
refactor: more explicit names in sp1 aggregator program
1 parent b63a928 commit 393f9a9

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

aggregation_mode/aggregation_programs/sp1/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use serde::{Deserialize, Serialize};
22
use sha3::{Digest, Keccak256};
33

44
#[derive(Serialize, Deserialize)]
5-
pub struct SP1ProofInput {
5+
pub struct SP1VkAndPubInputs {
66
pub vk: [u32; 8],
77
pub public_inputs: Vec<u8>,
88
}
99

10-
impl SP1ProofInput {
10+
impl SP1VkAndPubInputs {
1111
pub fn hash(&self) -> [u8; 32] {
1212
let mut hasher = Keccak256::new();
1313
for &word in &self.vk {
@@ -19,20 +19,20 @@ impl SP1ProofInput {
1919
}
2020

2121
#[derive(Serialize, Deserialize)]
22-
pub enum ProofInput {
23-
SP1Compressed(SP1ProofInput),
22+
pub enum ProofDataInput {
23+
SP1Compressed(SP1VkAndPubInputs),
2424
}
2525

26-
impl ProofInput {
26+
impl ProofDataInput {
2727
pub fn hash(&self) -> [u8; 32] {
2828
match self {
29-
ProofInput::SP1Compressed(proof) => proof.hash(),
29+
ProofDataInput::SP1Compressed(proof_data) => proof_data.hash(),
3030
}
3131
}
3232
}
3333

3434
#[derive(Serialize, Deserialize)]
3535
pub struct Input {
36-
pub proofs: Vec<ProofInput>,
36+
pub proofs_data: Vec<ProofDataInput>,
3737
pub merkle_root: [u8; 32],
3838
}

aggregation_mode/src/aggregators/sp1_aggregator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::sync::LazyLock;
22

33
use alloy::primitives::Keccak256;
4-
use sp1_aggregation_program::{ProofInput, SP1ProofInput};
4+
use sp1_aggregation_program::{ProofDataInput, SP1VkAndPubInputs};
55
use sp1_sdk::{
66
EnvProver, HashableKey, Prover, ProverClient, SP1ProofWithPublicValues, SP1Stdin,
77
SP1VerifyingKey,
@@ -45,15 +45,15 @@ pub(crate) fn aggregate_proofs(
4545
let mut stdin = SP1Stdin::new();
4646

4747
let mut program_input = sp1_aggregation_program::Input {
48-
proofs: vec![],
48+
proofs_data: vec![],
4949
merkle_root: input.merkle_root,
5050
};
5151

5252
// write vk + public inputs
5353
for proof in input.proofs.iter() {
5454
program_input
55-
.proofs
56-
.push(ProofInput::SP1Compressed(SP1ProofInput {
55+
.proofs_data
56+
.push(ProofDataInput::SP1Compressed(SP1VkAndPubInputs {
5757
public_inputs: proof.proof_with_pub_values.public_values.to_vec(),
5858
vk: proof.vk().hash_u32(),
5959
}));

0 commit comments

Comments
 (0)