As suggested by @whyrusleeping in #4757
Current pin system has several problems, as I see them:
Suggestions & reviews are welcome
My proposed PR (WIP): #4757
Another option: #4675
The main considerations I can give as a pin-system user, out of the top of my head:
enabling whole world to sniff your pins
Is there anything different as to how the whole world can sniff other non-pinned stuff?
I'd resurface @Kubuxu's comment raised on #4757 pointing out this would be a great candidate for the RFC process. I'd _love_ to see some of the changes mentioned here, but knowing where pinning is headed in the long run is far more important IMHO
Async pinning would be a huge win
Some thoughts:
I think that having pins under MFS (files api) would be very nice feature. This would get us sharding for free, helps with pin exploration and solves pin naming.
We can significantly reduce complexity of GC by removing direct pins and allowing pinned items to be pinned either strongly or weakly (all content must be here vs keep whatever we have). This would allow for not extremely complex implementation of concurrent and/or incremental GC at least partially solving locking problem.
Also regarding GC, we could have /timed-tmp in MFS that would keep files for X time and after that remove them from this directory. Files would be added there when (for example): accessed from gateway, added and so on. (Just some wild idea).
In case of using MFS for pinning, under the hood we would: 1. copy the file to pin MFS; 2. start fetch of MFS directory (this operation is not written but should be simple enough).
Next question is: we would like to allow for selecting providers strategies per pinned item. This might be hard in case of pb-unixfs but should be very easy in case of cbor-unixfs (if it supports xattrs).
Some problems: MFS would have to support non-file content (CBOR, git trees, ethereum blocks) but only in limited regard (cp, mv, rm, fetch) which could lead to weird UX.
I feel it is worth mentioning that our GUI apps are going to move away from ipfs.pin and operate solely on ipfs.files API, making "pin" a low-level abstraction hidden from user. Will that approach be future-proof? Feedback and UI-related thoughts are appreciated at:
I think that having pins under MFS (files api) would be very nice feature. This would get us sharding for free, helps with pin exploration and solves pin naming.
It is nice, but 1. Sharding is going to be used by very low percentage of users
Pin exploration as in discovering other people's pins? That's often a bug, not a feature.
No, I mean your local pins.
requires 'internal' pins.
User MFS wouldn't require that as it would be in the same tree as ipfs files command which is already wired in into GC.
Sharding is going to be used by very low percentage of users
Sharding would allow us to store and traverse large pinsets efficiently. This fixes the concern with the original issue (#4673) where the pinset was too large to operate on. Your PR would also fix this (but wouldn't give us a nice hierarchical filesystem).
https://github.com/ipfs/rfcs/pull/4 made an RFC.
Most helpful comment
The main considerations I can give as a pin-system user, out of the top of my head:
Is there anything different as to how the whole world can sniff other non-pinned stuff?