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

Node IPLD specification is incorrect and incomplete #297

Closed
str4d opened this issue Feb 25, 2024 · 0 comments · Fixed by #298
Closed

Node IPLD specification is incorrect and incomplete #297

str4d opened this issue Feb 25, 2024 · 0 comments · Fixed by #298

Comments

@str4d
Copy link

str4d commented Feb 25, 2024

https://atproto.com/specs/repository#mst-structure

The node IPLD schema fields are:
- `l` ("left", CID link, optional): link to sub-tree Node on a lower level and with all keys sorting before keys at this node
- `e` ("entries", array of objects, required): ordered list of TreeEntry objects
- `p` ("prefixlen", integer, required): count of bytes shared with previous TreeEntry in this Node (if any)
- `k` ("keysuffix", byte array, required): remainder of key for this TreeEntry, after "prefixlen" have been removed
- `v` ("value", CID Link, required): link to a sub-tree Node at a lower level which has keys sorting after this TreeEntry's key (to the "right"), but before the next TreeEntry's key in this Node (if any)

The v field is documented as:

  • ✅ A CID link.
  • ✅ Required.
  • ⚠️ A link to a sub-tree Node.

After experimenting with my own repository's CAR, I've concluded that this is most likely an accidental merge of two separate fields:

  • v:
    • A CID link.
    • Required.
    • A link to the Lexicon value corresponding to this TreeEntry's key.
  • t:
    • A CID link.
    • Optional (CID link || null).
    • A link to a sub-tree Node.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant