go-threads icon indicating copy to clipboard operation
go-threads copied to clipboard

Fetch fully loaded records

Open sanderpick opened this issue 6 years ago • 6 comments

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).

sanderpick avatar Dec 02 '19 22:12 sanderpick

@jsign I'm not sure, but maybe you have already done this? I remember something similar in your standup summary today.

sanderpick avatar Dec 02 '19 22:12 sanderpick

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)

jsign avatar Dec 02 '19 22:12 jsign

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?

jsign avatar Dec 02 '19 22:12 jsign

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).

sanderpick avatar Dec 02 '19 22:12 sanderpick

Sounds great

jsign avatar Dec 02 '19 22:12 jsign

mark

bitcard avatar Mar 01 '21 19:03 bitcard