set number of copies of rows/columns published

Sets how many copies are sent out by the block producer over
rows and over columns.
Note, previously this was set to match netDegree in both
dimensions. We keep this default.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2024-03-01 12:32:19 +01:00
parent 5b41cecb44
commit b22a096cbc
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
2 changed files with 9 additions and 3 deletions

View File

@ -41,7 +41,8 @@ class Simulator:
# pushed out by the proposer.
# 1: the data is sent out exactly once on rows and once on columns (2 copies in total)
# self.shape.netDegree: default behavior similar (but not same) to previous code
self.proposerPublishTo = self.shape.netDegree # TODO: make this an external parameter
self.proposerPublishToR = config.evalConf(self, config.proposerPublishToR, shape)
self.proposerPublishToC = config.evalConf(self, config.proposerPublishToR, shape)
def initValidators(self):
"""It initializes all the validators in the network."""
@ -171,12 +172,12 @@ class Simulator:
for v in self.validators:
if (self.proposerPublishOnly and v.amIproposer):
for id in v.rowIDs:
count = min(self.proposerPublishTo, len(rowChannels[id]))
count = min(self.proposerPublishToR, len(rowChannels[id]))
publishTo = random.sample(rowChannels[id], count)
for vi in publishTo:
v.rowNeighbors[id].update({vi.ID : Neighbor(vi, 0, self.shape.blockSizeR)})
for id in v.columnIDs:
count = min(self.proposerPublishTo, len(columnChannels[id]))
count = min(self.proposerPublishToC, len(columnChannels[id]))
publishTo = random.sample(columnChannels[id], count)
for vi in publishTo:
v.columnNeighbors[id].update({vi.ID : Neighbor(vi, 1, self.shape.blockSizeC)})

View File

@ -62,6 +62,11 @@ blockSizes = range(64, 113, 128)
# Per-topic mesh neighborhood size
netDegrees = range(8, 9, 2)
# How many copies are sent out by the block producer
# Note, previously this was set to match netDegree
proposerPublishToR = "shape.netDegree"
proposerPublishToC = "shape.netDegree"
# number of rows and columns a validator is interested in
chis = range(2, 3, 2)