fix(kona): enforce strict frame ordering in ChannelAssembler#20011
Open
sebastianst wants to merge 3 commits intodevelopfrom
Open
fix(kona): enforce strict frame ordering in ChannelAssembler#20011sebastianst wants to merge 3 commits intodevelopfrom
sebastianst wants to merge 3 commits intodevelopfrom
Conversation
Add OrderedChannel, a simplified channel type that enforces strict sequential frame ordering (frame.number must equal inputs.len()). This matches op-node's requireInOrder behavior for Holocene+. The ChannelAssembler now uses OrderedChannel instead of Channel. Since ChannelAssembler is only used post-Holocene, no conditional logic is needed. The existing Channel (which accepts out-of-order frames) remains in ChannelBank for pre-Holocene derivation. OrderedChannel is simpler than Channel: Vec<Frame> instead of HashMap<u16, Frame>, no pruning logic, is_ready() is just a closed check, and frame_data() is a straight iteration. Fixes ethereum-optimism/optimism-private#482 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #20011 +/- ##
===========================================
+ Coverage 74.5% 76.8% +2.2%
===========================================
Files 193 506 +313
Lines 10734 64204 +53470
===========================================
+ Hits 8002 49325 +41323
- Misses 2588 14879 +12291
+ Partials 144 0 -144
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Address review feedback: - Add FrameOutOfOrder variant to existing ChannelError instead of a separate OrderedChannelError enum - Use functional style for frame_data (flat_map + collect) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
OrderedChannel— a simplified channel type that enforces strict sequential frame ordering (frame.number == inputs.len()), matching op-node'srequireInOrderHolocene behaviorChannelAssembler(post-Holocene only) now usesOrderedChannelinstead ofChannelChannel(out-of-order tolerant) stays inChannelBankfor pre-Holocene — independent types, no shared code, clean deprecation pathOrderedChannelis simpler:Vec<Frame>instead ofHashMap, no pruning,is_ready()is justself.closedFixes ethereum-optimism/optimism-private#482
Test plan
OrderedChannel: ordered acceptance, out-of-order rejection, ID mismatch, double close, attack scenario (cross-tx out-of-order frames), single-frame channel, L1 inclusion trackingChannelAssemblertests pass unchangedjust f🤖 Generated with Claude Code
🧠 Note that I choose to create a new
OrderedChanneltype rather than add more logic to the existing channel because we want to deprecate pre-Holocene derivation soon and then we can just throw out the oldChannelwhich allowed unordered frames. The ordered channeladd_frameimplementation is much simpler.