-
Notifications
You must be signed in to change notification settings - Fork 21.2k
trie{,/utils,/bintrie}: add eip7864 binary trees and run its tests #32365
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
base: master
Are you sure you want to change the base?
Conversation
trie/binary.go
Outdated
NodeResolverFn func([]byte, common.Hash) ([]byte, error) | ||
) | ||
|
||
type BinaryNode interface { |
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 would've been nice if we didn't have a node interface. It makes reasoning about and optimizing for
allocations much harder imo.
// This will cover HashedNode but that should be fine since the | ||
// root node should always be resolved. | ||
return nil, errInvalidRootType | ||
} |
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.
could be simpler without the switch, just call the interface method
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.
actually I just double-checked and GetValueAtStem
isn't an interface method.
295fd38
to
1fe759c
Compare
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
…rage (#547) * refactor package * add tests
- Add binary trie implementation in trie/bintrie package - Implement InternalNode, StemNode, Empty, and HashedNode types - Add comprehensive test coverage for binary trie operations - Switch from blake3 to sha256 hashing for compatibility - Add iterator functionality for binary trie traversal - Update PrevalueTracer interface to support binary operations - Include proper error handling and edge case coverage Co-authored-by: Guillaume Ballet <gballet@gmail.com>
1fe759c
to
c5db47c
Compare
Implement the binary tree as specified in eip-7864. This will gradually replace verkle trees in the codebase. This is only running the tests and will not be executed in production, but will help me rebase some of my work, so that it doesn't bitrot as much.