Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Fix HAMT enumeration for in-memory traversal #110

Conversation

schomatis
Copy link
Contributor

@schomatis schomatis commented Oct 26, 2021

Walk the HAMT in memory without needing to serialization (i.e., storing it).

Meant to fix sharness in ipfs/kubo#8114 and the correctness of the walk in general.

@schomatis schomatis self-assigned this Oct 26, 2021
@schomatis schomatis force-pushed the schomatis/fix/enumlinks-from-memory branch from 820c49d to b8b11b3 Compare October 27, 2021 17:53
Comment on lines -377 to +381
rootNode, err := ds.Node()
if err != nil {
emitResult(ctx, linkResults, format.LinkResult{Link: nil, Err: err})
return
}
err = dag.Walk(ctx, getLinks, rootNode.Cid(), cset.Visit, dag.Concurrent())
err := dag.Walk(ctx, getLinks, packBytesIntoCID(nil), cset.Visit, dag.Concurrent())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note removal of serialization here. Will add an explicit test.

Comment on lines +112 to +113
// FIXME: We are assuming a shard width <= 256 (the default) to easily
// convert to and from a byte slice.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on this (extending the hashBits structure to see if it naturally fits into the HAMT API).

@aschmahmann
Copy link
Contributor

closed by the alternative in #111

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants