diff --git a/simlib/netrunner/config/mixnode.json b/simlib/mixnet-sims/config/mixnode.json similarity index 62% rename from simlib/netrunner/config/mixnode.json rename to simlib/mixnet-sims/config/mixnode.json index ff47f3d..8c9b3b0 100644 --- a/simlib/netrunner/config/mixnode.json +++ b/simlib/mixnet-sims/config/mixnode.json @@ -29,11 +29,23 @@ "seed": 0, "record_settings": {}, "wards": [ - { - "max": 10 - }, - { - "sum": 10 - } - ] + { + "max": 10 + }, + { + "sum": 10 + } + ], + "connected_peers_count": 3, + "data_message_lottery_interval": "20s", + "stake_proportion": "1.0", + "epoch_duration": "432000s", + "slot_duration": "20s", + "persistent_transmission": { + "max_emission_frequency": "1.0", + "drop_message_probability": "0.0" + }, + "number_of_mix_layers": 4, + "max_delay_seconds": 10, + "slots_per_epoch": 21600 } diff --git a/simlib/mixnet-sims/src/main.rs b/simlib/mixnet-sims/src/main.rs index bdae65b..3353c1b 100644 --- a/simlib/mixnet-sims/src/main.rs +++ b/simlib/mixnet-sims/src/main.rs @@ -24,7 +24,7 @@ use parking_lot::Mutex; use rand::prelude::IteratorRandom; use rand::rngs::SmallRng; use rand::seq::SliceRandom; -use rand::SeedableRng; +use rand::{RngCore, SeedableRng}; use serde::de::DeserializeOwned; use serde::Serialize; // internal @@ -108,7 +108,7 @@ impl SimulationApp { .choose_multiple(&mut rng, settings.connected_peers_count), data_message_lottery_interval: settings.data_message_lottery_interval, stake_proportion: settings.stake_proportion / node_ids.len() as f64, - seed: settings.seed, + seed: rng.next_u64(), epoch_duration: settings.epoch_duration, // 5 days seconds slot_duration: settings.slot_duration, persistent_transmission: settings.persistent_transmission, @@ -118,7 +118,7 @@ impl SimulationApp { num_mix_layers: settings.number_of_mix_layers, }, temporal_processor: TemporalSchedulerSettings { - max_delay_seconds: settings.max_delay_secconds, + max_delay_seconds: settings.max_delay_seconds, }, }, cover_traffic_settings: CoverTrafficSettings { diff --git a/simlib/mixnet-sims/src/settings.rs b/simlib/mixnet-sims/src/settings.rs index c710c50..c057eb9 100644 --- a/simlib/mixnet-sims/src/settings.rs +++ b/simlib/mixnet-sims/src/settings.rs @@ -10,11 +10,10 @@ pub struct SimSettings { pub connected_peers_count: usize, pub data_message_lottery_interval: Duration, pub stake_proportion: f64, - pub seed: u64, pub epoch_duration: Duration, pub slot_duration: Duration, pub persistent_transmission: PersistentTransmissionSettings, pub number_of_mix_layers: usize, - pub max_delay_secconds: u64, + pub max_delay_seconds: u64, pub slots_per_epoch: usize, } diff --git a/simlib/netrunner/config/carnot_dev.json b/simlib/netrunner/config/carnot_dev.json deleted file mode 100644 index b98ced2..0000000 --- a/simlib/netrunner/config/carnot_dev.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "network_settings": { - "network_behaviors": { - "north america:north america": "10ms", - "north america:europe": "150ms", - "north america:asia": "250ms", - "europe:europe": "10ms", - "europe:asia": "200ms", - "europe:north america": "150ms", - "asia:north america": "250ms", - "asia:europe": "200ms", - "asia:asia": "10ms" - }, - "regions": { - "north america": 0.4, - "europe": 0.3, - "asia": 0.3 - } - }, - "overlay_settings": { - "number_of_committees": 7 - }, - "node_settings": { - "network_capacity_kbps": 10000024, - "timeout": "10000ms" - }, - "step_time": "100ms", - "runner_settings": "Sync", - "stream_settings": { - "path": "tree_500_7_view_1_default.csv", - "format": "csv" - }, - "node_count": 500, - "views_count": 10, - "leaders_count": 1, - "seed": 0, - "wards": [ - { - "max_view": 1 - }, - { - "stalled_view": { - "consecutive_viewed_checkpoint": null, - "criterion": 0, - "threshold": 100 - } - } - ], - "record_settings": { - "current_view": true, - "highest_voted_view": true, - "local_high_qc": true, - "safe_blocks": false, - "last_view_timeout_qc": true, - "latest_committed_block": true, - "latest_committed_view": true, - "root_committee": false, - "parent_committee": false, - "child_committees": false, - "committed_blocks": false - } -} \ No newline at end of file