This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
fix: allow either cidv{0,1} in refs-local test #2989
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale: simplest way to support using cidv0 and cidv1 interchangeably in an ipfs implementation is to just convert all cids to cidv1 transparently. this has the miniscule setback of
refs/local
not being able to list cids in their original version. this fix allows the implementation to use either version internally.I don't know all of the lore in the cidv0 -> cidv1 migration story but the
refs/local
is the only place I've seen there being an issue with doing the cidv0 -> cidv1 migration in the simplest way described above. Looking at the test I assumed the cidv0 string was expected because of "ease of test implementation" and not a specification of "any ipfs impl must be able to recover the original cid format for stored blocks inrefs/local
output."I did think about opening up an issue of allowed cidv0 <-> cidv1 strategies but perhaps this PR is better suited for that, so please don't hesitate to let me know of the things I haven't found out yet! Could be that this approach has been tried already with bad results but I haven't found about it.
This might have a small conflict with #2980 so I'd recommend merging that first.