Skip to content

Commit 3d0b03f

Browse files
authored
fix: l1 watcher log length check (#429)
* fix: l1 watcher log length check * fix: fmt
1 parent 655baa7 commit 3d0b03f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/watcher/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ 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
346+
// (batch_index=0) is intentionally skipped
347+
if notifications.len() > logs.len() {
345348
return Err(L1WatcherError::Logs(FilterLogError::InvalidNotificationCount(
346349
logs.len(),
347350
notifications.len(),

0 commit comments

Comments
 (0)