Merge pull request #39 from status-im/successCondition

Changing the success condition
This commit is contained in:
Leo 2023-04-17 11:16:24 +02:00 committed by GitHub
commit 5aa364db8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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