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

Make state-efficient bitarray (significantly improves state size across cosmos) #20

Closed
daniel-farina opened this issue Nov 19, 2021 · 0 comments

Comments

@daniel-farina
Copy link
Contributor

Basically make a bit array, where every leaf in the tree has, say, 1024 bits of data, instead of only 1 bit, or all the bits. Then updating bits is very I/O efficient given that the underlying tree is merkelized. Every leaf causes on average 2*hash_size amount of extra bytes beyond leaf value to be stored in the ideal merkle tree, hash_size=32 bytes = 256 bits, so thats an overhead in the ideal of 512 bits.

I don't trust our current code doing sensible things, so I'd suggest making each leaf 1024 bits.

This dramatically reduces state size, and makes downloading new pruned nodes from chainlayer cheaper

cosmos/cosmos-sdk#2562

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

No branches or pull requests

2 participants