Skip to content

Commit 03aa5c7

Browse files
committed
fix: l1 watcher log length check
1 parent 655baa7 commit 03aa5c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/watcher/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ where
341341
notifications.push(system_contract_update);
342342
}
343343

344-
if logs.len() != notifications.len() {
344+
// Check that we haven't generated more notifications than logs
345+
// Note: notifications.len() may be less than logs.len() because genesis batch (batch_index=0) is intentionally skipped
346+
if notifications.len() > logs.len() {
345347
return Err(L1WatcherError::Logs(FilterLogError::InvalidNotificationCount(
346348
logs.len(),
347349
notifications.len(),

0 commit comments

Comments
 (0)