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

Add CARv2 MultihashIndexSorted codec #227

Merged
merged 1 commit into from
Sep 2, 2021
Merged

Conversation

masih
Copy link
Member

@masih masih commented Sep 2, 2021

Define a new codec for CARv2 `MultihashIndexSorted`.

See:
- ipld/go-car#217
- ipld/go-car#214
masih added a commit to ipld/go-car that referenced this pull request Sep 2, 2021
Implement a new CARv2 index that contains enough information to
reconstruct the multihashes of the data payload, since `CarIndexSorted`
only includes multihash digests. Note, this index intentionally ignores
any given record with `multihash.IDENTITY` CID hash.

Add a test that asserts offsets for the same CID across sorted index and
new multihash sorted index are consistent.

Add tests that assert marshal unmarshalling of the new index type is as
expected, and it does not load records with `multihash.IDENTITY` digest.

Note, there is a need for a multicodec to be defined for the new index
type. For now TODOs are left since it requires coordination across
repos.

Relates to:
- multiformats/multicodec#227

Fixes:
- #214
masih added a commit to ipld/go-car that referenced this pull request Sep 2, 2021
Implement a new CARv2 index that contains enough information to
reconstruct the multihashes of the data payload, since `CarIndexSorted`
only includes multihash digests. Note, this index intentionally ignores
any given record with `multihash.IDENTITY` CID hash.

Add a test that asserts offsets for the same CID across sorted index and
new multihash sorted index are consistent.

Add tests that assert marshal unmarshalling of the new index type is as
expected, and it does not load records with `multihash.IDENTITY` digest.

Note, there is a need for a multicodec to be defined for the new index
type. For now TODOs are left since it requires coordination across
repos.

Relates to:
- multiformats/multicodec#227

Fixes:
- #214
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this once you're happy with the naming

@masih masih marked this pull request as ready for review September 2, 2021 10:47
@masih masih requested a review from willscott September 2, 2021 10:49
@masih masih merged commit 1bcdc08 into master Sep 2, 2021
@masih masih deleted the masih/carv2-mh-idx-srtd branch September 2, 2021 10:51
masih added a commit to multiformats/go-multicodec that referenced this pull request Sep 2, 2021
Update submodule to `1bcdc083898abb3e92b132f951e0a2fe0dcd485b`.

Run `go generate`.

Note, the code generation includes other changes to the codec table that
have been merged but not generated here.

See:
- multiformats/multicodec#227
- multiformats/multicodec@1bcdc08
- ipld/go-car#214
masih added a commit to multiformats/go-multicodec that referenced this pull request Sep 2, 2021
Update submodule to `1bcdc083898abb3e92b132f951e0a2fe0dcd485b`.

Run `go generate`.

Note, the code generation includes other changes to the codec table that
have been merged but not generated here.

See:
- multiformats/multicodec#227
- multiformats/multicodec@1bcdc08
- ipld/go-car#214
masih added a commit to multiformats/go-multicodec that referenced this pull request Sep 2, 2021
Update submodule to `1bcdc083898abb3e92b132f951e0a2fe0dcd485b`.

Run `go generate`.

Note, the code generation includes other changes to the codec table that
have been merged but not generated here.

See:
- multiformats/multicodec#227
- multiformats/multicodec@1bcdc08
- ipld/go-car#214
masih added a commit to ipld/go-car that referenced this pull request Sep 2, 2021
Implement a new CARv2 index that contains enough information to
reconstruct the multihashes of the data payload, since `CarIndexSorted`
only includes multihash digests. Note, this index intentionally ignores
any given record with `multihash.IDENTITY` CID hash.

Add a test that asserts offsets for the same CID across sorted index and
new multihash sorted index are consistent.

Add tests that assert marshal unmarshalling of the new index type is as
expected, and it does not load records with `multihash.IDENTITY` digest.

Relates to:
- multiformats/multicodec#227

Fixes:
- #214
masih added a commit to ipld/go-car that referenced this pull request Sep 7, 2021
Implement a new CARv2 index that contains enough information to
reconstruct the multihashes of the data payload, since `CarIndexSorted`
only includes multihash digests. The new index builds on top of the
existing `IndexSorted` by adding an additional layer of grouping the
multi-width indices by their multihash code.

Note, this index intentionally ignores
any given record with `multihash.IDENTITY` CID hash.

Add a test that asserts offsets for the same CID across sorted index and
new multihash sorted index are consistent.

Add tests that assert marshal unmarshalling of the new index type is as
expected, and it does not load records with `multihash.IDENTITY` digest.

Relates to:
- multiformats/multicodec#227

Fixes:
- #214
masih added a commit to ipld/go-car that referenced this pull request Sep 7, 2021
Implement a new CARv2 index that contains enough information to
reconstruct the multihashes of the data payload, since `CarIndexSorted`
only includes multihash digests. The new index builds on top of the
existing `IndexSorted` by adding an additional layer of grouping the
multi-width indices by their multihash code.

Note, this index intentionally ignores
any given record with `multihash.IDENTITY` CID hash.

Add a test that asserts offsets for the same CID across sorted index and
new multihash sorted index are consistent.

Add tests that assert marshal unmarshalling of the new index type is as
expected, and it does not load records with `multihash.IDENTITY` digest.

Relates to:
- multiformats/multicodec#227

Fixes:
- #214
Jorropo pushed a commit to ipfs/boxo that referenced this pull request Mar 22, 2023
Implement a new CARv2 index that contains enough information to
reconstruct the multihashes of the data payload, since `CarIndexSorted`
only includes multihash digests. The new index builds on top of the
existing `IndexSorted` by adding an additional layer of grouping the
multi-width indices by their multihash code.

Note, this index intentionally ignores
any given record with `multihash.IDENTITY` CID hash.

Add a test that asserts offsets for the same CID across sorted index and
new multihash sorted index are consistent.

Add tests that assert marshal unmarshalling of the new index type is as
expected, and it does not load records with `multihash.IDENTITY` digest.

Relates to:
- multiformats/multicodec#227

Fixes:
- ipld/go-car#214


This commit was moved from ipld/go-car@42b9e28
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.

3 participants