Merge branch 'develop' into failureMode

This commit is contained in:
Csaba Kiraly 2023-05-02 15:05:54 +02:00 committed by GitHub
commit 16e32a3f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 11 deletions

View File

@ -81,7 +81,7 @@ class Simulator:
end = offset+((j+1)*self.shape.chi*self.shape.vpn2) end = offset+((j+1)*self.shape.chi*self.shape.vpn2)
r = rows[start:end] r = rows[start:end]
c = columns[start:end] c = columns[start:end]
val = Validator(i, int(not i!=0), self.logger, self.shape, r, c) val = Validator(i, int(not i!=0), self.logger, self.shape, self.config, r, c)
self.logger.debug("Node %d has row IDs: %s" % (val.ID, val.rowIDs), extra=self.format) self.logger.debug("Node %d has row IDs: %s" % (val.ID, val.rowIDs), extra=self.format)
self.logger.debug("Node %d has column IDs: %s" % (val.ID, val.columnIDs), extra=self.format) self.logger.debug("Node %d has column IDs: %s" % (val.ID, val.columnIDs), extra=self.format)
assignedRows = assignedRows + list(r) assignedRows = assignedRows + list(r)
@ -90,7 +90,11 @@ class Simulator:
self.nodeColumns.append(val.columnIDs) self.nodeColumns.append(val.columnIDs)
else: else:
val = Validator(i, int(not i!=0), self.logger, self.shape) val = Validator(i, int(not i!=0), self.logger, self.shape, self.config)
if i == self.proposerID:
val.initBlock()
else:
val.logIDs()
self.validators.append(val) self.validators.append(val)
assignedRows.sort() assignedRows.sort()

View File

@ -38,7 +38,7 @@ class Validator:
"""It returns the validator ID.""" """It returns the validator ID."""
return str(self.ID) return str(self.ID)
def __init__(self, ID, amIproposer, logger, shape, rows = None, columns = None): def __init__(self, ID, amIproposer, logger, shape, config, rows = None, columns = None):
"""It initializes the validator with the logger shape and rows/columns. """It initializes the validator with the logger shape and rows/columns.
If rows/columns are specified these are observed, otherwise (default) If rows/columns are specified these are observed, otherwise (default)
@ -87,15 +87,16 @@ class Validator:
self.statsRxDupInSlot = 0 self.statsRxDupInSlot = 0
self.statsRxDupPerSlot = [] self.statsRxDupPerSlot = []
# Set uplink bandwidth. In segments (~560 bytes) per timestep (50ms?) # Set uplink bandwidth.
# 1 Mbps ~= 1e6 / 20 / 8 / 560 ~= 11 # Assuming segments of ~560 bytes and timesteps of 50ms, we get
# TODO: this should be a parameter # 1 Mbps ~= 1e6 mbps * 0.050 s / (560*8) bits ~= 11 segments/timestep
if self.amIproposer: if self.amIproposer:
self.bwUplink = shape.bwUplinkProd self.bwUplink = shape.bwUplinkProd
elif self.nodeClass == 1: elif self.nodeClass == 1:
self.bwUplink = shape.bwUplink1 self.bwUplink = shape.bwUplink1
else: else:
self.bwUplink = shape.bwUplink2 self.bwUplink = shape.bwUplink2
self.bwUplink *= 1e3 / 8 * config.stepDuration / config.segmentSize
self.repairOnTheFly = True self.repairOnTheFly = True
self.sendLineUntil = (self.shape.blockSize + 1) // 2 # stop sending on a p2p link if at least this amount of samples passed self.sendLineUntil = (self.shape.blockSize + 1) // 2 # stop sending on a p2p link if at least this amount of samples passed

View File

@ -72,15 +72,17 @@ class1ratios = [0.8]
validatorsPerNode1 = [1] validatorsPerNode1 = [1]
validatorsPerNode2 = [500] validatorsPerNode2 = [500]
# Set uplink bandwidth. In segments (~560 bytes) per timestep (50ms?) # Set uplink bandwidth in megabits/second
# 1 Mbps ~= 1e6 / 20 / 8 / 560 ~= 11 bwUplinksProd = [200]
bwUplinksProd = [2200] bwUplinks1 = [10]
bwUplinks1 = [110] bwUplinks2 = [200]
bwUplinks2 = [2200]
# Step duration in miliseconds (Classic RTT is about 100ms) # Step duration in miliseconds (Classic RTT is about 100ms)
stepDuration = 50 stepDuration = 50
# Segment size in bytes (with proof)
segmentSize = 560
# Set to True if you want your run to be deterministic, False if not # Set to True if you want your run to be deterministic, False if not
deterministic = True deterministic = True