Conversation
lidel
left a comment
There was a problem hiding this comment.
The goal here is to unblock upgrade to CIDv1 (#4143) by having a global configuration option for people that need to go back to the old defaults once we switch to CIDv1 everywhere.
CID selection in block put is deprecated. We don't want to change or touch anything in dag|block put, because the real world problem is just ipfs add. It is ok if DefaultCidVersion is only applied to ipfs add here.
021e436 to
95cbc78
Compare
564b7ac to
65052c7
Compare
lidel
left a comment
There was a problem hiding this comment.
lgtm, pushed some additional tests, docs and two profiles for user convenience.
I think there is a small UX bug where we should error and not silently ignore cid version – details inline. Once addressed, and if my changes look good, feel free to merge.
079dc04 to
099ce9c
Compare
|
Discussed this, and we decided to keep this simple and small. This PR will not change the current behavior where passing We can do that when we make a "breaking change" and switch default to cidv1 (#4143), but for now we don't do anything that would impact existing users. The purpose of this PR is to lay the ground for that change without forcing people to do it when they upgrade. |
This is an initial draft for an idea that @lidel and I were speaking about: a config section with the default data ingestion options. This would allow to easily change the defaults across the code-base easily in the future.
The largest problem at the moment is that the CID Version is, by default, 1 in some commands (
dag put,block put) and 0 in others (add, except in cases where certain options are used). This was also the largest use case for this config section: being able to upgrade the default CID version in the future. However, we can't use this configuration option since not all commands use the same default at the moment.My suggestion would be to investigate the possibility of changing the default of
ipfs addto CIDv1, since this one seems to be the only one that still uses 0 as the default, except in some cases.cc #4143