Skip to content

Commit db6e8ac

Browse files
authored
[release 3.2] cherry pick fix incarnation in CachedWriter (#17523)
Cherry-pick of : #17498 Co-authored-by: antonis19 <antonis19@users.noreply.github.com>
1 parent e8846d4 commit db6e8ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/state/cached_writer.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ func (cw *CachedWriter) UpdateAccountData(address common.Address, original, acco
4444
}
4545

4646
func (cw *CachedWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error {
47-
if err := cw.w.UpdateAccountCode(address, incarnation, codeHash, code); err != nil {
47+
if err := cw.w.UpdateAccountCode(address, 1, codeHash, code); err != nil {
4848
return err
4949
}
50-
cw.cache.SetCodeWrite(address.Bytes(), incarnation, code)
50+
cw.cache.SetCodeWrite(address.Bytes(), 1, code)
5151
return nil
5252
}
5353

@@ -60,16 +60,16 @@ func (cw *CachedWriter) DeleteAccount(address common.Address, original *accounts
6060
}
6161

6262
func (cw *CachedWriter) WriteAccountStorage(address common.Address, incarnation uint64, key common.Hash, original, value uint256.Int) error {
63-
if err := cw.w.WriteAccountStorage(address, incarnation, key, original, value); err != nil {
63+
if err := cw.w.WriteAccountStorage(address, 1, key, original, value); err != nil {
6464
return err
6565
}
6666
if original == value {
6767
return nil
6868
}
6969
if value.IsZero() {
70-
cw.cache.SetStorageDelete(address.Bytes(), incarnation, key[:])
70+
cw.cache.SetStorageDelete(address.Bytes(), 1, key[:])
7171
} else {
72-
cw.cache.SetStorageWrite(address.Bytes(), incarnation, key[:], value.Bytes())
72+
cw.cache.SetStorageWrite(address.Bytes(), 1, key[:], value.Bytes())
7373
}
7474
return nil
7575
}

0 commit comments

Comments
 (0)