mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-05-23 09:39:26 +00:00
comments for yaml
This commit is contained in:
parent
59be969fbc
commit
f3eb148f47
@ -37,6 +37,8 @@ class Config:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SimulationConfig:
|
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
|
duration_sec: int
|
||||||
network: NetworkConfig
|
network: NetworkConfig
|
||||||
|
|
||||||
@ -47,7 +49,10 @@ class SimulationConfig:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class NetworkConfig:
|
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
|
max_latency_sec: float
|
||||||
|
# Seed for the random number generator used to determine the network latencies.
|
||||||
seed: random.Random
|
seed: random.Random
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
@ -69,8 +74,11 @@ class LogicConfig:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class LotteryConfig:
|
class LotteryConfig:
|
||||||
|
# Interval between lottery draws in seconds.
|
||||||
interval_sec: float
|
interval_sec: float
|
||||||
|
# Probability of a node being selected as a sender in each lottery draw.
|
||||||
probability: float
|
probability: float
|
||||||
|
# Seed for the random number generator used to determine the lottery winners.
|
||||||
seed: random.Random
|
seed: random.Random
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
@ -81,7 +89,9 @@ class LotteryConfig:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MixnetConfig:
|
class MixnetConfig:
|
||||||
|
# Total number of nodes in the entire network.
|
||||||
num_nodes: int
|
num_nodes: int
|
||||||
|
# Global constant transmission rate of each connection in messages per second.
|
||||||
transmission_rate_per_sec: int
|
transmission_rate_per_sec: int
|
||||||
peering: PeeringConfig
|
peering: PeeringConfig
|
||||||
mix_path: MixPathConfig
|
mix_path: MixPathConfig
|
||||||
@ -110,6 +120,7 @@ class MixnetConfig:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class PeeringConfig:
|
class PeeringConfig:
|
||||||
|
# Target number of peers each node can connect to (both inbound and outbound).
|
||||||
degree: int
|
degree: int
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
@ -118,7 +129,9 @@ class PeeringConfig:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MixPathConfig:
|
class MixPathConfig:
|
||||||
|
# Maximum number of mix nodes to be chosen for a Sphinx packet.
|
||||||
max_length: int
|
max_length: int
|
||||||
|
# Seed for the random number generator used to determine the mix path.
|
||||||
seed: random.Random
|
seed: random.Random
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
|||||||
@ -1,20 +1,33 @@
|
|||||||
simulation:
|
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
|
duration_sec: 1000
|
||||||
network:
|
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
|
max_latency_sec: 0.1
|
||||||
|
# Seed for the random number generator used to determine the network latencies.
|
||||||
seed: 0
|
seed: 0
|
||||||
|
|
||||||
logic:
|
logic:
|
||||||
sender_lottery:
|
sender_lottery:
|
||||||
|
# Interval between lottery draws in seconds.
|
||||||
interval_sec: 1
|
interval_sec: 1
|
||||||
|
# Probability of a node being selected as a sender in each lottery draw.
|
||||||
probability: 0.001
|
probability: 0.001
|
||||||
|
# Seed for the random number generator used to determine the lottery winners.
|
||||||
seed: 10
|
seed: 10
|
||||||
|
|
||||||
mixnet:
|
mixnet:
|
||||||
|
# Total number of nodes in the entire network.
|
||||||
num_nodes: 5
|
num_nodes: 5
|
||||||
|
# Global constant transmission rate of each connection in messages per second.
|
||||||
transmission_rate_per_sec: 10
|
transmission_rate_per_sec: 10
|
||||||
peering:
|
peering:
|
||||||
|
# Target number of peers each node can connect to (both inbound and outbound).
|
||||||
degree: 6
|
degree: 6
|
||||||
mix_path:
|
mix_path:
|
||||||
|
# Maximum number of mix nodes to be chosen for a Sphinx packet.
|
||||||
max_length: 3
|
max_length: 3
|
||||||
|
# Seed for the random number generator used to determine the mix path.
|
||||||
seed: 3
|
seed: 3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user