ipfs / ipfs/boxo

Improvement: Consolidate DAG traversal implementations

Open
#1,089 0 comments 1 reaction 0 assignees View on GitHub
dif/expert effort/weeks kind/enhancement P2
Dominant language
Go
Stars
316
Forks
163
Avg merge
4d 12h
Merged PRs (30d)
8

Description

We have code to traverse a DAG in many places:

* The best in that it can do it in parallel and non-recursively is https://pkg.go.dev/github.com/ipfs/boxo/ipld/merkledag#WalkDepth, but also does sequential+recursive. It is used for pinning traversal.
* There is a subpackage to that package that also does traversal in the same way: https://pkg.go.dev/github.com/ipfs/boxo@v0.35.2/ipld/merkledag/traverse, but you can specify traversal order (unsure if anyone uses other than the default).
* Kubo core/commands has its own implementations:
* For refs -r https://github.com/ipfs/go-ipfs/blob/4bdc9ad22011cab1c58332e69e9889affb95b7f2/core/commands/refs.go#L213-L264
* And there is https://pkg.go.dev/github.com/ipld/go-ipld-prime@v0.21.0/traversal#WalkLocal which is used by Blockservice and for DAG-providing

We should be able to consolidate into one or two of these...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.