-
Notifications
You must be signed in to change notification settings - Fork 81
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
Cache hash outputs #260
Comments
Additionally, celestia-node or any other rsmt2d consumer using EDS would benefit from caching the proofs along with making them accessible through API. |
Otherwise, users have to come up with hacks to gain performance benefits from caching. See: https://github.com/celestiaorg/celestia-node/pull/2429/files |
Maybe this should actually just be implemented in the (tree)hasher implementation rather than rsmt2d. Or make a cached hasher implementation |
Do you mean multihash hasher? |
I was thinking something like
https://github.com/celestiaorg/nmt/blob/master/hasher.go, but I haven't
thought much about what the right place to abstract it is.
…On Mon, 7 Aug 2023, 20:37 Hlib Kanunnikov, ***@***.***> wrote:
Do you mean multihash hasher?
—
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGOEBMIUAFJIGBG4WLDMLTXUE7WPANCNFSM6AAAAAA3HCQYI4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This hasher is global, while proofs are per EDS. The hasher could store a eds->proofs map, but I don't think it should be responsible for that. Instead, the EDS itself should keep a reference to a built tree. |
We can likely optimize the computation of row/col roots by up to 2x if we cache the outputs of leafs, because right now we are hashing all the data chunks twice, once to compute the row roots, and once to compute the col roots.
The text was updated successfully, but these errors were encountered: