-
Notifications
You must be signed in to change notification settings - Fork 3
Generic binary search #186
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
base: batch_log_fork
Are you sure you want to change the base?
Conversation
Move the rest to crates/assignments
It should still be filled to parse correctly
Make dial_sender unbounded in stream behaviour
This library is imported in a different way in libp2p causing conflicts
Send random noise to anyone who opens the stream
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 refactors the binary search implementation into a generic function and adds timestamp-based chunk lookup functionality.
- Introduced a generic
binary_search_byfunction with anIndexGettrait abstraction to enable binary search on different collection types - Added
find_chunk_by_timestampmethod to locate chunks by their last block timestamp - Updated test data and added comprehensive test coverage for the new timestamp-based search functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/assignments/src/reader.rs |
Refactored inline binary search into generic binary_search_by function; added IndexGet trait and Chunks wrapper; implemented find_chunk_by_timestamp method; added comprehensive unit tests |
crates/assignments/tests/test_reading.rs |
Added test cases for find_chunk_by_timestamp covering error conditions and various timestamp queries |
crates/assignments/tests/test_building.rs |
Updated test data to include last_block_timestamp for chunk2 |
crates/assignments/tests/assignment.fb |
Binary test data file updated to reflect schema changes (Git LFS pointer) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c960dbd to
11f1796
Compare
Move the rest to crates/assignments
Make dial_sender unbounded in stream behaviour
This library is imported in a different way in libp2p causing conflicts
Make dial_sender unbounded in stream behaviour
This library is imported in a different way in libp2p causing conflicts
11f1796 to
7b112d2
Compare
No description provided.