config.rs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. use crate::simulation::censor;
  2. use lox_cli::networking::*;
  3. use lox_library::IssuerPubKey;
  4. pub struct Config {
  5. pub la_pubkeys: Vec<IssuerPubKey>,
  6. pub la_net: HyperNet,
  7. pub tp_net: HyperNet,
  8. // Define censor behavior
  9. pub censor_secrecy: censor::Secrecy,
  10. pub censor_speed: censor::Speed,
  11. pub censor_event_duration: u32,
  12. pub censor_totality: censor::Totality,
  13. pub censor_partial_blocking_percent: f64,
  14. // We model only one country at a time because Lox assumes censors
  15. // share information with each other.
  16. pub country: String,
  17. pub one_positive_report_per_cred: bool,
  18. // Probability that a censor-cooperating user can convince an honest
  19. // user to give them an invite.
  20. pub prob_censor_gets_invite: f64,
  21. // Probability that a connection randomly fails, even though censor
  22. // does not block the bridge
  23. pub prob_connection_fails: f64,
  24. pub prob_user_invites_friend: f64,
  25. pub prob_user_is_censor: f64,
  26. pub prob_user_submits_reports: f64,
  27. pub prob_user_treats_throttling_as_blocking: f64,
  28. }