diff --git a/core/state/pruner/bloom.go b/core/state/pruner/bloom.go index b573267ee1..c87fd19a9e 100644 --- a/core/state/pruner/bloom.go +++ b/core/state/pruner/bloom.go @@ -27,9 +27,7 @@ import ( bloomfilter "github.com/holiman/bloomfilter/v2" ) -// stateBloomHasher is a wrapper around a byte blob to satisfy the interface API -// requirements of the bloom library used. It's used to convert a trie hash or -// contract code hash into a 64 bit mini hash. +// stateBloomHasher is used to convert a trie hash or contract code hash into a 64 bit mini hash. func stateBloomHasher(f []byte) uint64 { return binary.BigEndian.Uint64(f) } diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 408bd4c481..a10b296fc1 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -124,17 +124,17 @@ type diffLayer struct { lock sync.RWMutex } +// destructBloomHasher is used to convert a destruct event into a 64 bit mini hash. func destructBloomHasher(h common.Hash) uint64 { return binary.BigEndian.Uint64(h[bloomDestructHasherOffset : bloomDestructHasherOffset+8]) } -// accountBloomHasher is a wrapper around a common.Hash to satisfy the interface -// API requirements of the bloom library used. It's used to convert an account -// hash into a 64 bit mini hash. +// accountBloomHasher is used to convert an account hash into a 64 bit mini hash. func accountBloomHasher(h common.Hash) uint64 { return binary.BigEndian.Uint64(h[bloomAccountHasherOffset : bloomAccountHasherOffset+8]) } +// storageBloomHasher is used to convert an account hash and a storage hash into a 64 bit mini hash. func storageBloomHasher(h0, h1 common.Hash) uint64 { return binary.BigEndian.Uint64(h0[bloomStorageHasherOffset:bloomStorageHasherOffset+8]) ^ binary.BigEndian.Uint64(h1[bloomStorageHasherOffset:bloomStorageHasherOffset+8])