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

Tests to verify CARv2 blockstore dosen't put duplicates and has the required de-duped blocks #125

Closed
wants to merge 1 commit into from

Conversation

aarshkshah1992
Copy link
Contributor

@aarshkshah1992 aarshkshah1992 commented Jun 30, 2021

  • Generates a UnixFS DAG containing duplicate blocks -> payload has been written to ensure this happens.
  • Generates a CARv2 file from the UnixFS DAG using the CARv2 read-write blockstore.
  • Iterates over the CARv1 payload of the CARv2 file to ensure there are no duplicates in it (this step currently fails).
  • Does a CARv1 selective CAR traversal on the UnixFS DAG using an inmemory blockstore -> verified that this produces no duplicates.
  • Assert that the de-duped blocks seen in the above step are the same as when we iterate the CARv1 payload of the CARv2 file.

@aarshkshah1992 aarshkshah1992 changed the base branch from master to wip-v2 June 30, 2021 06:51
@aarshkshah1992 aarshkshah1992 changed the title Tests to verify CARv2 blockstore dosen't put duplicates Tests to verify CARv2 blockstore dosen't put duplicates and has the required de-duped blocks Jun 30, 2021
mvdan added a commit that referenced this pull request Jul 1, 2021
And a test that uses duplicate hashes as well as duplicate CIDs.

We reuse the same insertion index, since it's enough for this purpose.
There's no need to keep a separate map or set of CIDs.

While at it, make the index package not silently swallow errors,
and improve the tests to handle errors more consistently.

Fixes #123.
Fixes #125.
@mvdan
Copy link
Contributor

mvdan commented Jul 1, 2021

Fixed by #127.

@mvdan mvdan closed this Jul 1, 2021
@mvdan mvdan deleted the feat/de-dup-test branch July 16, 2021 12:43
mvdan added a commit that referenced this pull request Jul 16, 2021
And a test that uses duplicate hashes as well as duplicate CIDs.

We reuse the same insertion index, since it's enough for this purpose.
There's no need to keep a separate map or set of CIDs.

While at it, make the index package not silently swallow errors,
and improve the tests to handle errors more consistently.

Fixes #123.
Fixes #125.
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

Successfully merging this pull request may close these issues.

2 participants