Skip to content

Commit 73b24d1

Browse files
committed
refactor: ProofData name
1 parent 3874e1b commit 73b24d1

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

batcher/aligned-sdk/src/sdk/aggregation.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ use sha3::{Digest, Keccak256};
1313
const FROM_BLOCKS_AGO_DEFAULT: u64 = 7500;
1414

1515
#[derive(Debug)]
16-
pub enum ProofData {
16+
pub enum AggregationModeVerificationData {
1717
SP1 {
1818
vk: [u8; 32],
1919
public_inputs: Vec<u8>,
2020
},
2121
}
2222

23-
impl ProofData {
23+
impl AggregationModeVerificationData {
2424
fn commitment(&self) -> [u8; 32] {
2525
match self {
26-
ProofData::SP1 { vk, public_inputs } => {
26+
AggregationModeVerificationData::SP1 { vk, public_inputs } => {
2727
let mut hasher = Keccak256::new();
2828
hasher.update(vk);
2929
hasher.update(public_inputs);
@@ -43,11 +43,11 @@ pub enum ProofVerificationAggModeError {
4343
EventDecoding,
4444
}
4545

46-
/// Given the [`ProofData`], this function checks whether a proof was included
47-
/// in the most recent aggregated proof and verifies the corresponding Merkle root commitment.
46+
/// Given the [`AggregationModeVerificationData`], this function checks whether the proof was included in a
47+
/// in a recent aggregated proof and verifies the corresponding Merkle root commitment.
4848
///
4949
/// Note: This functionality is currently in Beta. As a result, we cannot determine with certainty
50-
/// which specific aggregation a proof belongs to. Instead, we optimistically check the from the specified `from_block`.
50+
/// which specific aggregation a proof belongs to. Instead, we check the events from the specified `from_block`.
5151
///
5252
/// Note: The `from_block` must not be older than 18 days,
5353
/// as blobs expire after that period and will no longer be retrievable.
@@ -62,7 +62,7 @@ pub enum ProofVerificationAggModeError {
6262
/// 6. Checking if the given proof commitment exists within the blob’s proofs
6363
/// 7. Reconstructing the Merkle root and verifying it against the root stored in the contract
6464
pub async fn is_proof_verified_in_aggregation_mode(
65-
proof_data: ProofData,
65+
verification_data: AggregationModeVerificationData,
6666
network: Network,
6767
eth_rpc_url: String,
6868
beacon_client_url: String,
@@ -140,7 +140,7 @@ pub async fn is_proof_verified_in_aggregation_mode(
140140
hex::decode(blob_data.blob.replace("0x", "")).expect("A valid hex encoded data");
141141
let proof_commitments = decoded_blob(blob_bytes);
142142

143-
if proof_commitments.contains(&proof_data.commitment()) {
143+
if proof_commitments.contains(&verification_data.commitment()) {
144144
if verify_blob_merkle_root(proof_commitments, merkle_root) {
145145
return Ok(merkle_root);
146146
} else {

batcher/aligned/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use aligned_sdk::core::{
1212
types::{AlignedVerificationData, Network, ProvingSystemId, VerificationData},
1313
};
1414
use aligned_sdk::sdk::aggregation::is_proof_verified_in_aggregation_mode;
15-
use aligned_sdk::sdk::aggregation::ProofData;
15+
use aligned_sdk::sdk::aggregation::AggregationModeVerificationData;
1616
use aligned_sdk::sdk::estimate_fee;
1717
use aligned_sdk::sdk::get_chain_id;
1818
use aligned_sdk::sdk::get_nonce_from_batcher;
@@ -779,7 +779,7 @@ async fn main() -> Result<(), AlignedError> {
779779
};
780780
let public_inputs = read_file(pub_inputs_file_name)?;
781781

782-
ProofData::SP1 { vk, public_inputs }
782+
AggregationModeVerificationData::SP1 { vk, public_inputs }
783783
}
784784
_ => {
785785
error!("Proving system not supported in aggregation mode");

0 commit comments

Comments
 (0)