Skip to content

Commit

Permalink
Revert "core/state: small trie prefetcher nits (ethereum#28183)"
Browse files Browse the repository at this point in the history
This reverts commit ab25e35.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent b837223 commit cc4dadf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
type triePrefetcher struct {
db Database // Database to fetch trie nodes through
root common.Hash // Root hash of the account trie for metrics
fetches map[string]Trie // Partially or fully fetched tries. Only populated for inactive copies.
fetches map[string]Trie // Partially or fully fetcher tries
fetchers map[string]*subfetcher // Subfetchers for each trie

deliveryMissMeter metrics.Meter
Expand Down Expand Up @@ -197,10 +197,7 @@ func (p *triePrefetcher) used(owner common.Hash, root common.Hash, used [][]byte

// trieID returns an unique trie identifier consists the trie owner and root hash.
func (p *triePrefetcher) trieID(owner common.Hash, root common.Hash) string {
trieID := make([]byte, common.HashLength*2)
copy(trieID, owner.Bytes())
copy(trieID[common.HashLength:], root.Bytes())
return string(trieID)
return string(append(owner.Bytes(), root.Bytes()...))
}

// subfetcher is a trie fetcher goroutine responsible for pulling entries for a
Expand Down

0 comments on commit cc4dadf

Please sign in to comment.