fix(op-batcher): MaxFrameSize Validation#5186
Conversation
|
✅ Deploy Preview for opstack-docs canceled.
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #5186 +/- ##
===========================================
- Coverage 41.93% 41.91% -0.02%
===========================================
Files 354 354
Lines 21961 21964 +3
Branches 776 776
===========================================
- Hits 9210 9207 -3
- Misses 12051 12056 +5
- Partials 700 701 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
This PR has been added to the merge queue, and will be merged soon. |
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
|
|
||
| // Set the config to have a max frame size less than 23. | ||
| validChannelConfig.MaxFrameSize = 22 | ||
| require.ErrorIs(t, validChannelConfig.Check(), ErrSmallMaxFrameSize) |
There was a problem hiding this comment.
These should be separate tests / table tests.
fix(op-batcher): Fix PR #5186 Nits
Description
Fixes CLI-3648
Context
If the
MaxFrameSizeis configured to be greater than 0 and less than 23, unexpected behavior will occur where the channel builder will call it's channel outOutputFramefunction, passing in theMaxFrameSizeas the max frame size. Inside the channel outOutputFramefunction though, a frame overhead of 23 is subtracted from the passed in max size. If this is less than 23, this operation will underflow, causing the frame to be filled to a nearly unboundeduint64. TheOutputFramefunction will then return an unexpected, extremely large frame.Solution
This pr validates that the configured
MaxFrameSizeis not less than 23, erroring with aErrSmallMaxFrameSize.Additional Info
Another PR will properly fix the channel out
OutputFramefunction to error onmaxSizeunderflow as tracked in CLI-3649