Open Stebalien opened 4 years ago
ipfs add --cid-version=1
isn't "experimental" afaik - and even if it were, it's been around for quite some time. Changing its outputs by default is a bit... contrary to the promise of the API, no?
It's clearly marked as experimental and I doubt many users are using it. Mostly just users who're also using the "raw leaves" feature.
I've edited the issue to:
DagCBOR, DagJSON, CAR files, other datastore implementations that interact with CID, I'm sure there are other places they get encoded. We could probably do a "up-convert when writing new data" but you end up with mutation where you may not expect it. How do we handle these cases in a deprecate-CIDv0 world? "Support for read but don't write" seems to land us in new kinds of trouble. "Support for read, write v0 only if it was read as v0" seems to be basically where we're at right now. What other strategies could we adopt to make a proper deprecation across the board?
“Deprecate” can mean a lot of things, so we should spend time writing out the details of what that means. That said, I’m +1 on deprecating CIDv0 by any definition of “deprecate” 🥳
It sounds like the working definition is:
Is there some timeline in which we think we can back off of the second point?
For instance, is there a future date at which I could author a new block format and drop support for CIDv0 entirely?
Is there some timeline in which we think we can back off of the second point?
Never, unfortunately.
For instance, is there a future date at which I could author a new block format and drop support for CIDv0 entirely?
Well, if we implement the above proposal, new block formats going forward don't need to implement CIDv0. However, this is something that's usually implemented system-wide anyways, not something specific to the block format.
Observations:
--upgrade-cidv0-in-output
flag to only upgrade to CIDv1 when encoding the CIDs in text.Idea: We can actually deprecate CIDv0 without changing hashes too much by making it an artifact of the DagPB encoding. That is:
What breaks?
ipfs add --cid-version=1
will now be a bit funny. The returned CID will be CIDv1 but all internal CIDs (except ones referring to raw leaves) will be CIDv0. We may need to provide a way to override this behavior and really store CIDv1 DagPB CIDs when encoding DagPB.