-
Notifications
You must be signed in to change notification settings - Fork 43
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 tree root computation #17
Comments
partial implementation deleted in the one commit of #74 could be a good starting place to pick this back up when perf becomes an issue |
Merkleized
typesList
and Vector
types
List
and Vector
types
see #6 for an initial direction here |
some current thoughts:
|
some design questions:
which types?
List and Vector are good targets -- the other custom types provided here are small enough to not need caching given the complexity it would entail (lots of wrapping etc)
An interesting one is containers with the
SimpleSerialize
proc macro...One option is an attribute macro to change the struct definition in-place
Another option is to modify the derive macro so that it has a helper attribute and then it is on the caller to include the cache as needed (using the attribute to signal to the derive macro it should be used when computing the hash tree root).
I personally lean towards this last option at the moment as it is explicit and gives the caller the most flexibility on how to add caching to their custom types.
mutability model?
interior or exterior mutability? the cleanest thing would be to encapsulate all of the mutable caching behind an immutable type
relevant data to consider:
RelayMux
mev-rs#27The text was updated successfully, but these errors were encountered: