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

Support backward iteration for blob feed #1314

Merged
merged 5 commits into from
Feb 25, 2025

Conversation

jianoaix
Copy link
Contributor

@jianoaix jianoaix commented Feb 22, 2025

Why are these changes needed?

This actually adds support for backward blob feed API (the API added in #1286).

This will make it simple and deterministic to support use cases that need to retrieve blobs backward along the timeline.

Checks

  • 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.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@@ -354,7 +354,7 @@ func (s *BlobMetadataStore) queryBucketBlobMetadata(
}

// GetBlobMetadataByRequestedAtForward returns blobs (as BlobMetadata) in cursor range
// (after, until] (after exclusive, until inclusive). Blobs are ordered by <RequestedAt, BlobKey>
// (after, until) (both exclusive). Blobs are ordered by <RequestedAt, BlobKey>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making both ends exclusive, because:

  • it's easier for the feed API implementation
  • this is at nanosecond level (the highest resolution), so inclusive use cases can just make a [L-1, R+1] adjustment which will work correctly (at nanosecond, there is no time points between L-1 and L)

@jianoaix jianoaix merged commit d176c37 into Layr-Labs:master Feb 25, 2025
10 checks passed
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.

2 participants