Fix marshaling#17
Merged
zelig merged 5 commits intoethersphere:masterfrom Dec 31, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #15 by correcting the fork PO bit decoding in Unmarshaling().
Marshaling and unmarshaling used different bit order within bitMap.
This PR adds
7-toproximity-order-trie/pkg/elements/persist.go
Lines 108 to 112 in 3096481
to become
https://github.com/brainiac-five/pot/blob/a39473f129580ccb1db627856d6c4f9de004c0c4/pkg/elements/persist.go#L108-L112
Alternatively the marshaling could be changed to take the
7-out inproximity-order-trie/pkg/elements/persist.go
Lines 68 to 71 in 3096481
Both ways work and pass all tests in this project and potjs.
The assumption of this PR is that going from left to right within a byte (from highest bit down) like PO calculation in
proximity-order-trie/pkg/elements/pot.go
Lines 223 to 228 in 3096481
is the intended way.
Without the fix of this PR the new test
https://github.com/brainiac-five/pot/blob/a39473f129580ccb1db627856d6c4f9de004c0c4/kvs_test.go#L112-L136
fails with:
This test should obviously work. What it adds is to have two elements being saved and retrieved after loading the kvs, instead of only one like other tests do.
This PR also has the correct go.mod package name
ethersphere/proximity-order-trie.