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

Handle any supported IPLD codec for CAR imports #9198

Closed
3 tasks done
aschmahmann opened this issue Aug 16, 2022 · 3 comments · Fixed by #9219
Closed
3 tasks done

Handle any supported IPLD codec for CAR imports #9198

aschmahmann opened this issue Aug 16, 2022 · 3 comments · Fixed by #9219
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization

Comments

@aschmahmann
Copy link
Contributor

Checklist

  • My issue is specific & actionable.
  • I am not suggesting a protocol enhancement.
  • I have searched on the issue tracker for my issue.

Description

ipfs dag import will fail on CAR imports containing blocks with codecs other than dag-cbor, dag-pb, and raw despite kubo having support for other codecs (e.g. dag-json, cbor, json, git, dag-jose, etc.).

This seems to be due to the use of the ipld.Decode function from go-ipld-format which does not have the codecs registered in the default go-ipld-prime registry available.

Uses include:

} else if nd, err := ipld.Decode(block); err != nil {

nd, err := ipld.Decode(block)

Probably replacing these with go-ipld-legacy's DecodeNode function and adding some testing would be sufficient.

Whether you count this as an issue or a bug likely depends on your perspective, however it's an unexpected result emergent from the work on #7976 although it doesn't seem like much if any functionality was lost.

@aschmahmann aschmahmann added kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization labels Aug 16, 2022
@BigLep BigLep added this to the Best Effort Track milestone Aug 16, 2022
@BigLep
Copy link
Contributor

BigLep commented Aug 16, 2022

@schomatis : is this something you could take?

@schomatis schomatis self-assigned this Aug 16, 2022
@schomatis
Copy link
Contributor

Working on this.

@schomatis
Copy link
Contributor

@aschmahmann This would be the gist of the error we need to test, rigth?

HASH=$(echo 'Hello' | ipfs add -Q)
ipfs dag get $HASH > dag.out
NEW_HASH=$(ipfs dag put --store-codec dag-json dag.out)
ipfs dag export $NEW_HASH > dag.car
ipfs dag import dag.car
# Error: unrecognized object type: 297 (0x129 dag json type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants