Skip to content

Commit

Permalink
add replay verify workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
areshand committed Nov 28, 2024
1 parent de9040d commit 0e212a7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions storage/db-tool/src/replay_on_archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ impl Verifier {
let mut expected_txn_infos = Vec::new();
let mut chunk_start_version = start;
for (idx, item) in txn_iter.enumerate() {
// timeout check
if let Some(duration) = self.timeout_secs {
if self.replay_stat.get_elapsed_secs() >= duration {
return Ok(total_failed_txns);
}
}

let (input_txn, expected_txn_info, expected_event, expected_writeset) = item?;
let is_epoch_ending = expected_event.iter().any(ContractEvent::is_new_epoch_event);
cur_txns.push(input_txn);
Expand All @@ -227,12 +234,6 @@ impl Verifier {
self.replay_stat.update_cnt(cur_txns.len() as u64);
self.replay_stat.print_tps();

if let Some(duration) = self.timeout_secs {
if self.replay_stat.get_elapsed_secs() >= duration {
return Ok(total_failed_txns);
}
}

// empty for the new chunk
chunk_start_version = start + (idx as u64) + 1;
cur_txns.clear();
Expand Down

0 comments on commit 0e212a7

Please sign in to comment.