Skip to content

Commit

Permalink
Add number_of_hops (for cover traffic) in config (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjoon-lee authored Nov 9, 2024
1 parent fbb37a4 commit a25bc27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions simlib/mixnet-sims/config/mixnode.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
"stake_proportion": 1.0,
"epoch_duration": "432000s",
"slot_duration": "1s",
"slots_per_epoch": 432000,
"number_of_hops": 1,
"persistent_transmission": {
"max_emission_frequency": 1.0,
"drop_message_probability": 0.0
},
"number_of_mix_layers": 1,
"max_delay_seconds": 10,
"slots_per_epoch": 432000
"max_delay_seconds": 10
}
2 changes: 1 addition & 1 deletion simlib/mixnet-sims/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl SimulationApp {
},
cover_traffic_settings: CoverTrafficSettings {
node_id: node_id.0,
number_of_hops: settings.number_of_mix_layers,
number_of_hops: settings.number_of_hops,
slots_per_epoch: settings.slots_per_epoch,
network_size: node_ids.len(),
},
Expand Down
6 changes: 5 additions & 1 deletion simlib/mixnet-sims/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ pub struct SimSettings {
#[serde(deserialize_with = "deserialize_duration_with_human_time")]
pub data_message_lottery_interval: Duration,
pub stake_proportion: f64,
// For tier 3: cover traffic
#[serde(deserialize_with = "deserialize_duration_with_human_time")]
pub epoch_duration: Duration,
#[serde(deserialize_with = "deserialize_duration_with_human_time")]
pub slot_duration: Duration,
pub slots_per_epoch: usize,
pub number_of_hops: usize,
// For tier 1
pub persistent_transmission: PersistentTransmissionSettings,
// For tier 2
pub number_of_mix_layers: usize,
pub max_delay_seconds: u64,
pub slots_per_epoch: usize,
}

fn deserialize_duration_with_human_time<'de, D>(deserializer: D) -> Result<Duration, D::Error>
Expand Down

0 comments on commit a25bc27

Please sign in to comment.