Skip to content

Commit

Permalink
remove buffer variable
Browse files Browse the repository at this point in the history
  • Loading branch information
geoknee committed Nov 18, 2024
1 parent 380003f commit 055e96e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions op-batcher/batcher/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,22 +596,11 @@ func (l *BatchSubmitter) waitNodeSyncAndClearState() {
// safe head progress given fully submitted channels held in
// state.
func (l *BatchSubmitter) checkExpectedProgress(syncStatus eth.SyncStatus) error {

// Define a buffer: a delay denominated in L1 blocks
// to allow verifier to process blocks.
// Set to 0 to require immediate safe head advancement.
// Set to 1 to allow e.g. 12s for the safe head to advance
// after the L1 inclusion block was ingested.
// TODO extract this into a config variable
// TODO should we also wait numConfirmations (this is a txmgr config variable, not in scope of the batch submitter)

BUFFER := uint64(1)

verifierCurrentL1 := syncStatus.CurrentL1
for _, ch := range l.state.channelQueue {
if ch.isFullySubmitted() && // This implies a number of l1 confirmations has passed, depending on how the txmgr was configured
!ch.isTimedOut() &&
verifierCurrentL1.Number > ch.maxInclusionBlock+BUFFER &&
verifierCurrentL1.Number > ch.maxInclusionBlock &&
syncStatus.SafeL2.Number < ch.LatestL2().Number {
return errors.New("safe head did not make expected progress")
}
Expand Down

0 comments on commit 055e96e

Please sign in to comment.