feat(storage): ✨ BonsaiStorage
logs are no longer stored in db
#82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request type
What is the current behavior?
Bonsai lib logs currently take up a cumulative 93.1% of the database space, with the bonsai lib as a whole being responsible for 98.8% of database usage.
What is the new behavior?
Removed reliance on Bonsai lib:
BonsaiStorage
is no longer used to store contract storage in a revertible way. Instead, we use our own custom solution to handle that (kudos to @jbcaron for comming up with this). This has resulted in a 13.3x reduction in storage space. Note that this still introduces a temporary duplication of storage, with contract key/value being stored both in the Bonsai lib and our custom storage.Does this introduce a breaking change?
Yes. Due to changes in the database, any node currently running will have to re-start synchronizing from the block 0.
Other information
Some of the code for inserting contract storage into the db might seem messy. Keep in mind I will be making another pr tomorrow rewriting all rocksdb storage access to make better use write batches and multiget.