New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be separate tests / table tests.
fix(op-batcher): Fix PR #5186 Nits
Description
Fixes CLI-3648
Context
If the
MaxFrameSize
is configured to be greater than 0 and less than 23, unexpected behavior will occur where the channel builder will call it's channel outOutputFrame
function, passing in theMaxFrameSize
as the max frame size. Inside the channel outOutputFrame
function 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
. TheOutputFrame
function will then return an unexpected, extremely large frame.Solution
This pr validates that the configured
MaxFrameSize
is not less than 23, erroring with aErrSmallMaxFrameSize
.Additional Info
Another PR will properly fix the channel out
OutputFrame
function to error onmaxSize
underflow as tracked in CLI-3649