-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(trie): poc implementation of rsp trie #18493
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: main
Are you sure you want to change the base?
feat(trie): poc implementation of rsp trie #18493
Conversation
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.
@kevaundray do you have thoughts on this?
We currently are using the trie from Zeth (rsp trie was originally modified from that): https://github.com/boundless-xyz/zeth/blob/bc655b859bc689ef7944c7d959ef8024dd2d07e7/crates/core/src/lib.rs#L95 @Wollac Maybe you remember the benchmark numbers, was it roughly the same? |
Plus one on adding the more efficient zkVM variant of the trie, though I'd lean towards the zeth version since it doesn't have an additional method that must be called by the host (given performance is roughly the same) |
The crate risc0-ethereum-trie mentioned by @kevaundray is exactly v2 of the referenced
These complex trie implementations are in reth only used for |
that'd be much appreciated |
In our project, we found that using rsp trie significantly reduces cycle consumption. We initially considered testing risc0-ethereum-trie as well, but it doesn’t provide an interface to pre-build the storage tries required for our use case.
We disagree: building the trie inside the zkVM is indeed very cycle-intensive. In our benchmark, using rsp trie delivered a 47.9 % improvement: before:
after:
It is also critical to pre-build all required storage tries. Questions for the @Wollac:
|
I don't understand this question.
I'm not sure I agree. This might be true for V1 ( |
rsp trie has proven to be efficiency, since they can be created and serialized outside zkvm, and deserialized inside zkvm.
current serial sparse trie use maps of nibbles to node, would be inefficient in such usage considering the large size of serialized data.
see also: