Skip to content

Commit cf9276b

Browse files
fix(l2): committer wake up delay (#5033)
**Motivation** <!-- Why does this pull request exist? What are its goals? --> Committer is not always waking up after `committer_wake_up_ms` but `commit_time_ms` **Description** <!-- A clear and concise general description of the changes this PR introduces --> Change the delay time to wake up again <!-- Link to issues: Resolves #111, Resolves #222 --> --------- Co-authored-by: Tomás Grüner <[email protected]>
1 parent 2e0b6a2 commit cf9276b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

crates/l2/sequencer/l1_committer.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,11 @@ impl GenServer for L1Committer {
812812

813813
// In the event that the current batch in L1 is greater than the one we have recorded we shouldn't send a new batch
814814
if current_last_committed_batch > self.last_committed_batch {
815+
info!(
816+
l1_batch = current_last_committed_batch,
817+
last_batch_registered = self.last_committed_batch,
818+
"Committer was not aware of new L1 committed batches, updating internal state accordingly"
819+
);
815820
self.last_committed_batch = current_last_committed_batch;
816821
self.last_committed_batch_timestamp = current_time;
817822
self.schedule_commit(self.committer_wake_up_ms, handle.clone());
@@ -821,6 +826,14 @@ impl GenServer for L1Committer {
821826
let commit_time: u128 = self.commit_time_ms.into();
822827
let should_send_commitment =
823828
current_time - self.last_committed_batch_timestamp > commit_time;
829+
830+
debug!(
831+
last_committed_batch_at = self.last_committed_batch_timestamp,
832+
will_send_commitment = should_send_commitment,
833+
last_committed_batch = self.last_committed_batch,
834+
"Committer woke up"
835+
);
836+
824837
#[expect(clippy::collapsible_if)]
825838
if should_send_commitment {
826839
if self
@@ -834,7 +847,7 @@ impl GenServer for L1Committer {
834847
}
835848
}
836849
}
837-
self.schedule_commit(self.commit_time_ms, handle.clone());
850+
self.schedule_commit(self.committer_wake_up_ms, handle.clone());
838851
CastResponse::NoReply
839852
}
840853

0 commit comments

Comments
 (0)