From 80409802f9714f51db2e8b01ecba089d337037e7 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 12 Apr 2023 14:38:31 +0200 Subject: [PATCH] add simple gossipsub error model Signed-off-by: Csaba Kiraly --- DAS/simulator.py | 4 ++++ config_example.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/DAS/simulator.py b/DAS/simulator.py index 6a9db26..ac10925 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -129,6 +129,8 @@ class Simulator: if not nx.is_connected(G): self.logger.error("Graph not connected for row %d !" % id, extra=self.format) for u, v in G.edges: + if (random.randint(0,99) < self.config.gsEdgeFailureRate): + continue val1=rowChannels[id][u] val2=rowChannels[id][v] val1.rowNeighbors[id].update({val2.ID : Neighbor(val2, 0, self.shape.blockSize)}) @@ -145,6 +147,8 @@ class Simulator: if not nx.is_connected(G): self.logger.error("Graph not connected for column %d !" % id, extra=self.format) for u, v in G.edges: + if (random.randint(0,99) < self.config.gsEdgeFailureRate): + continue val1=columnChannels[id][u] val2=columnChannels[id][v] val1.columnNeighbors[id].update({val2.ID : Neighbor(val2, 1, self.shape.blockSize)}) diff --git a/config_example.py b/config_example.py index 7263ca1..625648d 100644 --- a/config_example.py +++ b/config_example.py @@ -48,6 +48,9 @@ blockSizes = range(32,65,16) # Per-topic mesh neighborhood size netDegrees = range(6, 9, 2) +# percentage of GossipSub mesh link failures +gsEdgeFailureRate = 0 + # number of rows and columns a validator is interested in chis = range(2, 5, 2)