-
Notifications
You must be signed in to change notification settings - Fork 224
fix(proxy)!: MaxBlobSizeBytes
processing
#1762
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(proxy)!: MaxBlobSizeBytes
processing
#1762
Conversation
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.
Pull Request Overview
This PR refines blob size validation and limits supported byte units in configuration parsing.
- Refactors the max-blob-size check to use a named
encodedBloblen
variable and corrects the error log to report the post‐encoding length. - Removes support for gigabyte and terabyte units (
gb
,gib
,tb
,tib
) inParseBytesAmount
, now only allowing KB, MB, MiB.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
api/proxy/store/generated_key/eigenda/eigenda.go | Introduces encodedBloblen and updates the oversized-blob error message |
api/proxy/common/common.go | Deletes GB/TB unit cases in ParseBytesAmount , defaulting unsupported units |
Comments suppressed due to low confidence (3)
api/proxy/common/common.go:67
- Consider updating this error message to list the supported units (e.g.,
kb
,mb
,mib
) and update any related docs or examples to reflect the removal of GB/TB units.
return 0, fmt.Errorf("unsupported unit: %s", unit)
api/proxy/common/common.go:63
- Add or update unit tests for
ParseBytesAmount
to cover the supported units (kb
,mb
,mib
) and ensure it returns errors for removed units likegib
ortb
.
return uint64(num * 1024 * 1024), nil
api/proxy/store/generated_key/eigenda/eigenda.go:116
- [nitpick] Either remove or implement this TODO by relocating the blob length validation into
PutBlob
to improve cohesion and reduce duplication.
// TODO: We should move this length check inside PutBlob
MaxBlobSizeBytes
processing
api/proxy/common/common.go
Outdated
@@ -63,14 +63,6 @@ func ParseBytesAmount(s string) (uint64, error) { | |||
return uint64(num * 1024 * 1024), nil | |||
case "mb": | |||
return uint64(num * 1000 * 1000), nil // Decimal megabyte |
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.
I think we should just remove the base 10 versions of these units... they just don't have a place in our system.
Practically, it would be too easy for someone to use MB
and mean binary, but get decimal.
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.
+1
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.
MaxBlobSizeBytes
processingMaxBlobSizeBytes
processing
MaxBlobSizeBytes
processingMaxBlobSizeBytes
processing
…an--fix-proxy-max-size-processing
Why are these changes needed?
Checks