Skip to content
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

feat(treerer): Temperature check and WIP #6

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

itsdevbear
Copy link
Contributor

Idea is to allow for a in memory tree representation of an SSZ object

@karalabe
Copy link
Owner

Why is this good though? Could you share some use cases?

Keeping the data in struct form is useful for internal stuff. I can also understand an idea to leave the data as raw bytes and support operating on it like that (e.g. proving, verifying). But turning it into a binary tree which is not really good for either seems strange to me with my limited usage of ssz.

@itsdevbear
Copy link
Contributor Author

The idea that i'm working towards is a cheaper way to update the "HashTreeRoot" of container. Let's use BeaconState for example in the CL context.

If we store the Data in a tree (maybe the answer here is an n-ary tree) we can update the "HashTreeRoot" of the root object in log(n) time by only having the re-hash the branches that were modified since the last time the root was computed.

@itsdevbear
Copy link
Contributor Author

My use case is a db cache and prefetcher for BeaconKit.

@itsdevbear
Copy link
Contributor Author

@karalabe also proof generation

@itsdevbear
Copy link
Contributor Author

I'm still cooking on some stuff, I'll update within the next few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants