From f3eb148f47ab3dee4d769b82ffff0ebbbf550a08 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:41:31 +0900 Subject: [PATCH] comments for yaml --- mixnet/sim/config.py | 13 +++++++++++++ mixnet/sim/config.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mixnet/sim/config.py b/mixnet/sim/config.py index f2c5f2e..ebd79df 100644 --- a/mixnet/sim/config.py +++ b/mixnet/sim/config.py @@ -37,6 +37,8 @@ class Config: @dataclass class SimulationConfig: + # Desired duration of the simulation in seconds + # Since the simulation uses discrete time steps, the actual duration may be longer or shorter. duration_sec: int network: NetworkConfig @@ -47,7 +49,10 @@ class SimulationConfig: @dataclass class NetworkConfig: + # Maximum network latency between nodes in seconds. + # A constant latency will be chosen randomly for each connection within the range [0, max_latency_sec]. max_latency_sec: float + # Seed for the random number generator used to determine the network latencies. seed: random.Random def validate(self): @@ -69,8 +74,11 @@ class LogicConfig: @dataclass class LotteryConfig: + # Interval between lottery draws in seconds. interval_sec: float + # Probability of a node being selected as a sender in each lottery draw. probability: float + # Seed for the random number generator used to determine the lottery winners. seed: random.Random def validate(self): @@ -81,7 +89,9 @@ class LotteryConfig: @dataclass class MixnetConfig: + # Total number of nodes in the entire network. num_nodes: int + # Global constant transmission rate of each connection in messages per second. transmission_rate_per_sec: int peering: PeeringConfig mix_path: MixPathConfig @@ -110,6 +120,7 @@ class MixnetConfig: @dataclass class PeeringConfig: + # Target number of peers each node can connect to (both inbound and outbound). degree: int def validate(self): @@ -118,7 +129,9 @@ class PeeringConfig: @dataclass class MixPathConfig: + # Maximum number of mix nodes to be chosen for a Sphinx packet. max_length: int + # Seed for the random number generator used to determine the mix path. seed: random.Random def validate(self): diff --git a/mixnet/sim/config.yaml b/mixnet/sim/config.yaml index 8ec4f1d..bbe5465 100644 --- a/mixnet/sim/config.yaml +++ b/mixnet/sim/config.yaml @@ -1,20 +1,33 @@ simulation: + # Desired duration of the simulation in seconds + # Since the simulation uses discrete time steps, the actual duration may be longer or shorter. duration_sec: 1000 network: + # Maximum network latency between nodes in seconds. + # A constant latency will be chosen randomly for each connection within the range [0, max_latency_sec]. max_latency_sec: 0.1 + # Seed for the random number generator used to determine the network latencies. seed: 0 logic: sender_lottery: + # Interval between lottery draws in seconds. interval_sec: 1 + # Probability of a node being selected as a sender in each lottery draw. probability: 0.001 + # Seed for the random number generator used to determine the lottery winners. seed: 10 mixnet: + # Total number of nodes in the entire network. num_nodes: 5 + # Global constant transmission rate of each connection in messages per second. transmission_rate_per_sec: 10 peering: + # Target number of peers each node can connect to (both inbound and outbound). degree: 6 mix_path: + # Maximum number of mix nodes to be chosen for a Sphinx packet. max_length: 3 + # Seed for the random number generator used to determine the mix path. seed: 3