Skip to content

Commit 4387da8

Browse files
committed
Merge branch 'refs/heads/staging' into feat/full-example-and-docs-for-agg-mod
# Conflicts: # batcher/aligned-sdk/src/aggregation_layer/helpers.rs # batcher/aligned-sdk/src/aggregation_layer/mod.rs
2 parents 19620cb + 124eba8 commit 4387da8

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ start_proof_aggregator_gpu: is_aggregator_set reset_last_aggregated_block ## Sta
190190
start_proof_aggregator_gpu_ethereum_package: is_aggregator_set reset_last_aggregated_block ## Starts proof aggregator with proving activated in ethereum package
191191
AGGREGATOR=$(AGGREGATOR) SP1_PROVER=cuda cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove,gpu --bin proof_aggregator -- config-files/config-proof-aggregator-ethereum-package.yaml
192192

193-
194193
verify_aggregated_proof_sp1_holesky_stage:
195194
@echo "Verifying SP1 in aggregated proofs on holesky..."
196195
@cd batcher/aligned/ && \
@@ -221,6 +220,7 @@ install_aggregation_mode: ## Install the aggregation mode with proving enabled
221220
agg_mode_write_program_ids: ## Write proof aggregator zkvm programs ids
222221
@cd aggregation_mode && \
223222
cargo run --release --bin write_program_image_id_vk_hash
223+
224224

225225
_AGGREGATOR_:
226226

batcher/aligned-sdk/src/aggregation_layer/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ pub async fn get_blob_data_from_verified_proof_event(
106106

107107
let blob_bytes =
108108
hex::decode(blob_data.blob.replace("0x", "")).expect("A valid hex encoded data");
109-
let proof_commitments = decoded_blob(blob_bytes);
109+
let proof_commitments = decoded_blob(&blob_bytes);
110110

111111
Ok((merkle_root, proof_commitments))
112112
}
113113

114-
fn decoded_blob(blob_data: Vec<u8>) -> Vec<[u8; 32]> {
114+
fn decoded_blob(blob_data: &[u8]) -> Vec<[u8; 32]> {
115115
let mut proof_hashes = vec![];
116116

117117
let mut current_hash = [0u8; 32];

batcher/aligned-sdk/src/aggregation_layer/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum ProofStatus {
2525
NotFound,
2626
}
2727

28-
/// Given the [`AggregationModeVerificationData`], this function checks whether the proof was included in a
28+
/// Given the [`AggregationModeVerificationData`], this function checks whether the proof was included
2929
/// in a recent aggregated proof and verifies the corresponding Merkle root commitment.
3030
///
3131
/// ### Notes
@@ -63,13 +63,15 @@ pub async fn check_proof_verification(
6363
.await?;
6464

6565
let leaves: Vec<Hash32> = leaves.iter().map(|leaf| Hash32(*leaf)).collect();
66-
let Some(merkle_tree) = MerkleTree::<Hash32>::build(&leaves) else {
66+
67+
let Some(pos) = leaves.iter().position(|p| p.0 == proof_commitment) else {
6768
continue;
6869
};
6970

70-
let Some(pos) = leaves.iter().position(|p| p.0 == proof_commitment) else {
71+
let Some(merkle_tree) = MerkleTree::<Hash32>::build(&leaves) else {
7172
continue;
7273
};
74+
7375
let Some(proof) = merkle_tree.get_proof_by_pos(pos) else {
7476
continue;
7577
};

0 commit comments

Comments
 (0)