feat(optimism): keep flashblocks in ordered sequence for pending block#18183
Closed
julio4 wants to merge 3 commits intoparadigmxyz:mainfrom
Closed
feat(optimism): keep flashblocks in ordered sequence for pending block#18183julio4 wants to merge 3 commits intoparadigmxyz:mainfrom
julio4 wants to merge 3 commits intoparadigmxyz:mainfrom
Conversation
a051153 to
07b4c14
Compare
07b4c14 to
30dbd8b
Compare
mattsse
requested changes
Sep 1, 2025
Collaborator
mattsse
left a comment
There was a problem hiding this comment.
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
This was referenced Sep 1, 2025
julio4
commented
Sep 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
FlashblockSequenceis a simple wrapper over an ordered B-tree to keep all flashblocks, with aiter_ready()iterator implementation to easily iterate over the ready part of the sequence (where all fbs are successive from index 0).