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

Try verkle on top of snapshot integration #14

Draft
wants to merge 2 commits into
base: snapshot-integration
Choose a base branch
from

Conversation

gballet
Copy link

@gballet gballet commented Oct 28, 2024

Note: since only reads are searching the MPT, it would make sense to implement the logic of reading both trees in the reader only. Writing to the tree always go to the verkle tree, so the whole TransitionTrie might not be useful at all.

@rjl493456442
Copy link
Owner

Thank you! I will try to review and improve it with you. It's easier for me to understand the verkle transition with this change!

@gballet gballet force-pushed the try-verkle-on-top-of-snapshot-integration branch from 3771b64 to c6b21d8 Compare October 28, 2024 10:51
@gballet gballet force-pushed the try-verkle-on-top-of-snapshot-integration branch from c6b21d8 to 7791fb3 Compare October 28, 2024 11:09
if len(val) != 0 {
return val, nil
}
// TODO also insert value into overlay
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO also insert value into overlay

Comment on lines +85 to +88
// // no pointer to db available, should the "transition" be done at the reader level instead?
// if t.overlay.db.HasStorageRootConversion(address) {
// data.Root = t.overlay.db.StorageRootConversion(address)
// }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjl493456442 explainer here: because the account root isn't saved in the verkle tree (there is no such thing), the data.Root field would always be empty, which would confuse the layer. So I implemented this conversion table that, given an address, would give the historical root. That might no longer be necessary to do in the new model. But if it is, we'd have to think on how to implement that.

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