ethereum-optimism / ethereum-optimism/optimism

`CursorQueue` abstraction

Open
#12,926 0 comments 0 reactions 0 assignees View on GitHub
A-op-batcher
Dominant language
Go
Stars
6.5k
Forks
4k
Avg merge
2d 15h
Merged PRs (30d)
145

Description

In #12390, the batcher got refactored to work with cursors on queues of blocks, channels and frames. Since the cursor and queue are manipulated together and consistent state between the two should be maintained, we could add a `CursorQueue` abstract to keep the consistency by design.

_Originally posted by @sebastianst in https://github.com/ethereum-optimism/optimism/pull/12390#discussion_r1832546236_

> We may consider adding a `CursorQueue` abstraction that is a `Queue` with a cursor and then use it for blocks and frames. This way, we can better unit test the invariants between the queue and cursor.

Contributor guide

Open the contributing guide

Research direction

Start by reading the batcher refactor in #12390, focusing on how cursors and queues are manipulated for blocks, channels, and frames. Identify the shared invariants, then assess how a CursorQueue abstraction could support unit tests for queue-cursor consistency and be used for blocks and frames.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.