Skip to content

repoobj: remove xxh64 checksums from blob header#9677

Merged
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
mr-raj12:pack-files-step1-remove-xxh64
May 30, 2026
Merged

repoobj: remove xxh64 checksums from blob header#9677
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
mr-raj12:pack-files-step1-remove-xxh64

Conversation

@mr-raj12
Copy link
Copy Markdown
Contributor

Description

The RepoObj blob header previously had two xxh64 checksums (meta and data). check_object() used them to detect byte-level corruption server-side without needing the borg key.

With SHA-256-named pack files, the server verifies a whole pack via its filename hash. Client-side AEAD decryption catches byte corruption too. The xxh64 checks are redundant given either of those.

Header shrinks from 24 bytes (<II8s8s) to 8 bytes (<II) per object.

Changes:

  • repoobj.py: drop xxhash import, remove meta_hash/data_hash from struct and namedtuple, simplify format().
  • repository.py: drop xxhash import, remove the two hash-check branches from check_object(). Size/truncation checks remain.
  • check_cmd_test.py: test_verify_data no longer needs the fake_xxh64 workaround. test_corrupted_file_chunk now expects --repository-only to pass and --verify-data to catch corruption.
  • repository_test.py, legacyrepository_test.py: drop xxhash import, update fchunk() to pack only sizes.

refs #8572

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues

SHA-256-named pack files make per-blob xxh64 verification redundant.
AEAD decryption already catches corruption on the client side.
Header shrinks from 24 to 8 bytes per object.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.87%. Comparing base (b7c8417) to head (7f43779).
⚠️ Report is 13 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9677      +/-   ##
==========================================
- Coverage   83.99%   83.87%   -0.12%     
==========================================
  Files          93       93              
  Lines       15592    15586       -6     
  Branches     2337     2335       -2     
==========================================
- Hits        13096    13073      -23     
- Misses       1771     1785      +14     
- Partials      725      728       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/borg/testsuite/archiver/check_cmd_test.py Outdated
Comment thread src/borg/testsuite/legacyrepository_test.py
Copy link
Copy Markdown
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

LGTM.

@ThomasWaldmann ThomasWaldmann merged commit 910f223 into borgbackup:master May 30, 2026
19 of 20 checks passed
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