full nodes (1st class) and validator nodes (2nd class)
This is a hack to see how differentiating node classes work. A more generic setup is needed with configurable parameters. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
140ab45848
commit
1bf1a9aa83
|
@ -48,6 +48,8 @@ class Simulator:
|
|||
self.glob = Observer(self.logger, self.shape)
|
||||
self.validators = []
|
||||
if self.config.evenLineDistribution:
|
||||
self.logger.error("evenLineDistribution NOT YET SUPPORTED.", extra=self.format)
|
||||
exit(1)
|
||||
|
||||
lightNodes = int(self.shape.numberNodes * self.shape.class1ratio)
|
||||
heavyNodes = self.shape.numberNodes - lightNodes
|
||||
|
@ -102,12 +104,18 @@ class Simulator:
|
|||
elif self.shape.chiR > self.shape.blockSizeC:
|
||||
self.logger.error("ChiR has to be smaller than %d" % self.shape.blockSizeC)
|
||||
|
||||
vs = []
|
||||
nodeClass = 1 if (i <= self.shape.numberNodes * self.shape.class1ratio) else 2
|
||||
vpn = self.shape.vpn1 if (nodeClass == 1) else self.shape.vpn2
|
||||
for v in range(vpn):
|
||||
vs.append(initValidator(self.shape.blockSizeC, self.shape.chiR, self.shape.blockSizeR, self.shape.chiC))
|
||||
val = Node(i, int(not i!=0), self.logger, self.shape, self.config, vs)
|
||||
if nodeClass == 1: # nodes
|
||||
validators = []
|
||||
rows = set()
|
||||
columns = set(random.sample(range(self.shape.blockSizeR), self.shape.chiC))
|
||||
val = Node(i, int(not i!=0), self.logger, self.shape, self.config, validators, rows, columns)
|
||||
else: # validators
|
||||
validators = []
|
||||
vpn = self.shape.vpn1 if (nodeClass == 1) else self.shape.vpn2
|
||||
for _ in range(vpn):
|
||||
validators.append(initValidator(self.shape.blockSizeC, self.shape.chiR, self.shape.blockSizeR, 0))
|
||||
val = Node(i, int(not i!=0), self.logger, self.shape, self.config, validators)
|
||||
if i == self.proposerID:
|
||||
val.initBlock()
|
||||
else:
|
||||
|
|
16
subnetDas.py
16
subnetDas.py
|
@ -48,7 +48,7 @@ evenLineDistribution = False
|
|||
runs = [1]
|
||||
|
||||
# Number of validators
|
||||
numberNodes = [4000]
|
||||
numberNodes = [1000]
|
||||
|
||||
# select failure model between: "random, sequential, MEP, MEP+1, DEP, DEP+1, MREP, MREP-1"
|
||||
failureModels = ["random"]
|
||||
|
@ -70,20 +70,20 @@ rowsN = rowsK
|
|||
netDegrees = [8]
|
||||
|
||||
# number of rows and columns a validator is interested in
|
||||
chiR = 1
|
||||
chiC = 1
|
||||
chiR = 1 # Number of rows observed by validators (not Beacon nodes with validators, but individual validators)
|
||||
chiC = 16 # Number of columns observed by full nodes
|
||||
|
||||
# ratio of class1 nodes (see below for parameters per class)
|
||||
class1ratios = [1]
|
||||
class1ratios = [.5]
|
||||
|
||||
# Number of validators per beacon node
|
||||
validatorsPerNode1 = [1]
|
||||
validatorsPerNode2 = [500]
|
||||
validatorsPerNode1 = [0] # Full nodes, without validators
|
||||
validatorsPerNode2 = [500] # Nodes with validators
|
||||
|
||||
# Set uplink bandwidth in megabits/second
|
||||
bwUplinksProd = [200]
|
||||
bwUplinks1 = [10]
|
||||
bwUplinks2 = [200]
|
||||
bwUplinks1 = [10] # Full nodes
|
||||
bwUplinks2 = [200] # Nodes with validators
|
||||
|
||||
# Step duration in miliseconds (Classic RTT is about 100ms)
|
||||
stepDuration = 50
|
||||
|
|
Loading…
Reference in New Issue