fix: handle partial reads in UnpadReader for non-power-of-2 pieces#13306
Merged
fix: handle partial reads in UnpadReader for non-power-of-2 pieces#13306
Conversation
Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619 Ref: filecoin-project/boost#2020 - Keep PR #12884's buffer overflow fix (clamp to buffer size) - Add graceful handling of io.ErrUnexpectedEOF for partial pieces - Fixes boost EOF errors when reading 7MB deals in 8MB sectors - Add test for partial piece reading edge case
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes partial read handling in UnpadReader for non-power-of-2 piece sizes to resolve boost EOF errors when reading 7MB deals in 8MB sectors.
- Adds graceful handling of
io.ErrUnexpectedEOFto process partial pieces with complete 128-byte chunks - Updates error messages to be more descriptive about read failures
- Adds comprehensive test coverage for the partial piece reading edge case
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| storage/sealer/fr32/readers.go | Enhanced readInner method to handle partial reads and EOF conditions gracefully |
| storage/sealer/fr32/readers_test.go | Added test case for partial piece reading scenario |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
LexLuthr
approved these changes
Sep 4, 2025
77 tasks
BigLep
pushed a commit
that referenced
this pull request
Sep 5, 2025
…13306) Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619 Ref: filecoin-project/boost#2020 - Keep PR #12884's buffer overflow fix (clamp to buffer size) - Add graceful handling of io.ErrUnexpectedEOF for partial pieces - Fixes boost EOF errors when reading 7MB deals in 8MB sectors - Add test for partial piece reading edge case
TippyFlitsUK
pushed a commit
that referenced
this pull request
Sep 5, 2025
…13306) Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619 Ref: filecoin-project/boost#2020 - Keep PR #12884's buffer overflow fix (clamp to buffer size) - Add graceful handling of io.ErrUnexpectedEOF for partial pieces - Fixes boost EOF errors when reading 7MB deals in 8MB sectors - Add test for partial piece reading edge case
This was referenced Sep 5, 2025
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.
Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619
Ref: filecoin-project/boost#2020