Take chunk ids as DataChunk in the assignment builders - #227
Merged
Merged
Conversation
The assignment builders now take a `DataChunk` instead of a string, so a caller that already holds the parts no longer formats an id only for the builder to parse it back. `DataChunk` stores its hash as a NUL-padded `[u8; 8]`, becomes `Copy`, and enforces the 5-to-8 word-character rule the split builders applied. `new` returns `Option` instead of panicking, and `last_hash()` is added. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignment builders now accept
DataChunk, avoiding repeated string parsing. The type lives in the dependency-freesqd-data-chunkcrate and is re-exported by assignments and messages; neither depends on the other.Wire formats are unchanged. Breaking Rust API changes require scheduler updates: builder IDs are typed, and
DataChunk::newtakes&strand returnsOptionwith stricter validation.Validated with 92 workspace tests, Clippy, formatting, and all assignments feature combinations. Mainnet conversion verified 6.36 million chunks before the unchanged implementation was extracted into the shared crate.