fix: --cid-base works in all commands and auto-upgrades CIDv0#11239
Open
fix: --cid-base works in all commands and auto-upgrades CIDv0#11239
Conversation
Passing --cid-base=base32 now returns CIDv1 in base32 everywhere, including block, dag stat, and object patch which previously ignored it. - cidbase: auto-upgrade CIDv0 when base is not base58btc, deprecate --upgrade-cidv0-in-output, remove GetLowLevelCidEncoder - block stat/put/rm: use GetCidEncoder - dag stat: store CID as pre-encoded string, drop MarshalJSON/UnmarshalJSON - object patch rm-link/add-link: use GetCidEncoder - bitswap: switch to GetCidEncoder
guillaumemichel
approved these changes
Mar 18, 2026
Contributor
guillaumemichel
left a comment
There was a problem hiding this comment.
Looks good overall
What should be the behaviour if both --format=v0 and --cid-base=base32 are supplied? It would be nice to have a test asserting a well-defined behaviour.
Also we could add harness tests to assert flags work as expected with block, dag stat, object patch.
Comment on lines
+306
to
+307
| if len(cidStr) > 20 { | ||
| cidStr = cidStr[:20] |
Contributor
There was a problem hiding this comment.
Why truncate at 20 bytes? An explanation would help
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Passing
--cid-base=base32now returns CIDv1 in base32 everywhere, includingblock,dag stat, andobject patchwhich previously ignored it.Changes
upgrade-cidv0-in-output, removeGetLowLevelCidEncoderGetCidEncoderMarshalJSON/UnmarshalJSONobject patch rm-link/add-link: useGetCidEncoderGetCidEncoder