-
Notifications
You must be signed in to change notification settings - Fork 9
fix: ipfs data is validated #249
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
Merged
SgtPooki
merged 18 commits into
main
from
144-bug-when-we-retrieve-or-verify-content-downloaded-from-sp-or-ipfs-we-do-not-validate-the-actual-content
Feb 18, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e4db04e
fix: validate car data
SgtPooki b9c0468
fix: end-to-end car validation
SgtPooki 548d6a3
fix: fail car check if deal doesnt have valid rootCID
SgtPooki aa02859
Update apps/backend/src/common/car-utils.spec.ts
SgtPooki 5b01335
Merge branch 'main' into 144-bug-when-we-retrieve-or-verify-content-d…
SgtPooki 7a721bc
chore: address comments
SgtPooki 575f414
fix: validate ipfs root CID and walk to validate blocks
SgtPooki 4829539
chore: cleanup
SgtPooki 0aadce4
fix: full streaming of /ipfs downloads and validation
SgtPooki 5c440b4
Merge branch 'main' into 144-bug-when-we-retrieve-or-verify-content-d…
SgtPooki 6700ad6
fix: ensure stream errors are handled properly
SgtPooki e11d511
fix: remove unneeded car size check
SgtPooki bee08d1
tmp
SgtPooki 764443c
Merge branch 'main' into 144-bug-when-we-retrieve-or-verify-content-d…
SgtPooki 1cf688c
fix: block-level-retrieval and validation for IPFS
SgtPooki 81888f4
chore: address my own comments
SgtPooki 7a26409
Merge branch 'main' into 144-bug-when-we-retrieve-or-verify-content-d…
SgtPooki 4a337e2
IPFS validation: ttfb, improved queueing, multiformats for traversal …
rvagg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { randomBytes } from "node:crypto"; | ||
| import { mkdir, rm } from "node:fs/promises"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
| import { afterEach, beforeEach, describe, expect, it } from "vitest"; | ||
| import { buildUnixfsCar } from "./car-utils.js"; | ||
|
|
||
| describe("car-utils", () => { | ||
| let tempDir: string; | ||
|
|
||
| beforeEach(async () => { | ||
| tempDir = join(tmpdir(), `car-utils-test-${randomBytes(6).toString("hex")}`); | ||
| await mkdir(tempDir, { recursive: true }); | ||
| }); | ||
|
|
||
| afterEach(async () => { | ||
| await rm(tempDir, { recursive: true, force: true }); | ||
| }); | ||
|
|
||
| describe("buildUnixfsCar", () => { | ||
| it("produces CAR data, root CID, and block CIDs from file data", async () => { | ||
| const data = randomBytes(4096); | ||
| const result = await buildUnixfsCar({ | ||
| data: Buffer.from(data), | ||
| size: data.length, | ||
| name: "test.bin", | ||
| }); | ||
|
|
||
| expect(result.carData.length).toBeGreaterThan(0); | ||
| expect(result.rootCID).toBeDefined(); | ||
| expect(result.blockCIDs.length).toBeGreaterThanOrEqual(1); | ||
| expect(result.blockCount).toBe(result.blockCIDs.length); | ||
| expect(result.totalBlockSize).toBeGreaterThan(0); | ||
| expect(result.carSize).toBe(result.carData.length); | ||
| }); | ||
| }); | ||
| }); |
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.