Skip to content

feat(optimism): keep flashblocks in ordered sequence for pending block#18183

Closed
julio4 wants to merge 3 commits intoparadigmxyz:mainfrom
julio4:feat/flashblock-sequence
Closed

feat(optimism): keep flashblocks in ordered sequence for pending block#18183
julio4 wants to merge 3 commits intoparadigmxyz:mainfrom
julio4:feat/flashblock-sequence

Conversation

@julio4
Copy link
Contributor

@julio4 julio4 commented Sep 1, 2025

Close #18182
Relevant #17858

When we receive a flashblock for the current pending block, we store it in a FlashblockSequence.
If there's a gap in the sequence, we still keep all 'pending' received flashblocks instead of discarding them.
FlashblockSequence is a simple wrapper over an ordered B-tree to keep all flashblocks, with a iter_ready() iterator implementation to easily iterate over the ready part of the sequence (where all fbs are successive from index 0).

@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Sep 1, 2025
@julio4 julio4 force-pushed the feat/flashblock-sequence branch 2 times, most recently from a051153 to 07b4c14 Compare September 1, 2025 08:42
@julio4 julio4 force-pushed the feat/flashblock-sequence branch from 07b4c14 to 30dbd8b Compare September 1, 2025 08:48
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this makes sense,

however if we expect that they can arrive out of order then this doesnt hold for the first block, which currently resets the sequence,
this also then doesnt cover the case where we receive two different flashblocks for different blocks, so we probably should track the actual parent block as well somehow

however all of this would only be the case if the remote sends us the blocks out of order

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Sep 1, 2025
@mattsse mattsse added the A-op-reth Related to Optimism and op-reth label Sep 1, 2025
@mattsse mattsse self-assigned this Sep 1, 2025
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

thanks for this @julio4

I merged this into #18194 which now supersedes this pr
30dbd8b

@mattsse mattsse closed this Sep 1, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Sep 1, 2025
@jenpaff jenpaff moved this from Done to Out of Scope in Reth Tracker Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-op-reth Related to Optimism and op-reth

Projects

Status: Out of Scope

Development

Successfully merging this pull request may close these issues.

Do not ignore flashblocks not received in sequence within a pending block

2 participants