Fetch fully loaded records
It would be nice to fetch fully loaded records from known peers. As in, not from the plain DAGResolver (perhaps only as a last resort).
@jsign I'm not sure, but maybe you have already done this? I remember something similar in your standup summary today.
The DAGResolver will run the bitswap protocol for connected peers, and as a fallback use the DHT.
So, this should be already the case by default. (figured it out while reading go-bitswap repo some weeks ago). Tested this idea in the foldersync app, and seems to be the case (yep, what I mentioned in the standup)
To be clear, on connected peers. There might be cases where we know about log addrs, but we aren't connected yet (for some reason). Maybe you're thinking of making sure of being connected to everyone possible to leverage direct fetching as much as possible, before falling back to DHT?
Yeah, more along those lines. Given a record CID, perhaps we can smartly fetch it entirely—returning its linked node's data in one shot from the log's addresses (something like https://github.com/textileio/go-textile-threads/blob/master/pb/threads.proto#L24). Failing that, fall back to connected peers, failing that, fall back to DHT (fail paths are covered as you mentioned above).
Sounds great
mark