core/state, light, trie: add UpdateContractCode to the Trie interface (#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.
This commit is contained in:
Guillaume Ballet
2023-06-22 08:52:52 -04:00
committed by GitHub
parent 5520cd97a1
commit 699243f8ae
4 changed files with 13 additions and 0 deletions
+4
View File
@@ -147,6 +147,10 @@ func (t *odrTrie) UpdateAccount(address common.Address, acc *types.StateAccount)
})
}
func (t *odrTrie) UpdateContractCode(_ common.Address, _ common.Hash, _ []byte) error {
return nil
}
func (t *odrTrie) UpdateStorage(_ common.Address, key, value []byte) error {
key = crypto.Keccak256(key)
v, _ := rlp.EncodeToBytes(value)