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.
L-02 Inadequate Handling of Single Large Data Frames in blobTxCandidates
In the blobTxCandidates function, the code assumes that data exceeding the size limit (se.MaxBlobDataSize * MaxblobNum) results from the aggregation of multiple frames. However, it does not account for the possibility that a single frame (frameData) could individually exceed the maximum size. When this occurs, the function appends the oversized frame to dataInTx and proceeds without any special handling, which may lead to unintended behavior during blob creation.
If a single frame exceeds the maximum blob size, the function does not split it into smaller chunks or handle the error explicitly. This can result in the generation of transaction candidates with empty blobs or transaction candidates with an amount of blobs which exceeds the configured amount of maximum blobs (MaxblobNum), which is currently set to 4.
We recommend to introduce explicit handling for single frames that exceed the maximum size. Before appending a frame to dataInTx, check whether the frame itself exceeds the size limit. If it does, log an error and return an appropriate error message. Alternatively, implement logic to split oversized frames into smaller chunks before proceeding. Another solution could be to ensure a single frame will always fit in a single blob transaction by enforcing the configured MaxFrameSize is smaller than the maximum size (se.MaxBlobDataSize * MaxblobNum). Adding this check will ensure robust handling of all edge cases.