diff --git a/erigon-lib/state/cache.go b/erigon-lib/state/cache.go index 08d5c86359e..20b0b442996 100644 --- a/erigon-lib/state/cache.go +++ b/erigon-lib/state/cache.go @@ -90,8 +90,9 @@ func (v *domainVisible) returnGetFromFileCache(c *DomainGetFromFileCache) { } var ( - iiGetFromFileCacheLimit = uint32(dbg.EnvInt("II_LRU", 4096)) - iiGetFromFileCacheTrace = dbg.EnvBool("II_LRU_TRACE", false) + iiGetFromFileCacheLimit = uint32(dbg.EnvInt("II_LRU", 4096)) + iiGetFromFileCacheTrace = dbg.EnvBool("II_LRU_TRACE", false) + iiGetFromFileCacheEnabled = dbg.EnvBool("II_LRU_ENABLED", true) ) type IISeekInFilesCache struct { @@ -104,6 +105,9 @@ type iiSeekInFilesCacheItem struct { } func NewIISeekInFilesCache() *IISeekInFilesCache { + if !iiGetFromFileCacheEnabled { + return nil + } c, err := freelru.New[u128, iiSeekInFilesCacheItem](iiGetFromFileCacheLimit, u128noHash) if err != nil { panic(err)