cmd, core, eth, light, trie: dump clean cache periodically (#20391)
* cmd, core, eth, light, trie: dump clean cache periodically * eth: update config * trie: minor fix * core, trie: address comments * eth: remove useless * trie: print clean cache dump start too Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This commit is contained in:
		| @@ -100,16 +100,16 @@ type Trie interface { | ||||
| // concurrent use, but does not retain any recent trie nodes in memory. To keep some | ||||
| // historical state in memory, use the NewDatabaseWithCache constructor. | ||||
| func NewDatabase(db ethdb.Database) Database { | ||||
| 	return NewDatabaseWithCache(db, 0) | ||||
| 	return NewDatabaseWithCache(db, 0, "") | ||||
| } | ||||
|  | ||||
| // NewDatabaseWithCache creates a backing store for state. The returned database | ||||
| // is safe for concurrent use and retains a lot of collapsed RLP trie nodes in a | ||||
| // large memory cache. | ||||
| func NewDatabaseWithCache(db ethdb.Database, cache int) Database { | ||||
| func NewDatabaseWithCache(db ethdb.Database, cache int, journal string) Database { | ||||
| 	csc, _ := lru.New(codeSizeCacheSize) | ||||
| 	return &cachingDB{ | ||||
| 		db:            trie.NewDatabaseWithCache(db, cache), | ||||
| 		db:            trie.NewDatabaseWithCache(db, cache, journal), | ||||
| 		codeSizeCache: csc, | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user