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

Use retention period when fetching blobs #13869

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Use retention period when fetching blobs #13869

merged 1 commit into from
Apr 11, 2024

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Apr 11, 2024

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Blobs endpoint uses data availability period (which is always equal MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS) instead of retention period to determine if it should return early with no blobs.

Which issues(s) does this PR fix?

Fixes #13853

@rkapka rkapka added Ready For Review A pull request ready for code review API Api related tasks labels Apr 11, 2024
@rkapka rkapka requested a review from a team as a code owner April 11, 2024 13:29
@rkapka rkapka added this pull request to the merge queue Apr 11, 2024
Merged via the queue into develop with commit 0d6070e Apr 11, 2024
16 of 17 checks passed
@rkapka rkapka deleted the api-old-blobs branch April 11, 2024 14:12
@@ -299,6 +299,11 @@ func (bs *BlobStorage) Clear() error {
return nil
}

// WithinRetentionPeriod checks if the requested epoch is within the blob retention period.
func (bs *BlobStorage) WithinRetentionPeriod(requested, current primitives.Epoch) bool {
return requested+bs.retentionEpochs >= current
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can overflow if retentionEpochs is a very large value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prysm unable to provide expired blob even when configured to
3 participants