-
Notifications
You must be signed in to change notification settings - Fork 170
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
Check if blobs are expired before returning #695
Conversation
disperser/apiserver/server.go
Outdated
if blobMetadata.Expiry < uint64(time.Now().Unix()) { | ||
s.metrics.HandleNotFoundRpcRequest("RetrieveBlob") | ||
s.metrics.HandleNotFoundRequest("RetrieveBlob") | ||
return nil, api.NewNotFoundError("blob expired") |
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.
should we use the same error message as L723?
Users may be relying on the error message to handle different failure cases
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.
Yeah, I was wondering about this. I'll change it back for now, but we should probably revisit error message stability in the future.
if blobMetadata.Expiry < uint64(time.Now().Unix()) { | ||
s.metrics.HandleNotFoundRpcRequest("RetrieveBlob") | ||
s.metrics.HandleNotFoundRequest("RetrieveBlob") | ||
return nil, api.NewNotFoundError("no metadata found for the given batch header hash and blob index") |
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.
Do you want to say this is expired? Indicating that we have ever handled it.
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.
To support this, a metadata must never get deleted from the metadata store, but we may eventually want to delete expired metadata
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.
NotFound looks like a right error to return here
if blobMetadata.Expiry < uint64(time.Now().Unix()) { | ||
s.metrics.HandleNotFoundRpcRequest("RetrieveBlob") | ||
s.metrics.HandleNotFoundRequest("RetrieveBlob") | ||
return nil, api.NewNotFoundError("no metadata found for the given batch header hash and blob index") |
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.
NotFound looks like a right error to return here
Co-authored-by: Robert Raynor <robert@mrgrey.local>
Why are these changes needed?
Checks