Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Aug 4, 2024
1 parent a9387b5 commit df2f3d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions core/state/cached_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package state

import (
"bytes"

"github.com/erigontech/erigon-lib/common"

"github.com/erigontech/erigon/core/types/accounts"
Expand Down Expand Up @@ -76,7 +74,7 @@ func (cr *CachedReader) ReadAccountStorage(address common.Address, incarnation u
// ReadAccountCode is called when code of an account needs to be fetched from the state
// Usually, one of (address;incarnation) or codeHash is enough to uniquely identify the code
func (cr *CachedReader) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error) {
if bytes.Equal(codeHash[:], emptyCodeHash) {
if codeHash == emptyCodeHashH {
return nil, nil
}
if c, ok := cr.cache.GetCode(address.Bytes(), incarnation); ok {
Expand Down
3 changes: 1 addition & 2 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package state

import (
"bytes"
"fmt"
"io"
"maps"
Expand Down Expand Up @@ -95,7 +94,7 @@ type stateObject struct {

// empty returns whether the account is considered empty.
func (so *stateObject) empty() bool {
return so.data.Nonce == 0 && so.data.Balance.IsZero() && bytes.Equal(so.data.CodeHash[:], emptyCodeHash)
return so.data.Nonce == 0 && so.data.Balance.IsZero() && (so.data.CodeHash == emptyCodeHashH)
}

// newObject creates a state object.
Expand Down
2 changes: 1 addition & 1 deletion erigon-lib/state/domain_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ func (sdc *SharedDomainsCommitmentContext) GetAccount(plainKey []byte, cell *com
copy(cell.CodeHash[:], chash)
}
}
if bytes.Equal(cell.CodeHash[:], commitment.EmptyCodeHash) {
if cell.CodeHash == commitment.EmptyCodeHashArray {
cell.Delete = len(encAccount) == 0
return nil
}
Expand Down

0 comments on commit df2f3d5

Please sign in to comment.