Skip to content

Commit 4645f14

Browse files
committed
fix: skip when no proofs in queue
1 parent bcab0d1 commit 4645f14

File tree

1 file changed

+12
-1
lines changed
  • aggregation-mode/src/backend

1 file changed

+12
-1
lines changed

aggregation-mode/src/backend/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use alloy::{
99
};
1010
use merkle_tree::compute_proofs_merkle_root;
1111
use sp1_sdk::HashableKey;
12-
use tracing::{error, info};
12+
use tracing::{error, info, warn};
1313
use types::{AlignedProofAggregationService, AlignedProofAggregationServiceContract};
1414

1515
use crate::zk::{
@@ -101,12 +101,21 @@ impl ProofAggregator {
101101

102102
self.proofs_queue.push(proof);
103103

104+
info!(
105+
"New proof added to queue, current length {}",
106+
self.proofs_queue.len()
107+
);
104108
Ok(())
105109
}
106110

107111
async fn aggregate_and_submit_proofs_on_chain(
108112
&mut self,
109113
) -> Result<(), AggregatedProofSubmissionError> {
114+
if self.proofs_queue.len() == 0 {
115+
warn!("No proofs in queue, skipping iteration...");
116+
return Ok(());
117+
}
118+
110119
let proofs = self
111120
.proofs_queue
112121
.drain(0..self.proofs_queue.len())
@@ -169,12 +178,14 @@ impl ProofAggregator {
169178
}
170179
}
171180

181+
// TODO
172182
async fn send_blob_transaction(
173183
&self,
174184
leaves: Vec<[u8; 32]>,
175185
) -> Result<[u8; 32], AggregatedProofSubmissionError> {
176186
Ok([0u8; 32])
177187
}
178188

189+
// TODO
179190
async fn set_aggregated_proof_as_missed(&self) {}
180191
}

0 commit comments

Comments
 (0)