mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
fix ensure min target ratio when blocks use none/very-little gas
This commit is contained in:
parent
03b8cc8eb9
commit
8b7f061b12
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue