Skip to content

Commit

Permalink
l2geth: no longer sync batches as sequencer
Browse files Browse the repository at this point in the history
Previously the sequencer would call the `syncBatchesToTip` method
as part of its `sequence()` loop. This commit removes that as the
call to `syncBatchesToTip` does nothing for the sequencer currently.
Syncing the batches would be useful for triggering reorgs, but
that functionality does not currently exist. It would be better to
remove this functionality for now as it could potentially interfere
with the locking mechanism introduced in
dfaa8fc.

This will also reduce the amount of time the `txLock` is held, meaning
that less transactions sent via RPC will be blocked and held in memory
while waiting to execute.
  • Loading branch information
tynes authored and smartcontracts committed Oct 1, 2021
1 parent ce487db commit ed750d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-cheetahs-help.md
@@ -0,0 +1,5 @@
---
'@eth-optimism/l2geth': patch
---

Remove calls to `syncBatchesToTip` in the main `sequence()` loop
6 changes: 2 additions & 4 deletions l2geth/rollup/sync_service.go
Expand Up @@ -412,14 +412,12 @@ func (s *SyncService) SequencerLoop() {
// compare against the transactions it has in its local state. The sequencer
// should reorg based on the transaction batches that are posted because
// L1 is the source of truth. The sequencer concurrently accepts user
// transactions via the RPC.
// transactions via the RPC. When reorg logic is enabled, this should
// also call `syncBatchesToTip`
func (s *SyncService) sequence() error {
if err := s.syncQueueToTip(); err != nil {
return fmt.Errorf("Sequencer cannot sequence queue: %w", err)
}
if err := s.syncBatchesToTip(); err != nil {
return fmt.Errorf("Sequencer cannot sync transaction batches: %w", err)
}
return nil
}

Expand Down

0 comments on commit ed750d8

Please sign in to comment.