ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
15.81k stars 2.96k forks source link

Include local MFS entity roots in Reprovider.Strategy #10386

Open lidel opened 1 month ago

lidel commented 1 month ago

Problem

Reprovider.Strategy settings roots and pinned are currently ignoring content implicitly pinned via MFS.

We start prioritizing pin announcements in all since https://github.com/ipfs/kubo/pull/10376, and it is a pity MFS does not benefit from that. MFS gets announced with everyuthing else in cache.

Proposed improvement

(extracted from https://github.com/ipfs/kubo/issues/10365#issuecomment-2007385092)

Augment NewPinnedProvider and make it also walk the MFS (in offline mode, and skip content that is not in local repo), and include locally cached CIDs.

MFS walk should respect the 'onlyRoots' flag, and when set to true, only yield root CIDs of directories and root CIDs of files inside of them.