You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before EIP-7702, contract code could not be reset and could only be deleted when the account was destructed. This behavior has changed with EIP-7702.
In a Merkle tree, contract code is not stored directly in the trie; instead, only the code hash is maintained in the account object. As a result, resetting contract code does not cause any issues.
In a Verkle tree, however, the contract code itself is stored directly within the trie, making the semantics less clear:
If the contract code is unset, all leftover code chunks should be removed;
If new contract code is added, the corresponding code chunk should be inserted;
If contract code were to be updated with a different size (currently not possible),
part of the code should be overwritten;
part of the code should be removed;
The text was updated successfully, but these errors were encountered:
There are indeed some issues with this, owing to the fact deletions are hard to do with verkle trees.
There are two ways to solve this problem that I can see:
overwrite the code with 0s, as happens with deletions
leave it as-is, since the code size will be set to 0 and the code hash to empty.
They both have the drawback, however, that the chunked code (or zeros) needs to be kept in the tree for future updates (i.e. we can't optimize by saying "well, the code is read-only so once it's committed to in the group's commitment, we can drop the code chunks from the db").
Before EIP-7702, contract code could not be reset and could only be deleted when the account was destructed. This behavior has changed with EIP-7702.
In a Merkle tree, contract code is not stored directly in the trie; instead, only the code hash is maintained in the account object. As a result, resetting contract code does not cause any issues.
In a Verkle tree, however, the contract code itself is stored directly within the trie, making the semantics less clear:
The text was updated successfully, but these errors were encountered: