config.rs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. // The maximum number of connections for the censor to make to each
  12. // bridge
  13. pub censor_max_connections: u32,
  14. // The maximum number of positive reports for the censor to submit
  15. pub censor_max_pr: u32,
  16. pub censor_speed: censor::Speed,
  17. pub censor_event_duration: u32,
  18. pub censor_totality: censor::Totality,
  19. pub censor_partial_blocking_percent: f64,
  20. // We model only one country at a time because Lox assumes censors
  21. // share information with each other.
  22. pub country: String,
  23. pub one_positive_report_per_cred: bool,
  24. // Probability that a censor-cooperating user can convince an honest
  25. // user to give them an invite. This number is the baseline, for
  26. // soliciting an invitation from a level 1 user. We assume it is
  27. // harder for the censor to get invitations from higher-level users.
  28. pub prob_censor_gets_invite: f64,
  29. // Probability that a connection randomly fails, even though censor
  30. // does not block the bridge
  31. pub prob_connection_fails: f64,
  32. // If the connection fails, retry how many times?
  33. pub num_connection_retries: u32,
  34. pub prob_user_connects: f64,
  35. pub prob_user_invites_friend: f64,
  36. pub prob_user_submits_reports: f64,
  37. pub prob_user_treats_throttling_as_blocking: f64,
  38. }