-
Notifications
You must be signed in to change notification settings - Fork 25
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
Change Pointer CBOR representation to a kinded union (breaking change) #60
Conversation
cb07286
to
7597825
Compare
From: type Pointer union { &Node "0" Bucket "1" } representation keyed i.e. {"0": CID} or {"1": [KV...]} To: type Pointer union { &Node link Bucket list } representation kinded i.e. CID or [KV...] Also removes redundant refmt tags Closes: https://github.com/ipfs/go-hamt-ipld/issues/53
7597825
to
a3efb56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'd like a 👍 from @whyrusleeping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a bit too late to make breaking changes to the formats, especially for a 'not security critical' reason. I'm supportive of making this change, but it will be quite disruptive to a lot of other groups.
@whyrusleeping since we are likely going to be tuning HAMT widths in actors v3 upgrade and migrating most state tree HAMTs anyway it seems like this is a good time to get this change in. Is the disruption to other groups you predicted above going to be tolerable if we ship this in early 2021? |
Some notes about size savings from this that I neglected to put in the original notes: Each "pointer" to Then there's also the minor decode savings of not having to deal with these 2 extra CBOR constructs. As an interesting aside, we came up with a way to describe both of these forms (before and after this PR) in IPLD schemas which translate directly to go-ipld-prime's ability to handle a HAMT that can read both of them in a single codegen'd form: https://github.com/ipld/specs/pull/338/files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to speculatively override @whyrusleeping's block on this PR and merge to HAMT v3. If this change doesn't make it past the fip process I will then revert.
From:
i.e.
{"0": CID}
or{"1": [KV...]}
To:
i.e.
CID
or[KV...]
Also removes redundant refmt tags.
Diff is hard to see because this bundles unmerged PRs #56 and #59. Only the last commit contains the main change here, currently that's 7597825.
Because TestMalformedHamt has some manually generated CBOR you can see the change in the block layout there and the simplification this introduces.
Closes: #53