-
Notifications
You must be signed in to change notification settings - Fork 11
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
ADD: nullity bitmap and hashes in storage #63
base: main
Are you sure you want to change the base?
ADD: nullity bitmap and hashes in storage #63
Conversation
Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
|
int indicator = (int) encodedValues.get(0); | ||
Bytes values = encodedValues.slice(1); | ||
return switch (indicator) { | ||
case 0 -> Optional.of(createRootNode(values)); |
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.
why not using an enum for that ?
enum NodeType {
ROOT(0),
INTERNAL(1),
STEM(2),
LEAF(3);
int type;
NodeType(final int type) {
this.type = type;
}
public int getType() {
return type;
}
}
throw new RuntimeException("cannot persist dirty node"); | ||
} | ||
nodeUpdater.store(location, null, leafNode.getEncodedValue()); | ||
// if (leafNode.isPersisted()) { |
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.
do we need this ?
List<Bytes> values = new ArrayList<>(nChild); | ||
for (int i = 0; i < nChild; i++) { | ||
if (!isNull.get(i)) { | ||
Bytes value = encoded.slice(0, 32); |
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.
It is possible that a value is not 32 bytes. it is therefore possible to represent it with less byte and save space
example : UInt256.valueOf(1)
0x0000000000000000000000000000000000000000000000000000000000000001
@thomas-quadratic can we close this one ? |
PR description
Not included but possible next steps: