Closed weiihann closed 8 months ago
Thanks for the comments! I'm personally more keen to do something like ExtStem { stem: key[:31] }
and KeyToStem(...)
so it's safer and for better code readability. Will push the latest code changes ASAP.
@gballet @jsign I've pushed a completely new set of changes and changed the PR title and description, please review again. I've decided to go with the ExtStem []byte
structure instead of ExtStem { stem: key[:31] }
structure. For code readability, I think it's better comparatively and has less code footprint.
This PR does the following:
Stem []byte
instead of[]byte
, as well asKeyToStem(key []byte)
instead ofkey[:31]
in most occurrences that require stem. This enhances code readability, without affecting the underlying logic.32
with constantsLeafValueSize
orKeySize
for code maintainability.BREAKING CHANGE: The
GetProofItems
function in theVerkleNode
interface now returns[]Stem
instead of[][]byte
, which affects geth's usage of this libraryBenchmark results: