Skip to content

fix(unixfs): reuse verified chunk metadata within file reads - #74

Merged
BernardLowe merged 1 commit into
mainfrom
codex/reuse-unixfs-chunk-metadata
Oct 11, 2026
Merged

BernardLowe merged 1 commit into
mainfrom
codex/reuse-unixfs-chunk-metadata

Conversation

@BernardLowe

Copy link
Copy Markdown
Contributor

ReadFile and ReadFileRange fetched the same chunk-metadata CAS block in both Stat and range processing. Retain the metadata bytes within each Stat so file reads fetch that metadata once, then revalidate its CID and authenticated count locally before reuse. Selected-root proof verification and content-block verification remain unchanged.

Add request-count regressions for whole-file, single-byte, cross-chunk, empty-range, and past-end reads, plus checks that reused metadata rejects modified bytes, a mismatched count, and an empty body. All five request-count cases failed with two fetches before the fix and pass with one afterward.

Validation:

  • Focused UnixFS regression and tampering tests passed.
  • GOWORK=off go test -p=6 -parallel=6 -timeout=10m ./... passed.
  • GOWORK=off go vet -p=6 ./... passed.
  • Native and Windows go build -p=6 -buildvcs=false ./... passed.
  • Independent review of the final diff reported no actionable findings.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@BernardLowe
BernardLowe merged commit d5a3d6c into main Oct 11, 2026
5 checks passed
@BernardLowe
BernardLowe deleted the codex/reuse-unixfs-chunk-metadata branch October 11, 2026 10:13
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