Skip to content

Commit f724254

Browse files
committed
prover
1 parent 34108d3 commit f724254

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

prover/bin/shadow-prove/src/main.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ async fn main() {
7676
l1_signer,
7777
);
7878

79+
// Track the latest processed batch index
80+
let mut latest_processed_batch: u64 = 0;
81+
7982
loop {
8083
sleep(Duration::from_secs(30)).await;
8184
// Get committed batch
@@ -88,9 +91,18 @@ async fn main() {
8891
}
8992
};
9093

94+
// Check if batch has already been processed
95+
if batch_info.batch_index <= latest_processed_batch {
96+
log::info!("Batch {} has already been processed, skipping", batch_info.batch_index);
97+
continue;
98+
}
99+
91100
// Execute batch
92101
match execute_batch(&batch_info).await {
93-
Ok(_) => (),
102+
Ok(_) => {
103+
// Update the latest processed batch index
104+
latest_processed_batch = batch_info.batch_index;
105+
},
94106
Err(e) => {
95107
log::error!("execute_batch error: {:?}", e);
96108
continue

0 commit comments

Comments
 (0)