Skip to content

fix: l1 messages cursor#324

Merged
greged93 merged 16 commits intomainfrom
fix/l1-messages-cursor
Sep 19, 2025
Merged

fix: l1 messages cursor#324
greged93 merged 16 commits intomainfrom
fix/l1-messages-cursor

Conversation

@greged93
Copy link
Contributor

Fixes the L1 messages cursor used in the sequencer by updating it on new payload events (blocks sequenced by the sequencer) and on block import events (blocks received from the network). Fixes #285.

Also updates the interface used for the L1 message provider, now exposing two methods take_n_messages_from_index and take_n_messages_from_hash. An approach returning a Stream using the get_l1_messages operation from the DatabaseReadOperations would have been preferred, but was not possible for the reasons laid out in the doc comments.
In summary, we can't implement L1MessageProvider on a DatabaseTransactionProvider, because the stream captures the reference to the Tx. We could have implement L1MessageProvider, but this seems to go against the current pattern of only accessing the database using the Tx and TxMut structures. Fixes #162.

@greged93 greged93 requested a review from frisitano September 17, 2025 19:06
@greged93 greged93 force-pushed the fix/l1-messages-cursor branch from 031e889 to 4255f75 Compare September 17, 2025 19:24
frisitano
frisitano previously approved these changes Sep 18, 2025
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left some optional commnets inline.

Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@greged93 greged93 merged commit fa6ff33 into main Sep 19, 2025
13 checks passed
@greged93 greged93 deleted the fix/l1-messages-cursor branch September 19, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sequencer] Update L1 message cursor after payload has been built [Provider] Improve the L1MessageProvider interface and implementations

2 participants