Skip to content

Commit 2b04394

Browse files
committed
persist max_operator_id_seen
1 parent 629e020 commit 2b04394

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

anchor/eth/src/event_processor.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ impl EventProcessor {
7979
.transaction()
8080
.map_err(|e| ExecutionError::Database(e.to_string()))?;
8181

82-
let mut operator_added = false;
83-
8482
for (index, log) in logs.iter().enumerate() {
8583
trace!(log_index = index, topic = ?log.topic0(), "Processing individual log");
8684

@@ -95,10 +93,7 @@ impl EventProcessor {
9593

9694
// Process log based on signature hash
9795
let result = match *topic0 {
98-
SSVContract::OperatorAdded::SIGNATURE_HASH => {
99-
operator_added = true;
100-
self.process_operator_added(log, &tx)
101-
}
96+
SSVContract::OperatorAdded::SIGNATURE_HASH => self.process_operator_added(log, &tx),
10297

10398
SSVContract::OperatorRemoved::SIGNATURE_HASH => {
10499
self.process_operator_removed(log, &tx)
@@ -148,10 +143,6 @@ impl EventProcessor {
148143
}
149144
}
150145

151-
if !live && !operator_added {
152-
warn!("No OperatorAdded events found in historical sync, there is likely a sync error");
153-
}
154-
155146
metrics::stop_timer(timer);
156147
self.db
157148
.processed_block(end_block, &tx)

anchor/eth/src/sync.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,17 @@ impl SsvEventSyncer {
510510
start_block = end_block + 1;
511511
}
512512
info!("Historical sync completed");
513+
514+
if self
515+
.event_processor
516+
.db
517+
.state()
518+
.get_all_operators()
519+
.is_empty()
520+
{
521+
warn!("No OperatorAdded events found in historical sync, there is likely a sync error");
522+
}
523+
513524
Ok(())
514525
}
515526

0 commit comments

Comments
 (0)