mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-07 07:33:09 +00:00
show detailed plot in bulk
This commit is contained in:
parent
af94346279
commit
57c027c55a
@ -39,13 +39,19 @@ def bulk_run():
|
||||
|
||||
for p2p_type in [P2PConfig.TYPE_ONE_TO_ALL, P2PConfig.TYPE_GOSSIP]:
|
||||
config.p2p.type = p2p_type
|
||||
for num_nodes in [10, 100, 1000]:
|
||||
|
||||
num_nodes_list = [10, 100, 1000]
|
||||
for i, num_nodes in enumerate(num_nodes_list):
|
||||
config.mixnet.num_nodes = num_nodes
|
||||
sim = Simulation(config)
|
||||
sim.run()
|
||||
|
||||
if message_size_df is None:
|
||||
message_size_df = Analysis(sim, config).message_size_distribution()
|
||||
|
||||
if i == len(num_nodes_list) - 1:
|
||||
Analysis(sim, config).run()
|
||||
|
||||
nonzero_ingresses, nonzero_egresses = [], []
|
||||
for ingress_bandwidths, egress_bandwidths in zip(sim.p2p.measurement.ingress_bandwidth_per_time,
|
||||
sim.p2p.measurement.egress_bandwidth_per_time):
|
||||
|
||||
@ -86,7 +86,7 @@ class Node:
|
||||
if isinstance(msg, SphinxPacket):
|
||||
msg, incentive_tx = msg.unwrap(self.private_key)
|
||||
if self.is_my_incentive_tx(incentive_tx):
|
||||
self.log("Receiving SphinxPacket. It's mine!")
|
||||
# self.log("Receiving SphinxPacket. It's mine!")
|
||||
if msg.is_all_unwrapped():
|
||||
final_padded_msg = self.pad_payload(msg.payload, len(msg))
|
||||
self.env.process(self.p2p.broadcast(self, final_padded_msg))
|
||||
@ -94,8 +94,8 @@ class Node:
|
||||
# TODO: use Poisson delay or something else, if necessary
|
||||
yield self.env.timeout(random.uniform(0, self.config.mixnet.max_mix_delay))
|
||||
self.env.process(self.p2p.broadcast(self, msg))
|
||||
else:
|
||||
self.log("Receiving SphinxPacket, but not mine")
|
||||
# else:
|
||||
# self.log("Receiving SphinxPacket, but not mine")
|
||||
else:
|
||||
final_msg = msg[:msg.rfind(self.PADDING_SEPARATOR)]
|
||||
self.log("Received final message: %s" % final_msg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user