-
Notifications
You must be signed in to change notification settings - Fork 41
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
added support for multiproof generation within Prover #157
base: main
Are you sure you want to change the base?
added support for multiproof generation within Prover #157
Conversation
Have been testing this branch on a mainnet block trying to prove the inclusion of a single transaction against the
The majority of time is spent in building the Merkle tree, specifically in SHA256 hashing. I can see a couple reasons for these results:
|
Hi @mempirate! Yeah I agree, the way it's performed it's not really efficient. I'm currently computing a tree to collect each branch for the proof. Ideally, you would want to call prover one time and traverse the tree at once if you keep track of indices and helper indices you can just collect the branches from the leaves. Last time I tried, I had some issues to keep that inside the current Prover implementation, I'll have to rethink this a little. |
#158 also helps with performance by enabling assembly support for hashing. I think combining this with a more efficient multiproof generation algo should already help a lot with proof generation time. |
Was able to get proof generation speed down to around 2-3 seconds as a first step, first with
And with the hashtree_rs crate (https://crates.io/crates/hashtree-rs):
|
I needed multiproof generation to verify multiple fields of data against the beacon block root in the evm. I came with this solution for minimal changes using Prover, not sure if that is acceptable, but works good for me. This is an idea to close #123