diff --git a/core/blockchain.go b/core/blockchain.go index 7b93a7606e..dd40149ca3 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1332,7 +1332,6 @@ func (bc *BlockChain) Stop() { } } } - // Allow tracers to clean-up and release resources. if bc.logger != nil && bc.logger.OnClose != nil { bc.logger.OnClose() diff --git a/core/state/database.go b/core/state/database.go index 052e2acab9..3a0ac422ee 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -285,11 +285,6 @@ func (db *CachingDB) TrieDB() *triedb.Database { return db.triedb } -// DiskDB returns the underlying disk database for direct access. -func (db *CachingDB) DiskDB() ethdb.KeyValueStore { - return db.disk -} - // PointCache returns the cache of evaluated curve points. func (db *CachingDB) PointCache() *utils.PointCache { return db.pointCache diff --git a/core/state/statedb.go b/core/state/statedb.go index f74065666b..b770698255 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -186,7 +186,6 @@ func NewWithReader(root common.Hash, db Database, reader Reader) (*StateDB, erro if db.TrieDB().IsVerkle() { sdb.accessEvents = NewAccessEvents(db.PointCache()) } - return sdb, nil } @@ -668,7 +667,7 @@ func (s *StateDB) CreateContract(addr common.Address) { // Copy creates a deep, independent copy of the state. // Snapshots of the copied state cannot be applied to the copy. func (s *StateDB) Copy() *StateDB { - // Copy all the basic fields, init the memory ones + // Copy all the basic fields, initialize the memory ones state := &StateDB{ db: s.db, reader: s.reader, diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index 20bcbabdf8..147546a3c7 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -281,7 +281,7 @@ func TestCopyObjectState(t *testing.T) { cpy := orig.Copy() for _, op := range cpy.mutations { if have, want := op.applied, false; have != want { - t.Fatalf("Error in test itself, the 'aborted' flag should not be set before Commit, have %v want %v", have, want) + t.Fatalf("Error in test itself, the 'done' flag should not be set before Commit, have %v want %v", have, want) } } orig.Commit(0, true, false) diff --git a/core/state/trie_prefetcher_test.go b/core/state/trie_prefetcher_test.go index 37cd2b6826..41349c0c0e 100644 --- a/core/state/trie_prefetcher_test.go +++ b/core/state/trie_prefetcher_test.go @@ -73,7 +73,7 @@ func TestVerklePrefetcher(t *testing.T) { state, err := New(types.EmptyRootHash, sdb) if err != nil { - t.Fatalf("failed to init state: %v", err) + t.Fatalf("failed to initialize state: %v", err) } // Create an account and check if the retrieved balance is correct addr := testrand.Address() diff --git a/triedb/pathdb/database.go b/triedb/pathdb/database.go index 0be875af8f..ae9574963e 100644 --- a/triedb/pathdb/database.go +++ b/triedb/pathdb/database.go @@ -136,7 +136,8 @@ type Database struct { stateFreezer ethdb.ResettableAncientStore // Freezer for storing state histories, nil possible in tests stateIndexer *historyIndexer // History indexer historical state data, nil possible - lock sync.RWMutex // Lock to prevent mutations from happening at the same time + + lock sync.RWMutex // Lock to prevent mutations from happening at the same time } // New attempts to load an already existing layer from a persistent key-value @@ -681,7 +682,7 @@ func (db *Database) StorageIterator(root common.Hash, account common.Hash, seek return newFastStorageIterator(db, root, account, seek) } -// SnapshotCompleted returns the snapshot root if the snapshot generation is completed. +// SnapshotCompleted returns the flag indicating if the snapshot generation is completed. func (db *Database) SnapshotCompleted() bool { db.lock.RLock() wait := db.waitSync