Optimized method to fetch/filter pinned cids?

Hi,
Is there an optimized way of listing all cids that are pinned per node or cid?
I mean the ls lists everything and we can filter, but I believe for millions of cids over Time this method might fail?

Also can a follower node (untrusted) list the pinned cids?

If you call ipfs-cluster-ctl status --local on a cluster peer it will only list the cids pinned on that node.

Other than that, pin ls + filtering is the way. Internally is all a key-value store, so everything would consist in listing all + filtering, but perhaps it is worth opening a ticket about implementing this filtering sever-side, as it will be a bit faster.

Yes, as it knows the state (the pinset).