Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CID mismatch with large files #1518

Open
tomohiro-n opened this issue Jul 5, 2024 · 1 comment
Open

CID mismatch with large files #1518

tomohiro-n opened this issue Jul 5, 2024 · 1 comment

Comments

@tomohiro-n
Copy link

I've noticed that the CID we pre-calculate for a file and one after it's uploaded to your service can be different.
Then I was able to reproduce the exact same mismatch(expected value was what we pre-calculated, actual was the one after upload) with one of your test cases.

Most likely, it depends on the file size. As far as we've checked, the mismatch is produced when the size is > 1.9mb or so.

The uploads a file to the service test in the upload-client package fails by changing as follows.

-    const bytes = await randomBytes(128)
+    const bytes = fs.readFileSync('/path/to/large-file')

I've confirmed that the test passes with a 400kb file.

@tomohiro-n tomohiro-n changed the title CID mismatch for large files CID mismatch with large files Jul 5, 2024
@tomohiro-n
Copy link
Author

More easily, changing to const bytes = await randomBytes(2_000_000) is enough for the test to fail.

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

No branches or pull requests

1 participant