-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
EPIC: Storage #12986
Comments
Thanks for writing up this up @marbar3778! Seems like a pretty good summary to me. Just to highlight and reiterate, things that I think are paramount:
One thing I'm still hazy on is IAVL vs some future better accumulator tree structure (e.g. JMT). How much time do we want to spend on IAVL and say refactoring the key layout vs just switching to something better like the JMT? |
Talking with @ValarDragon he believes the change would take 1 week or less of work after a repo cleanup is upstreamed to our version. The JMT work would take much longer. This could be an easy win until we land JMT or something similar. Would you want to dive into the key format change? |
Awesome!
Sure! From what I've read in the JMT paper, we can adopt a similar tactic, i.e. keys take the form of |
are we planning on switching to the JMT and refactoring the whole storage? |
For current store v2 work, besides the SMT itself compared with IAVL tree, I personally think the new store v2 comes with two major differences from store v1:
|
The strategy will be as follows (in order):
|
As for the current v2, I think there might be a chance that is actually discarded -- I'll let @marbar3778 chime in on that |
V2 is still being evaluated. Much of the team has been in and out the past couple weeks so we have been unable to review in a timely manner. There are some concerns taken in the current design and the performance of v2 as it currently stands is not drastically more than v1 with iavl. With a week or two of work on iavl and another week or two in the store package there is a high probability that v1+iavl will become more performant than v2+smt. For now we are opting to move forward with v1+iavl until we fully evaluate the design decisions of v2+smt. |
lets start with the first two and add in specs/docs for the store package. Do you want to lead it @alexanderbez? |
yes ser |
FYI, v2 store looks not bad in terms of db size reduction: evmos/ethermint#1304 (comment) |
The low level db snapshot/checkpoints hard-links the db files, it seems pretty costly in terms of db size intuitively (need some tests to confirm). https://hackmd.io/@2O2cXDfdQpijemGc_vlHCA/SkXxuTAli |
I agree that if we really want to make the blockchain network more usable, we have to take the db size of archive/full node into consideration. |
Seems like the size comparison is of smt vs iavl. Smt having a smaller footprint is known, this is not part of the worry, the worry is that the semantics of iavl and store v1 are not known and a new implementation was done without this understanding. Did the benchmark account for the historical versions on disk or only what is in the tree? The data in smt is not historical but only current so it makes sense that its smaller |
not sure why the checkpoints consumes a lot of disk space but definitely need to be checked out |
An alternative db design for historical states, moving the discussion here.
|
closing this epic for now, @alexanderbez when you have a chance could you create a new one for the upcoming storage work? |
Summary
Storage in the cosmos-sdk is where we spend the most amount of time in execution. The original store package was written many years ago and left to ferment. As the needs of blockchains expanded and we gained better insight into how applications using the cosmos-sdk reads and writes we have learned how to better design the storage layer.
Problem Definition
Cosmos-sdk spends immense amounts of time at the storage layer and this is causing many bottlenecks.
Proposal
We need to refactor many parts of the storage layer in order to get somewhere where the users of the cosmos-sdk can get the highest performance for their applications.
Things we can do today:
Things to do in the future:
Previously there was work around a new storage layer, store/v2 and adr-40, this work and design is currently under review from the core sdk team.
Work Breakdown
Phase 1
ref: #7101, #6687
Phase 2
Phase 3
The text was updated successfully, but these errors were encountered: