feat: calculate digest of the persistent cache piece to check the integrity of the metadata #980
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
This pull request includes several changes to improve the calculation and verification of piece metadata digests in the
dragonfly-client
project. The key changes involve updating thecalculate_digest
method, ensuring the integrity of piece metadata, and updating dependencies.Digest Calculation and Verification:
dragonfly-client-storage/src/metadata.rs
: Enhanced thecalculate_digest
method to include additional metadata fields and ensure the integrity of piece metadata.dragonfly-client/src/grpc/dfdaemon_upload.rs
: Added digest calculation and verification in theDfdaemonUpload
implementation to ensure the integrity of piece metadata. [1] [2]dragonfly-client/src/resource/piece_downloader.rs
: Added digest calculation and comparison to verify the integrity of piece metadata in theDownloader
implementation. [1] [2]Dependency Updates:
Cargo.toml
: Updated thedragonfly-api
dependency version from2.1.25
to2.1.27
.Documentation Updates:
dragonfly-client-util/src/digest/mod.rs
: Updated the documentation for thecalculate_file_digest
function to reflect the correct terminology.Related Issue
dragonflyoss/dragonfly#3811
Motivation and Context
Screenshots (if appropriate)