repoobj: remove xxh64 checksums from blob header#9677
Merged
ThomasWaldmann merged 2 commits intoMay 30, 2026
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. |
ThomasWaldmann
requested changes
May 30, 2026
…ted_file_chunk, refs borgbackup#8572
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.
Description
The
RepoObjblob 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: dropxxhashimport, removemeta_hash/data_hashfrom struct and namedtuple, simplifyformat().repository.py: dropxxhashimport, remove the two hash-check branches fromcheck_object(). Size/truncation checks remain.check_cmd_test.py:test_verify_datano longer needs thefake_xxh64workaround.test_corrupted_file_chunknow expects--repository-onlyto pass and--verify-datato catch corruption.repository_test.py,legacyrepository_test.py: dropxxhashimport, updatefchunk()to pack only sizes.refs #8572
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)