dragonflyoss / Dragonfly2

Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project.
https://d7y.io
Apache License 2.0
2.22k stars 281 forks source link

chore: optimize calculate digest #3343

Closed jim3ma closed 3 months ago

jim3ma commented 3 months ago

Description

  1. Skip to validate PieceMd5Sign, per piece digest is sufficient.
  2. Enable calculate piece digest by default for data integrality.

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

Checklist

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 52.57%. Comparing base (5dee749) to head (de81529).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343/graphs/tree.svg?width=650&height=150&src=pr&token=PUICJYSAT7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) ```diff @@ Coverage Diff @@ ## main #3343 +/- ## ========================================== - Coverage 52.69% 52.57% -0.12% ========================================== Files 192 192 Lines 20468 20457 -11 ========================================== - Hits 10786 10756 -30 - Misses 8882 8899 +17 - Partials 800 802 +2 ``` | [Flag](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | `52.57% <80.00%> (-0.12%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [client/config/peerhost\_linux.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343?src=pr&el=tree&filepath=client%2Fconfig%2Fpeerhost_linux.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-Y2xpZW50L2NvbmZpZy9wZWVyaG9zdF9saW51eC5nbw==) | `100.00% <100.00%> (ø)` | | | [client/daemon/peer/peertask\_conductor.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343?src=pr&el=tree&filepath=client%2Fdaemon%2Fpeer%2Fpeertask_conductor.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-Y2xpZW50L2RhZW1vbi9wZWVyL3BlZXJ0YXNrX2NvbmR1Y3Rvci5nbw==) | `52.42% <75.00%> (-0.03%)` | :arrow_down: | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3343/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)