Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

chore: update importer to only output unixfs things #2747

Merged
merged 1 commit into from
Mar 1, 2020

Conversation

achingbrain
Copy link
Member

BREAKING CHANGE:

If you specify raw-nodes to be true or cid-version to be 1 and your data fits in one chunk, you would previously get a CID that resolves to an ipld-raw node.

Now you will get a CID that resolves to a dag-pb node, so the output of every import will be a unixfs object.

@achingbrain achingbrain changed the title chore: udpate importer to only output unixfs things chore: update importer to only output unixfs things Feb 5, 2020
@achingbrain achingbrain force-pushed the update-importer-to-only-output-unixfs-things branch from 7f03fac to e93db3e Compare February 5, 2020 11:24
@achingbrain
Copy link
Member Author

Refs #2696

@alanshaw
Copy link
Member

alanshaw commented Feb 7, 2020

Just double checking: rawNodes => rawLeaves?

I think this is a good idea. It will cause an interop issue with go-ipfs because CIDs will be different for the same data (when cidVersion is 1 or rawLeaves is true). Someone will probably raise this as a problem if go-ipfs doesn't catch up quickly. So, I just wanted to check there's consensus on this with the go-ipfs team and that there is an issue to track it that we can point people at when it is reported?

Will you also check there is an interop test for this (albeit skipped for now)? 🙏

BREAKING CHANGE:

Files that fit into one block imported with either `--cid-version=1`
or `--raw-leaves=true` previously returned a CID that resolved to
a raw node (e.g. a buffer). Returned CIDs now resolve to a `dag-pb`
node that contains a UnixFS entry. This is to allow setting metadata
on small files with CIDv1.
@achingbrain achingbrain force-pushed the update-importer-to-only-output-unixfs-things branch from 2f0c205 to f79a7b8 Compare March 1, 2020 11:26
@achingbrain
Copy link
Member Author

check there's consensus on this with the go-ipfs team

This change is in line with @Stebalien's comment here: ipfs-inactive/js-ipfs-unixfs-importer#44 (comment) so I believe there is consensus 😉

and that there is an issue to track it that we can point people at when it is reported?

Right here: ipfs/kubo#6940

Will you also check there is an interop test for this (albeit skipped for now)?

Here: ipfs/interop#105

Kind of an aside but I think we should move most of those interop tests to the interface suite - I think the interop tests should be focused on networking type stuff between go, js, rust etc. E.g. bitswap, the dht, pubsub, etc.

@achingbrain achingbrain merged commit 6376cec into master Mar 1, 2020
@achingbrain achingbrain deleted the update-importer-to-only-output-unixfs-things branch March 1, 2020 16:04
mistakia pushed a commit to mistakia/js-ipfs that referenced this pull request Mar 22, 2020
…s#2747)

BREAKING CHANGE:

Files that fit into one block imported with either `--cid-version=1`
or `--raw-leaves=true` previously returned a CID that resolved to
a raw node (e.g. a buffer). Returned CIDs now resolve to a `dag-pb`
node that contains a UnixFS entry. This is to allow setting metadata
on small files with CIDv1.
SgtPooki referenced this pull request in ipfs/js-kubo-rpc-client Aug 18, 2022
BREAKING CHANGE:

Files that fit into one block imported with either `--cid-version=1`
or `--raw-leaves=true` previously returned a CID that resolved to
a raw node (e.g. a buffer). Returned CIDs now resolve to a `dag-pb`
node that contains a UnixFS entry. This is to allow setting metadata
on small files with CIDv1.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants