Skip to content

PieceCID Generation Error on Duplicate File Uploads (PDP) #650

@nijoe1

Description

@nijoe1

Description

When uploading the same file multiple times to SP (calibration network), the system generates incorrect PieceCIDs for subsequent uploads. The issue appears to incorrectly calculate file sizes based on the upload count.

Steps to Reproduce

  1. Upload a file (183.54 MB) to SP - generates correct PieceCID
  2. Upload the same file again - generates wrong PieceCID with doubled size (367.09 MB)
  3. Upload the same file a third time - generates wrong PieceCID with tripled size (550.64 MB)

Expected Behavior

Uploading the same file multiple times should consistently generate the same PieceCID.

Actual Behavior

Each duplicate upload produces a different PieceCID with the file size apparently multiplied by the upload count (size × number of uploads).

Example Data

First upload (correct):

  • Piece 4
  • CID: bafkzcibfrhupqiyxoqhzdc3nh3qcyc3srqbbr4osamnmydobnyz5eajw4aoviqc6kmfq
  • File size: 183.54 MB

Second upload (incorrect):

  • Piece 5
  • CID: bafkzcibfslipcryyoqhzdc3nh3qcyc3srqbbr4osamnmydobnyz5eajw4aoviqc6kmfq
  • File size: 367.0925 MB

Third upload (incorrect):

  • Piece 7
  • CID: bafkzcibgto4ov2qbdf2a7emlnu7oalalokgaeghr2ibrvtanyfxdhuqbg3qb2vcalzjqw
  • File size: 550.6388 MB

Additional Information

Dataset Response Example

The PDP server returns piece data showing the incorrect pieceCid values while maintaining correct subPieceCid values for pieces 4, 5, and 7.

Potential Areas to Investigate

  • PieceCIDv2 calculation logic in the SP
  • SDK and SP agreement on PieceCID generation
  • Size calculation during duplicate uploads
  • Multihash vs full CID validation

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingteam/fs-wgItems being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions