mirror of
https://github.com/status-im/das-research.git
synced 2025-02-22 19:38:14 +00:00
count number of validators having all rows/columns
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
bcf3098e9f
commit
037c4cd67a
@ -44,9 +44,12 @@ class Observer:
|
||||
"""It checks the status of how many expected and arrived samples globally."""
|
||||
arrived = 0
|
||||
expected = 0
|
||||
validated = 0
|
||||
for val in validators:
|
||||
if val.amIproposer == 0:
|
||||
(a, e) = val.checkStatus()
|
||||
arrived += a
|
||||
expected += e
|
||||
return (arrived, expected)
|
||||
if a == e:
|
||||
validated += 1
|
||||
return (arrived, expected, validated)
|
||||
|
@ -166,7 +166,7 @@ class Simulator:
|
||||
"""It runs the main simulation until the block is available or it gets stucked."""
|
||||
self.glob.checkRowsColumns(self.validators)
|
||||
self.validators[self.proposerID].broadcastBlock()
|
||||
arrived, expected = self.glob.checkStatus(self.validators)
|
||||
arrived, expected, validated = self.glob.checkStatus(self.validators)
|
||||
missingSamples = expected - arrived
|
||||
missingVector = []
|
||||
steps = 0
|
||||
@ -198,10 +198,12 @@ class Simulator:
|
||||
for i in range(0,self.shape.numberNodes):
|
||||
self.validators[i].updateStats()
|
||||
|
||||
arrived, expected = self.glob.checkStatus(self.validators)
|
||||
arrived, expected, validated = self.glob.checkStatus(self.validators)
|
||||
missingSamples = expected - arrived
|
||||
missingRate = missingSamples*100/expected
|
||||
self.logger.debug("step %d, missing %d of %d (%0.02f %%)" % (steps, missingSamples, expected, missingRate), extra=self.format)
|
||||
self.logger.debug("step %d, missing %d of %d (%0.02f %%), validated (%0.02f %%)"
|
||||
% (steps, missingSamples, expected, missingRate,
|
||||
validated/(len(self.validators)-1)*100), extra=self.format)
|
||||
if missingSamples == oldMissingSamples:
|
||||
self.logger.debug("The block cannot be recovered, failure rate %d!" % self.shape.failureRate, extra=self.format)
|
||||
missingVector.append(missingSamples)
|
||||
|
Loading…
x
Reference in New Issue
Block a user