-
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 suffix tree decoder #74
Conversation
Signed-off-by: Karim Taam <[email protected]>
|
decodedFields[2] = | ||
extractField(value, NONCE_OFFSET, NONCE_VALUE_MASK).slice(0, NONCE_BYTE_SIZE); | ||
decodedFields[3] = | ||
extractField(value, BALANCE_OFFSET, BALANCE_VALUE_MASK).slice(0, BALANCE_BYTE_SIZE); |
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.
if you're slicing do you need to shift them? Can't you just slice on the range? E.g. for code size value.slice(CODE_SIZE_OFFSET, CODE_SIZE_BYTE_SIZE)
?
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.
good catch, I modified the code
return value; | ||
} | ||
|
||
public static Bytes[] decodeBasicDataLeaf(final Bytes32 value) { |
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'm not sure how are you using this on the caller side, don't you need to convert from Bytes
-> int
, long
, UInt256
, etc... ? Fields have different sizes so I'm not sure if it won't be beneficial to have a method for each value:
int decodeCodeSize()
long decodeNonce()
Wei decodeBalance()
...
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.
For the moment I prefer to let the logic of the conversion to the VerkleAccount decoder class in Besu. will see later if it's better to move it into this class
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 will add the two way, an user can chose
Signed-off-by: Karim Taam <[email protected]>
Signed-off-by: Karim Taam <[email protected]>
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
Signed-off-by: Karim Taam <[email protected]>
PR description
Add suffix tree decoder in the besu verkle trie library
Fixed Issue(s)