diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 9b93c1c7f7..c254c9eeef 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -42,10 +42,10 @@ const ( ) var ( - blockCacheMaxItems = 32768 // Maximum number of blocks to cache before throttling the download - blockCacheInitialItems = 2048 // Initial number of blocks to start fetching, before we know the sizes of the blocks - blockCacheSizeWeight = 0.1 // Multiplier to approximate the average block size based on past ones - blockCacheMemory uint64 = 2 * 1024 * 1024 * 1024 // Maximum amount of memory to use for block caching + blockCacheMaxItems = 32768 // Maximum number of blocks to cache before throttling the download + blockCacheInitialItems = blockCacheMemory / (10 * 1024 * 1024) // Initial number of blocks to start fetching, before we know the sizes of the blocks + blockCacheSizeWeight = 0.1 // Multiplier to approximate the average block size based on past ones + blockCacheMemory uint64 = 2 * 1024 * 1024 * 1024 // Maximum amount of memory to use for block caching ) var ( diff --git a/eth/downloader/resultstore.go b/eth/downloader/resultstore.go index a6a94ca559..a6aebb848e 100644 --- a/eth/downloader/resultstore.go +++ b/eth/downloader/resultstore.go @@ -73,7 +73,6 @@ func (r *resultStore) SetThrottleTarget(targetRatio common.StorageSize) uint64 { return r.throttleThreshold } targetRatio = max(targetRatio, 0.1) - // use the target ratio to determine // (pendingGasUsed / target) <- estimated total size of collective in-flight retrievals estBlockSize := common.StorageSize(r.pendingGasUsed/uint64(r.pendingCount)) / targetRatio