Commit 568f0805 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #5182 from ethereum-optimism/aj/channel-pruning

specs: Update spec channel handling to match the current implementation
parents 00b799bc c68e365a
...@@ -517,12 +517,14 @@ New frames for timed-out channels are dropped instead of buffered. ...@@ -517,12 +517,14 @@ New frames for timed-out channels are dropped instead of buffered.
The channel-bank can only output data from the first opened channel. The channel-bank can only output data from the first opened channel.
Upon reading, first all timed-out channels are dropped. Upon reading, while the first opened channel is timed-out, remove it from the channel-bank.
After pruning timed-out channels, the first remaining channel, if any, is read if it is ready: Once the first opened channel, if any, is not timed-out and is ready, then it is read and removed from the channel-bank.
- The channel must be closed A channel is ready if:
- The channel must have a contiguous sequence of frames until the closing frame
- The channel is closed
- The channel has a contiguous sequence of frames until the closing frame
If no channel is ready, the next frame is read and ingested into the channel bank. If no channel is ready, the next frame is read and ingested into the channel bank.
...@@ -533,12 +535,16 @@ a new channel is opened, tagged with the current L1 block, and appended to the c ...@@ -533,12 +535,16 @@ a new channel is opened, tagged with the current L1 block, and appended to the c
Frame insertion conditions: Frame insertion conditions:
- New frames matching existing timed-out channels are dropped. - New frames matching timed-out channels that have not yet been pruned from the channel-bank are dropped.
- Duplicate frames (by frame number) are dropped. - Duplicate frames (by frame number) for frames that have not yet been pruned from the channel-bank are dropped.
- Duplicate closes (new frame `is_last == 1`, but the channel has already seen a closing frame) are dropped. - Duplicate closes (new frame `is_last == 1`, but the channel has already seen a closing frame and has not yet been
pruned from the channel-bank) are dropped.
If a frame is closing (`is_last == 1`) any existing higher-numbered frames are removed from the channel. If a frame is closing (`is_last == 1`) any existing higher-numbered frames are removed from the channel.
Note that while this allows channel IDs to be reused once they have been pruned from the channel-bank, it is recommended
that batcher implementations use unique channel IDs.
### Channel Reader (Batch Decoding) ### Channel Reader (Batch Decoding)
In this stage, we decompress the channel we pull from the last stage, and then parse In this stage, we decompress the channel we pull from the last stage, and then parse
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment