-
Notifications
You must be signed in to change notification settings - Fork 20k
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/state, light, trie: add UpdateContractCode to the Trie interface #27476
core/state, light, trie: add UpdateContractCode to the Trie interface #27476
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.
feedback by Martin during standup:
- What happens when the code is overwritten/deleted? For deletion,
codesize
values should be written to disk to erase things, for the overwrite, things are more complicated and need to be tested. - as @rjl493456442 also pointed out, merging the code update with the tree update is uncanny, because the code DB update is only done to the dirty state. Even though there will be a check for
dirty
in the verkle implementation, it's better to streamline the client code by adding a new state update function that takes the tree as a parameter instead of the other way around.
I think we can add a function It's a bit weird that contract code is associated with a The main difference between Verkle and MPT is: verkle puts everything in a single trie with its own (1) resource identifier scheme, defined https://notes.ethereum.org/@vbuterin/verkle_tree_eip (2) state encoding scheme. But MPT has two-layer tree structure, and also stores contract code directly in key-value store by using hash as the identifier. The better abstraction is: treat each state scheme as a state provider for EVM to consume/write-back. We can hide all the details inside of the implementation instead of exposing them in statedb package. The current abstraction is not suitable between MPT and Verkle(and LES). The proper abstraction is:
The
The
The
Btw it will be a big change. So I purpose to add |
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.
Sure, it shouldn't break anything, so if you want it for easier verkle-integration, I guess that's fine
…ethereum#27476) Verkle trees store the code inside the trie. This PR changes the interface to pass the code, as well as the dirty flag to tell the trie package if the code is dirty and needs to be updated. This is a no-op for the MPT and the odr trie.
…nterface (ethereum#27476)" This reverts commit 7e3ba8b.
…nterface (ethereum#27476)" This reverts commit 7e3ba8b.
Rationale: verkle trees store the code inside the trie. This PR changes the interface to pass the code, as well as the
dirty
flag to tell the trie package if the code is dirty and needs to be updated. This is a no-op for the MPT and the odr trie.