mirror of https://github.com/nucypher/nucypher.git
Round up the value of batch size and thread pool size which are both decimal factors of the threshold; without rounding up small threshold values can experience slower decryption executions for associated ritual.
parent
ffb34ad6f8
commit
eec504e54b
|
@ -1,3 +1,4 @@
|
|||
import math
|
||||
from http import HTTPStatus
|
||||
from random import shuffle
|
||||
from typing import Dict, List, Tuple
|
||||
|
@ -88,11 +89,13 @@ class ThresholdDecryptionClient(ThresholdAccessControlClient):
|
|||
worker=worker,
|
||||
value_factory=self.ThresholdDecryptionRequestFactory(
|
||||
ursulas_to_contact=requests,
|
||||
batch_size=int(threshold * 1.25),
|
||||
batch_size=math.ceil(threshold * 1.25),
|
||||
threshold=threshold,
|
||||
),
|
||||
target_successes=threshold,
|
||||
threadpool_size=int(threshold * 1.5), # TODO should we cap this (say 40?)
|
||||
threadpool_size=math.ceil(
|
||||
threshold * 1.5
|
||||
), # TODO should we cap this (say 40?)
|
||||
timeout=timeout,
|
||||
stagger_timeout=stagger_timeout,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue