add simple gossipsub error model

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2023-04-12 14:38:31 +02:00
parent 5aa364db8f
commit 80409802f9
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
2 changed files with 7 additions and 0 deletions

View File

@ -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)})

View File

@ -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)