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

trie: add getter for preimage store in trie.Database #28155

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

gballet
Copy link
Member

@gballet gballet commented Sep 19, 2023

Rebasing the verkle code on top of PBSS broke the overlay transition code in the following way:

  • The overlay code used rawdb.ReadPreimage while enumerating the snapshot in order to re-hash the key for insertion in the verkle tree
  • The preimages are no longer directly flushed to disk at the end of a block, but bulk-saved at specific times (e.g. when the blockchain stops or the cache gets above a certain threshold).

This means that the overlay conversion method will miss some preimages if they are in the cache and not yet on disk. In order to fix this issue, the conversion code needs to check both the disk and cache stores for preimages. This is done by adding a getter to trie.Database, so that it can call (*preimageStore).preimage.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@holiman holiman added this to the 1.13.2 milestone Sep 19, 2023
@holiman holiman merged commit 7ed5bc0 into ethereum:master Sep 19, 2023
1 check passed
phenix3443 pushed a commit to phenix3443/go-ethereum that referenced this pull request Sep 19, 2023
tyler-smith pushed a commit to blocknative/go-ethereum that referenced this pull request Oct 12, 2023
tyler-smith pushed a commit to blocknative/go-ethereum that referenced this pull request Oct 12, 2023
siosw pushed a commit to fabriqnetwork/go-ethereum that referenced this pull request Oct 16, 2023
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants