Play with thresholds some more
This commit is contained in:
parent
aab51731e1
commit
58de633f3d
|
@ -1,8 +1,8 @@
|
|||
use crate::{analysis::Analyzer, BridgeCountryInfo, BridgeInfoType};
|
||||
use crate::analysis::Analyzer;
|
||||
use lox_library::{
|
||||
bridge_table::MAX_BRIDGES_PER_BUCKET,
|
||||
proto::{
|
||||
level_up::{LEVEL_INTERVAL, LEVEL_INVITATIONS, MAX_LEVEL},
|
||||
level_up::{LEVEL_INTERVAL, LEVEL_INVITATIONS},
|
||||
trust_promotion::UNTRUSTED_INTERVAL,
|
||||
},
|
||||
OPENINV_K,
|
||||
|
@ -43,7 +43,7 @@ fn max_negative_reports(days: u32) -> u32 {
|
|||
|
||||
// Based on that, allow this many negative reports
|
||||
if max_users <= 10 {
|
||||
0
|
||||
1
|
||||
} else if max_users <= 30 {
|
||||
5
|
||||
} else {
|
||||
|
@ -53,7 +53,7 @@ fn max_negative_reports(days: u32) -> u32 {
|
|||
|
||||
fn too_few_bridge_ips(
|
||||
days: u32,
|
||||
max_bridge_ips: u32,
|
||||
_max_bridge_ips: u32,
|
||||
bridge_ips_today: u32,
|
||||
positive_reports_today: u32,
|
||||
) -> bool {
|
||||
|
@ -63,28 +63,17 @@ fn too_few_bridge_ips(
|
|||
// Based on that, expect this many bridge ips
|
||||
let min_bip = if max_users <= 16 {
|
||||
// expect 10
|
||||
8
|
||||
0
|
||||
} else if max_users <= 40 {
|
||||
// expect 30
|
||||
16
|
||||
8
|
||||
} else if max_users <= 96 {
|
||||
// expect 90
|
||||
24
|
||||
16
|
||||
} else {
|
||||
// also 32, but it could be something else
|
||||
32
|
||||
};
|
||||
|
||||
// If we normally see low usage, halve the minimum
|
||||
let min_bip = if max_bridge_ips <= 8 {
|
||||
// If we have 1-8 users, allow the number to be 0
|
||||
0
|
||||
} else if max_bridge_ips <= max_users / 2 {
|
||||
min_bip / 2
|
||||
} else {
|
||||
min_bip
|
||||
};
|
||||
|
||||
// If we see positive reports from trusted users, halve the minimum
|
||||
let min_bip = if positive_reports_today > 0 {
|
||||
min_bip / 2
|
||||
|
|
Loading…
Reference in New Issue