-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CID length and identity hashes #21
Comments
@kevina's options:
@Stebalien's additional options:
Unfortunately, my options limit the utility of this feature. However, they do increase the usability. |
It is important to note that the 64 bytes comes from the maximum size modern crypro. hashes output (512 bits). If we set the limit lower than this will we prevent the option of using the all the output bits. |
We definitely can't set a lower hard limit, but we could set a lower auto-inline limit. That really depends on how likely we feel we are to move to a larger hash sometime soon. |
I don't have a strong opinion on the limits. Though I'm not really sure about this whole data inlining. It will make the whole stack more complicated. Currently it's always "CID + data" and then if will become "CID + maybe data, depending on the CID". This is a huge change a lot of components need to learn about. |
@vmx i'm not entirely sure what you mean. Conceptually, its pretty simple. We're just allowing the 'hash' function of the CID to be |
@whyrusleeping I'm thinking in in code. Currently it's:
Then a new step between 1 and 2 is introduced:
I'm not sure how bad this really is. If you all think that's not really a big deal, that's fine for me :) |
So, our plan is to just modify the block service to "do the right thing". That is, when you try to put a block with a CID that uses the identity hash, it'll just throw it away. When you try to get the block, it'll extract it from the CID. Currently we have to create indirect, large CIDs even for really tiny objects, files, and directories. |
It was easy to change my block service to support getting an inlined CID. However, I have some concerns when putting.
|
Why? |
@kevina putting a small block in a test, |
@richardschneider the automatic use of identity hashes will require a command line flags that is not enabled by default. See ipfs/kubo#4910 for a proof-of-concept implementation. |
@kevina Thanks, did not know about Does the limit specify the number bytes in (1) the data block size or (2) the identity hash digest size or (3) the CID binary length? Also, is |
(2) the identity hash digest size
Yes |
Thanks @kevina. You have provided enough info for me to implement the putting. Cheers! |
What should be the behavior when the block service remove is called with an inline Cid? I'm thinking this a no-op and no error is returned. |
I agree. Personally, I'd prefer it if moved to being idempotent over deletes for both performance and usability reasons. |
@kevina Would you mind commenting on richardschneider/net-ipfs-engine#20 |
Moved from: ipfs/kubo#4918 as this isn't go-ipfs specific and will affect the spec.
Basically, we'd like to allow inlining small blocks into CIDs (using the identity hash function) for performance reasons. However, the larger the block we allow to be inlined, the less user friendly CIDs get. Unfortunately, we have to pick a "default inlined size" up front or we'll end up changing a bunch of hashes later.
Open questions:
@whyrusleeping @kevina @diasdavid @vmx @kyledrake
The text was updated successfully, but these errors were encountered: