Merge pull request #39 from status-im/successCondition
Changing the success condition
This commit is contained in:
commit
5aa364db8f
|
@ -1,6 +1,7 @@
|
|||
#!/bin/python3
|
||||
|
||||
import os
|
||||
import bisect
|
||||
from xml.dom import minidom
|
||||
from dicttoxml import dicttoxml
|
||||
|
||||
|
@ -20,10 +21,11 @@ class Result:
|
|||
"""It populates part of the result data inside a vector."""
|
||||
self.shape = shape
|
||||
self.missingVector = missingVector
|
||||
missingSamples = missingVector[-1]
|
||||
if missingSamples == 0:
|
||||
v = self.metrics["progress"]["validators ready"]
|
||||
tta = bisect.bisect(v, config.successCondition)
|
||||
if v[-1] >= config.successCondition:
|
||||
self.blockAvailable = 1
|
||||
self.tta = len(missingVector) * (config.stepDuration)
|
||||
self.tta = tta * (config.stepDuration)
|
||||
else:
|
||||
self.blockAvailable = 0
|
||||
self.tta = -1
|
||||
|
|
|
@ -76,6 +76,9 @@ randomSeed = "DAS"
|
|||
# Number of steps without progress to stop simulation
|
||||
steps4StopCondition = 7
|
||||
|
||||
# Number of validators ready to asume block is available
|
||||
successCondition = 0.9
|
||||
|
||||
# If True, print diagnostics when the block is not available
|
||||
diagnostics = False
|
||||
|
||||
|
|
Loading…
Reference in New Issue