kubo icon indicating copy to clipboard operation
kubo copied to clipboard

Include local MFS entity roots in Reprovider.Strategy

Open lidel opened this issue 1 year ago • 0 comments

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.

lidel avatar Apr 03 '24 18:04 lidel