From 12bbaaeb58cf17407a5850f03d6674d025a11fa6 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Wed, 20 Sep 2023 15:37:35 +0800 Subject: [PATCH] core/rawdb: delete unused func --- core/rawdb/accessors_trie.go | 23 ----------------------- trie/sync.go | 6 +++--- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/core/rawdb/accessors_trie.go b/core/rawdb/accessors_trie.go index 0ba04d5613..ea437b8114 100644 --- a/core/rawdb/accessors_trie.go +++ b/core/rawdb/accessors_trie.go @@ -284,29 +284,6 @@ func DeleteTrieNode(db ethdb.KeyValueWriter, owner common.Hash, path []byte, has } } -// ExistsTrieNode checks for the presence of the trie node with the specified -// account hash and node path, regardless of the node hash. -// -// hashScheme-based lookup requires the following: -// - hash -// -// pathScheme-based lookup requires the following: -// - owner -// - path -func ExistsTrieNode(db ethdb.KeyValueReader, owner common.Hash, path []byte, hash common.Hash, scheme string) bool { - switch scheme { - case HashScheme: - return HasLegacyTrieNode(db, hash) - case PathScheme: - if owner == (common.Hash{}) { - return ExistsAccountTrieNode(db, path) - } - return ExistsStorageTrieNode(db, owner, path) - default: - panic(fmt.Sprintf("Unknown scheme %v", scheme)) - } -} - // ReadStateScheme reads the state scheme of persistent state, or none // if the state is not present in database. func ReadStateScheme(db ethdb.Reader) string { diff --git a/trie/sync.go b/trie/sync.go index dd2804b687..cf1ecee5e3 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -44,11 +44,11 @@ var ErrAlreadyProcessed = errors.New("already processed") const maxFetchesPerDepth = 16384 var ( - // deletionGauge is the metric to track how many trie nodes are deleted - // in total during the sync process. + // deletionGauge is the metric to track how many trie node deletions + // are performed in total during the sync process. deletionGauge = metrics.NewRegisteredGauge("trie/sync/delete", nil) - // lookupGauge is the metric to track how many trie nodes lookup are + // lookupGauge is the metric to track how many trie node lookups are // performed to determine if node needs to be deleted. lookupGauge = metrics.NewRegisteredGauge("trie/sync/lookup", nil) )