-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
core, trie/triedb/pathdb: adjust pathdb for verkle #28297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left minor comments. I still do not see an easy upgrade path for the overlay transition, but that's a problem for later.
415f5c3
to
c4f2625
Compare
84332cd
to
b22d3f2
Compare
a4ccd19
to
46c1ced
Compare
7676345
to
59e7d50
Compare
59e7d50
to
4fc4949
Compare
I agree that we need to get this in, however, later rather than sooner. The type of error that we encountered here: #28595 , we would not have been able to detect that error if this PR had been already merged. |
4fc4949
to
b122acb
Compare
Replaced with #29084 |
This pull request is a prerequisite for landing verkle.
Specifically, verkle and merkle are two independent trees which may be existent at the same time. In order to store tree data separately, we need to explicitly make the isolation in database level, for both key-value store and state freezer.
Besides, verkle uses a slim format which doesn't store the node hash in the parent node. This slim format can significantly reduce the read and write amplification, but in the same time loses some robustness. However, we think it's still worthwhile to at least experiment it to see the performance difference. In order to support it, pathdb will no longer maintain the node hash which is also beneficial by maintaining less stuff in memory.
But one thing is noteworthy, pathdb will return the node blindly where ever it's found without hash comparison(clean cache, dirty cache, diff layer, disk). Originally we have this tiny trick to compare the hash if the node is found in clean cache, and fallback to disk if it's not matched, just in case the clean cache is not properly maintained, but this mechanism is lost in this pull request.
Update: this pull request can snap/full sync the mainnet, we have more confidence that the clean cache is properly maintained and safe to have this change.