Skip to content

Commit

Permalink
Process with multi-thread
Browse files Browse the repository at this point in the history
  • Loading branch information
stompesi committed Jan 31, 2025
1 parent ca36c75 commit 653a68d
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 255 deletions.
13 changes: 0 additions & 13 deletions sequencer/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,10 @@ func (f *finalizer) finalizeWIPBatch(ctx context.Context, closeReason state.Clos

// finalizeWIPBatch closes the current batch and opens a new one, potentially processing forced batches between the batch is closed and the resulting new empty batch
func (f *finalizer) finalizeWIPBatchSbbVersion(ctx context.Context, closeReason state.ClosingReason) {
prevTimestamp := f.wipL2Block.timestamp
prevL1InfoTreeIndex := f.wipL2Block.l1InfoTreeExitRoot.L1InfoTreeIndex

// Close the wip L2 block if it has transactions, otherwise we keep the wip L2 block to store it in the new wip batch
if !f.wipL2Block.isEmpty() {
f.closeWIPL2Block(ctx)
}

err := f.closeAndOpenNewWIPBatch(ctx, closeReason)
if err != nil {
f.Halt(ctx, fmt.Errorf("failed to create new WIP batch, error: %v", err), true)
}

// If we have closed the wipL2Block then we open a new one
if f.wipL2Block == nil {
f.openNewWIPL2Block(ctx, prevTimestamp, &prevL1InfoTreeIndex)
}
}

// closeAndOpenNewWIPBatch closes the current batch and opens a new one, potentially processing forced batches between the batch is closed and the resulting new wip batch
Expand Down
Loading

0 comments on commit 653a68d

Please sign in to comment.