@cryptotaxi247 / kubo / commits / a5f19c4f9

Remove unnecessay prefetch

Peter Rabbitson committed Mar 27, 2020 at 06:56 UTC a5f19c4f9c738fec4edf9baacb82161ba4e0c170
1 file changed +6 -18
core/commands/dag/dag.go
+6 -18
@@ -14,7 +14,6 @@ import (
14 cmds "github.com/ipfs/go-ipfs-cmds"
15 files "github.com/ipfs/go-ipfs-files"
16 ipld "github.com/ipfs/go-ipld-format"
17 - mdag "github.com/ipfs/go-merkledag"
17 ipfspath "github.com/ipfs/go-path"
18 path "github.com/ipfs/interface-go-ipfs-core/path"
19 mh "github.com/multiformats/go-multihash"
@@ -271,33 +270,22 @@ The output of blocks happens in strict DAG-traversal, first-seen, order.
270 )
271 }
272
274 - // The current interface of go-car is rather suboptimal as it
275 - // only takes a blockstore, instead of accepting a dagservice,
276 - // and leveraging parallel-fetch capabilities
277 - // https://github.com/ipld/go-car/issues/27
278 - //
279 - // Until the above is fixed, pre-warm the blockstore before doing
280 - // anything else. We explicitly *DO NOT* take a lock during this
281 - // operation: even if we lose some of the blocks we just received
282 - // due to a conflicting GC: we will just re-retrieve anything we
283 - // potentially lost when the car is being streamed out
273 node, err := cmdenv.GetNode(env)
274 if err != nil {
275 return err
276 }
277
289 - if err := mdag.FetchGraph(req.Context, c, node.DAG); err != nil {
290 - if !node.IsOnline {
291 - err = fmt.Errorf("%s (currently offline, perhaps retry after attaching to the network)", err)
292 - }
293 - return err
294 - }
295 -
278 // Code disabled until descent-issue in go-ipld-prime is fixed
279 //
280 // The second part of the above - make a super-thin wrapper around
281 // a blockservice session, translating Session.GetBlock() to Blockstore.Get()
282 //
283 + // The current interface of go-car is rather suboptimal as it
284 + // only takes a blockstore, instead of accepting a dagservice,
285 + // and leveraging parallel-fetch capabilities
286 + // https://github.com/ipld/go-car/issues/27
287 + //
288 + //
289 // sess := blockservice.NewSession(
290 // req.Context,
291 // node.Blocks,