Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipld/unixfs/hamt: Encapsulate and document maxpadlen logic #388

Open
schomatis opened this issue Oct 15, 2018 · 3 comments
Open

ipld/unixfs/hamt: Encapsulate and document maxpadlen logic #388

schomatis opened this issue Oct 15, 2018 · 3 comments
Labels
help wanted Seeking public contribution on this issue status/deferred Conscious decision to pause or backlog

Comments

@schomatis
Copy link
Contributor

Background: #387.

To differentiate between nodes of the HAMT directory and nodes that represent an entry in that directory (but that don't belong to it) the links in the DAG layer are being overloaded with hash information of the trie, that is, the link name is being prefixed like AFname (<hash-part><actual-link-name>); so the reader stumbles upon comparisons like len(lnk.Name) == ds.maxpadlen when trying to figure out if this links points to a node of the HAMT directory or a entry node (a value of the in the trie leaf). I don't think this can be changed at this moment since it would be a major API breakage, but the next best thing would be to extract every reference of maxpadlen (and related) to functions that clearly and explicitly tell the reader "we are checking if this link points to a node inside or outside the HAMT directory" and "we want to extract the actual name of the link embedded in lnk.Name attribute".

@schomatis schomatis added help wanted Seeking public contribution on this issue status/ready Ready to be worked labels Oct 15, 2018
@schomatis
Copy link
Contributor Author

/cc @overbool (in case you're interested in continuing the work from ipfs/go-unixfs#30, but feel free to ignore it otherwise)

@overbool
Copy link

@schomatis 👌

@Stebalien Stebalien added status/deferred Conscious decision to pause or backlog and removed status/ready Ready to be worked labels Dec 18, 2018
@Jorropo Jorropo changed the title HAMT: Encapsulate and document maxpadlen logic ipld/unixfs: HAMT: Encapsulate and document maxpadlen logic Jun 26, 2023
@Jorropo
Copy link
Contributor

Jorropo commented Jun 26, 2023

Information about how the max length or bitmap is used to check for sets needs to be present in the unixfs spec too ipfs/specs#331.

@Jorropo Jorropo transferred this issue from ipfs/go-unixfs Jun 26, 2023
@Jorropo Jorropo changed the title ipld/unixfs: HAMT: Encapsulate and document maxpadlen logic ipld/unixfs/hamt: Encapsulate and document maxpadlen logic Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue status/deferred Conscious decision to pause or backlog
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants