config.rs 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. use crate::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. pub bootstrapping_period_duration: u32,
  9. // Define censor behavior
  10. pub censor_secrecy: censor::Secrecy,
  11. pub censor_speed: censor::Speed,
  12. pub censor_event_duration: u32,
  13. pub censor_totality: censor::Totality,
  14. pub censor_partial_blocking_percent: f64,
  15. // We model only one country at a time because Lox assumes censors
  16. // share information with each other.
  17. pub country: String,
  18. pub one_positive_report_per_cred: bool,
  19. // Probability that a censor-cooperating user can convince an honest
  20. // user to give them an invite. This number is the baseline, for
  21. // soliciting an invitation from a level 1 user. We assume it is
  22. // harder for the censor to get invitations from higher-level users.
  23. pub prob_censor_gets_invite: f64,
  24. // Probability that a connection randomly fails, even though censor
  25. // does not block the bridge
  26. pub prob_connection_fails: f64,
  27. // If the connection fails, retry how many times?
  28. pub num_connection_retries: u32,
  29. pub prob_user_invites_friend: f64,
  30. pub prob_user_submits_reports: f64,
  31. pub prob_user_treats_throttling_as_blocking: f64,
  32. }