code: func NewDatabaseWithCache(diskdb ethdb.KeyValueStore, cache int) *Database {
  	var cleans *bigcache.BigCache
  	if cache > 0 {
  		cleans, _ = bigcache.NewBigCache(bigcache.Config{
  			Shards:             1024,
  			LifeWindow:         time.Hour,
  			MaxEntriesInWindow: cache * 1024,
  			MaxEntrySize:       512,
  			HardMaxCacheSize:   cache,
  			Hasher:             trienodeHasher{},
  		})
  	}
  	return &Database{
  		diskdb: diskdb,
  		cleans: cleans,
  		dirties: map[common.Hash]*cachedNode{{}: {
  			children: make(map[common.Hash]uint16),
  		}},
  		preimages: make(map[common.Hash][]byte),
  	}
  }
docs: // NewDatabaseWithCache creates a new trie database to store ephemeral trie content
  // before its written out to disk or garbage collected. It also acts as a read cache
  // for nodes loaded from disk.