@@ -19,9 +19,8 @@ package snapshot
1919import (
2020 "fmt"
2121 "testing"
22- "time"
2322
24- "github.com/allegro/bigcache "
23+ "github.com/VictoriaMetrics/fastcache "
2524 "github.com/ethereum/go-ethereum/common"
2625 "github.com/ethereum/go-ethereum/core/rawdb"
2726)
@@ -31,11 +30,10 @@ import (
3130// to check internal corner case around the bottom-most memory accumulator.
3231func TestDiskLayerExternalInvalidationFullFlatten (t * testing.T ) {
3332 // Create an empty base layer and a snapshot tree out of it
34- cache , _ := bigcache .NewBigCache (bigcache .DefaultConfig (time .Minute ))
3533 base := & diskLayer {
3634 db : rawdb .NewMemoryDatabase (),
3735 root : common .HexToHash ("0x01" ),
38- cache : cache ,
36+ cache : fastcache . New ( 1024 * 500 ) ,
3937 }
4038 snaps := & Tree {
4139 layers : map [common.Hash ]snapshot {
@@ -77,11 +75,10 @@ func TestDiskLayerExternalInvalidationFullFlatten(t *testing.T) {
7775// layer to check the usual mode of operation where the accumulator is retained.
7876func TestDiskLayerExternalInvalidationPartialFlatten (t * testing.T ) {
7977 // Create an empty base layer and a snapshot tree out of it
80- cache , _ := bigcache .NewBigCache (bigcache .DefaultConfig (time .Minute ))
8178 base := & diskLayer {
8279 db : rawdb .NewMemoryDatabase (),
8380 root : common .HexToHash ("0x01" ),
84- cache : cache ,
81+ cache : fastcache . New ( 1024 * 500 ) ,
8582 }
8683 snaps := & Tree {
8784 layers : map [common.Hash ]snapshot {
@@ -126,11 +123,10 @@ func TestDiskLayerExternalInvalidationPartialFlatten(t *testing.T) {
126123// to check internal corner case around the bottom-most memory accumulator.
127124func TestDiffLayerExternalInvalidationFullFlatten (t * testing.T ) {
128125 // Create an empty base layer and a snapshot tree out of it
129- cache , _ := bigcache .NewBigCache (bigcache .DefaultConfig (time .Minute ))
130126 base := & diskLayer {
131127 db : rawdb .NewMemoryDatabase (),
132128 root : common .HexToHash ("0x01" ),
133- cache : cache ,
129+ cache : fastcache . New ( 1024 * 500 ) ,
134130 }
135131 snaps := & Tree {
136132 layers : map [common.Hash ]snapshot {
@@ -175,11 +171,10 @@ func TestDiffLayerExternalInvalidationFullFlatten(t *testing.T) {
175171// layer to check the usual mode of operation where the accumulator is retained.
176172func TestDiffLayerExternalInvalidationPartialFlatten (t * testing.T ) {
177173 // Create an empty base layer and a snapshot tree out of it
178- cache , _ := bigcache .NewBigCache (bigcache .DefaultConfig (time .Minute ))
179174 base := & diskLayer {
180175 db : rawdb .NewMemoryDatabase (),
181176 root : common .HexToHash ("0x01" ),
182- cache : cache ,
177+ cache : fastcache . New ( 1024 * 500 ) ,
183178 }
184179 snaps := & Tree {
185180 layers : map [common.Hash ]snapshot {
@@ -240,11 +235,10 @@ func TestPostCapBasicDataAccess(t *testing.T) {
240235 }
241236 }
242237 // Create a starting base layer and a snapshot tree out of it
243- cache , _ := bigcache .NewBigCache (bigcache .DefaultConfig (time .Minute ))
244238 base := & diskLayer {
245239 db : rawdb .NewMemoryDatabase (),
246240 root : common .HexToHash ("0x01" ),
247- cache : cache ,
241+ cache : fastcache . New ( 1024 * 500 ) ,
248242 }
249243 snaps := & Tree {
250244 layers : map [common.Hash ]snapshot {
0 commit comments