From f1ec226d8069fcc4f79cbcec2bf0d1bb4795beb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 8 Feb 2016 14:57:02 +0200 Subject: eth/downloader: raise pending state limit that prevented concurrency --- eth/downloader/downloader.go | 1 - eth/downloader/queue.go | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'eth') diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 163994730..698b99f8b 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -59,7 +59,6 @@ var ( maxQueuedHashes = 256 * 1024 // [eth/61] Maximum number of hashes to queue for import (DOS protection) maxQueuedHeaders = 256 * 1024 // [eth/62] Maximum number of headers to queue for import (DOS protection) - maxQueuedStates = 256 * 1024 // [eth/63] Maximum number of state requests to queue (DOS protection) maxResultsProcess = 256 // Number of download results to import at once into the chain fsHeaderCheckFrequency = 100 // Verification frequency of the downloaded headers during fast sync diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 1e55560db..9d0f2914d 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -39,7 +39,8 @@ import ( ) var ( - blockCacheLimit = 1024 // Maximum number of blocks to cache before throttling the download + blockCacheLimit = 1024 // Maximum number of blocks to cache before throttling the download + maxInFlightStates = 4096 // Maximum number of state downloads to allow concurrently ) var ( @@ -464,7 +465,7 @@ func (q *queue) ReserveNodeData(p *peer, count int) *fetchRequest { q.lock.Lock() defer q.lock.Unlock() - return q.reserveHashes(p, count, q.stateTaskQueue, generator, q.statePendPool, count) + return q.reserveHashes(p, count, q.stateTaskQueue, generator, q.statePendPool, maxInFlightStates) } // reserveHashes reserves a set of hashes for the given peer, skipping previously -- cgit v1.2.3