Skip to content

Conversation

@toschoosqd
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a 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_by function with an IndexGet trait abstraction to enable binary search on different collection types
  • Added find_chunk_by_timestamp method 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.

@toschoosqd toschoosqd force-pushed the generic-binary-search branch from c960dbd to 11f1796 Compare December 11, 2025 16:29
kalabukdima and others added 6 commits December 12, 2025 14:08
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
@toschoosqd toschoosqd force-pushed the generic-binary-search branch from 11f1796 to 7b112d2 Compare December 12, 2025 13:07
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