core/state/snapshot: replace bigcache with fastcache

This commit is contained in:
Martin Holst Swende
2019-11-25 15:30:29 +01:00
committed by Péter Szilágyi
parent d754091a87
commit f300c0df01
4 changed files with 21 additions and 43 deletions

View File

@ -22,7 +22,7 @@ import (
"math/big"
"time"
"github.com/allegro/bigcache"
"github.com/VictoriaMetrics/fastcache"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/crypto"
@ -196,13 +196,7 @@ func generateSnapshot(db ethdb.KeyValueStore, journal string, root common.Hash)
return nil, err
}
// New snapshot generated, construct a brand new base layer
cache, _ := bigcache.NewBigCache(bigcache.Config{ // TODO(karalabe): dedup
Shards: 1024,
LifeWindow: time.Hour,
MaxEntriesInWindow: 512 * 1024,
MaxEntrySize: 512,
HardMaxCacheSize: 512,
})
cache := fastcache.New(512 * 1024 * 1024)
return &diskLayer{
journal: journal,
db: db,