From 8b7f061b12882057259e350e6c3abd98c05773dc Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Thu, 24 Apr 2025 18:19:30 +0800 Subject: [PATCH] fix ensure min target ratio when blocks use none/very-little gas --- eth/downloader/resultstore.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eth/downloader/resultstore.go b/eth/downloader/resultstore.go index 0bb0cf9df3..a6a94ca559 100644 --- a/eth/downloader/resultstore.go +++ b/eth/downloader/resultstore.go @@ -72,9 +72,8 @@ func (r *resultStore) SetThrottleTarget(targetRatio common.StorageSize) uint64 { if r.pendingCount == 0 { return r.throttleThreshold } - if targetRatio == 0 { - targetRatio = 0.1 // TODO: more informed choice of a minimum here? - } + 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