Skip to content

Commit

Permalink
core/state - ensure storage value is set properly in snapshot when ve…
Browse files Browse the repository at this point in the history
…rkle is enabled (ethereum#78)
  • Loading branch information
jwasinger committed Feb 10, 2022
1 parent 291a947 commit dca3c2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,9 @@ func (s *stateObject) updateTrie(db Database) Trie {
}
s.db.StorageDeleted += 1
} else {
// Encoding []byte cannot fail, ok to ignore the error.
v, _ = rlp.EncodeToBytes(common.TrimLeftZeroes(value[:]))
if !tr.IsVerkle() {
// Encoding []byte cannot fail, ok to ignore the error.
v, _ = rlp.EncodeToBytes(common.TrimLeftZeroes(value[:]))

s.setError(tr.TryUpdate(key[:], v))
} else {
k := trieUtils.GetTreeKeyStorageSlot(s.address[:], new(uint256.Int).SetBytes(key[:]))
Expand Down

0 comments on commit dca3c2e

Please sign in to comment.