Skip to content
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

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

mooselumph
Copy link
Collaborator

Why are these changes needed?

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

if blobMetadata.Expiry < uint64(time.Now().Unix()) {
s.metrics.HandleNotFoundRpcRequest("RetrieveBlob")
s.metrics.HandleNotFoundRequest("RetrieveBlob")
return nil, api.NewNotFoundError("blob expired")
Copy link
Contributor

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

Copy link
Collaborator Author

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")
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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")
Copy link
Contributor

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

@mooselumph mooselumph merged commit f2d2d9c into Layr-Labs:master Aug 12, 2024
6 checks passed
jianoaix pushed a commit that referenced this pull request Aug 12, 2024
Co-authored-by: Robert Raynor <robert@mrgrey.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants