From 2707269836abe0542fc5ba87d3d44e2f2761362c Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Thu, 23 Feb 2023 22:21:16 +0100 Subject: [PATCH] fixup: moving simulator config to resetShape Signed-off-by: Csaba Kiraly --- DAS/simulator.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DAS/simulator.py b/DAS/simulator.py index 506775c..74d310e 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -22,18 +22,6 @@ class Simulator: self.proposerID = 0 self.glob = [] - # In GossipSub the initiator might push messages without participating in the mesh. - # proposerPublishOnly regulates this behavior. If set to true, the proposer is not - # part of the p2p distribution graph, only pushes segments to it. If false, the proposer - # might get back segments from other peers since links are symmetric. - self.proposerPublishOnly = True - - # If proposerPublishOnly == True, this regulates how many copies of each segment are - # 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 - def initValidators(self): """It initializes all the validators in the network.""" self.glob = Observer(self.logger, self.shape) @@ -132,6 +120,18 @@ class Simulator: val.shape.failureRate = shape.failureRate val.shape.chi = shape.chi + # In GossipSub the initiator might push messages without participating in the mesh. + # proposerPublishOnly regulates this behavior. If set to true, the proposer is not + # part of the p2p distribution graph, only pushes segments to it. If false, the proposer + # might get back segments from other peers since links are symmetric. + self.proposerPublishOnly = True + + # If proposerPublishOnly == True, this regulates how many copies of each segment are + # 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 + def run(self): """It runs the main simulation until the block is available or it gets stucked."""