diff --git a/coverage_point_calculator/src/lib.rs b/coverage_point_calculator/src/lib.rs index dcd87b05d..25ebb0875 100644 --- a/coverage_point_calculator/src/lib.rs +++ b/coverage_point_calculator/src/lib.rs @@ -115,7 +115,7 @@ pub struct CoveragePoints { /// Input Radio Type pub radio_type: RadioType, /// Input RadioThreshold - pub radio_threshold: RadioThreshold, + pub service_provider_boosted_reward_eligibility: ServiceProviderBoostedRewardEligibility, /// Derived Eligibility for Boosted Hex Rewards pub boosted_hex_eligibility: BoostedHexStatus, /// Speedtests used in calculcation @@ -129,7 +129,7 @@ pub struct CoveragePoints { impl CoveragePoints { pub fn new( radio_type: RadioType, - radio_threshold: RadioThreshold, + service_provider_boosted_reward_eligibility: ServiceProviderBoostedRewardEligibility, speedtests: Vec, trust_scores: Vec, ranked_coverage: Vec, @@ -137,8 +137,11 @@ impl CoveragePoints { let location_trust_scores = location::clean_trust_scores(trust_scores, &ranked_coverage); let location_trust_multiplier = location::multiplier(radio_type, &location_trust_scores); - let boost_eligibility = - BoostedHexStatus::new(&radio_type, location_trust_multiplier, &radio_threshold); + let boost_eligibility = BoostedHexStatus::new( + &radio_type, + location_trust_multiplier, + &service_provider_boosted_reward_eligibility, + ); let covered_hexes = hexes::clean_covered_hexes(radio_type, boost_eligibility, ranked_coverage)?; @@ -157,7 +160,7 @@ impl CoveragePoints { location_trust_multiplier, speedtest_multiplier, radio_type, - radio_threshold, + service_provider_boosted_reward_eligibility, boosted_hex_eligibility: boost_eligibility, speedtests, location_trust_scores, @@ -171,13 +174,14 @@ pub enum BoostedHexStatus { Eligible, WifiLocationScoreBelowThreshold(Decimal), RadioThresholdNotMet, + ServiceProviderBanned, } impl BoostedHexStatus { fn new( radio_type: &RadioType, location_trust_score: Decimal, - radio_threshold: &RadioThreshold, + service_provider_boosted_reward_eligibility: &ServiceProviderBoostedRewardEligibility, ) -> Self { // hip-93: if radio is wifi & location_trust score multiplier < 0.75, no boosting if radio_type.is_wifi() && location_trust_score < dec!(0.75) { @@ -185,11 +189,15 @@ impl BoostedHexStatus { } // hip-84: if radio has not met minimum data and subscriber thresholds, no boosting - if !radio_threshold.is_met() { - return Self::RadioThresholdNotMet; + match service_provider_boosted_reward_eligibility { + ServiceProviderBoostedRewardEligibility::Eligible => Self::Eligible, + ServiceProviderBoostedRewardEligibility::ServiceProviderBanned => { + Self::ServiceProviderBanned + } + ServiceProviderBoostedRewardEligibility::RadioThresholdNotMet => { + Self::RadioThresholdNotMet + } } - - Self::Eligible } fn is_eligible(&self) -> bool { @@ -262,16 +270,23 @@ impl RadioType { } #[derive(Debug, Clone, Copy, PartialEq)] -pub enum RadioThreshold { - Verified, - Unverified, +pub enum ServiceProviderBoostedRewardEligibility { + Eligible, + ServiceProviderBanned, + RadioThresholdNotMet, } -impl RadioThreshold { - fn is_met(&self) -> bool { - matches!(self, Self::Verified) - } -} +// #[derive(Debug, Clone, Copy, PartialEq)] +// pub enum RadioThreshold { +// Verified, +// Unverified, +// } + +// impl RadioThreshold { +// fn is_met(&self) -> bool { +// matches!(self, Self::Verified) +// } +// } #[cfg(test)] mod tests { @@ -297,7 +312,7 @@ mod tests { ) { let wifi = CoveragePoints::new( RadioType::IndoorWifi, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { @@ -319,10 +334,10 @@ mod tests { #[test] fn hip_84_radio_meets_minimum_subscriber_threshold_for_boosted_hexes() { - let calculate_wifi = |radio_verified: RadioThreshold| { + let calculate_wifi = |eligibility: ServiceProviderBoostedRewardEligibility| { CoveragePoints::new( RadioType::IndoorWifi, - radio_verified, + eligibility, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { @@ -344,12 +359,13 @@ mod tests { // Radio meeting the threshold is eligible for boosted hexes. // Boosted hex provides radio with more than base_points. - let verified_wifi = calculate_wifi(RadioThreshold::Verified); + let verified_wifi = calculate_wifi(ServiceProviderBoostedRewardEligibility::Eligible); assert_eq!(base_points * dec!(5), verified_wifi.total_coverage_points); // Radio not meeting the threshold is not eligible for boosted hexes. // Boost from hex is not applied, radio receives base points. - let unverified_wifi = calculate_wifi(RadioThreshold::Unverified); + let unverified_wifi = + calculate_wifi(ServiceProviderBoostedRewardEligibility::RadioThresholdNotMet); assert_eq!(base_points, unverified_wifi.total_coverage_points); } @@ -358,7 +374,7 @@ mod tests { let calculate_wifi = |location_trust_scores: Vec| { CoveragePoints::new( RadioType::IndoorWifi, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_scores, vec![RankedCoverage { @@ -396,7 +412,7 @@ mod tests { let calculate_indoor_cbrs = |speedtests: Vec| { CoveragePoints::new( RadioType::IndoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtests, location_trust_maximum(), vec![RankedCoverage { @@ -484,7 +500,7 @@ mod tests { use Assignment::*; let indoor_cbrs = CoveragePoints::new( RadioType::IndoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![ @@ -541,7 +557,7 @@ mod tests { ) { let outdoor_wifi = CoveragePoints::new( radio_type, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { @@ -570,7 +586,7 @@ mod tests { ) { let indoor_wifi = CoveragePoints::new( radio_type, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![ @@ -613,7 +629,7 @@ mod tests { // Location scores are averaged together let indoor_wifi = CoveragePoints::new( RadioType::IndoorWifi, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_with_scores(&[dec!(0.1), dec!(0.2), dec!(0.3), dec!(0.4)]), vec![RankedCoverage { @@ -657,7 +673,7 @@ mod tests { ]; let indoor_wifi = CoveragePoints::new( RadioType::IndoorWifi, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), covered_hexes.clone(), @@ -680,7 +696,7 @@ mod tests { ) { let outdoor_cbrs = CoveragePoints::new( RadioType::OutdoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { @@ -707,7 +723,7 @@ mod tests { ) { let indoor_cbrs = CoveragePoints::new( RadioType::IndoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { @@ -736,7 +752,7 @@ mod tests { ) { let outdoor_wifi = CoveragePoints::new( RadioType::OutdoorWifi, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { @@ -763,7 +779,7 @@ mod tests { ) { let indoor_wifi = CoveragePoints::new( RadioType::IndoorWifi, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtest_maximum(), location_trust_maximum(), vec![RankedCoverage { diff --git a/coverage_point_calculator/tests/coverage_point_calculator.rs b/coverage_point_calculator/tests/coverage_point_calculator.rs index 0a7723bac..058e7dedf 100644 --- a/coverage_point_calculator/tests/coverage_point_calculator.rs +++ b/coverage_point_calculator/tests/coverage_point_calculator.rs @@ -3,8 +3,8 @@ use std::num::NonZeroU32; use chrono::Utc; use coverage_map::{BoostedHexMap, RankedCoverage, SignalLevel, UnrankedCoverage}; use coverage_point_calculator::{ - BytesPs, CoveragePoints, LocationTrust, RadioThreshold, RadioType, Result, Speedtest, - SpeedtestTier, + BytesPs, CoveragePoints, LocationTrust, RadioType, Result, + ServiceProviderBoostedRewardEligibility, Speedtest, SpeedtestTier, }; use hex_assignments::{assignment::HexAssignments, Assignment}; use rust_decimal_macros::dec; @@ -52,7 +52,7 @@ fn base_radio_coverage_points() { ] { let coverage_points = CoveragePoints::new( radio_type, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, speedtests.clone(), location_trust_scores.clone(), hexes.clone(), @@ -113,7 +113,7 @@ fn radios_with_coverage() { ] { let coverage_points = CoveragePoints::new( radio_type, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, default_speedtests.clone(), default_location_trust_scores.clone(), base_hex_iter.clone().take(num_hexes).collect(), @@ -240,7 +240,7 @@ fn cbrs_outdoor_with_mixed_signal_level_coverage() -> Result { let radio = CoveragePoints::new( RadioType::OutdoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, Speedtest::mock(SpeedtestTier::Good), vec![], // Location Trust is ignored for Cbrs vec![ @@ -372,7 +372,7 @@ fn indoor_cbrs_radio( ) -> Result { CoveragePoints::new( RadioType::IndoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, Speedtest::mock(speedtest_tier), vec![], coverage.to_owned(), @@ -385,7 +385,7 @@ fn outdoor_cbrs_radio( ) -> Result { CoveragePoints::new( RadioType::OutdoorCbrs, - RadioThreshold::Verified, + ServiceProviderBoostedRewardEligibility::Eligible, Speedtest::mock(speedtest_tier), vec![], coverage.to_owned(), diff --git a/mobile_verifier/src/cli/reward_from_db.rs b/mobile_verifier/src/cli/reward_from_db.rs index a159eb9e5..89a35270f 100644 --- a/mobile_verifier/src/cli/reward_from_db.rs +++ b/mobile_verifier/src/cli/reward_from_db.rs @@ -1,7 +1,7 @@ use crate::{ heartbeats::HeartbeatReward, - radio_threshold::VerifiedRadioThresholds, reward_shares::{get_scheduled_tokens_for_poc, CoverageShares}, + rewarder::boosted_hex_eligibility::BoostedHexEligibility, speedtests_average::SpeedtestAverages, Settings, }; @@ -46,7 +46,7 @@ impl Cmd { heartbeats, &speedtest_averages, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &epoch, ) .await?; diff --git a/mobile_verifier/src/reward_shares.rs b/mobile_verifier/src/reward_shares.rs index d3608a843..4e1413765 100644 --- a/mobile_verifier/src/reward_shares.rs +++ b/mobile_verifier/src/reward_shares.rs @@ -2,11 +2,12 @@ use crate::{ coverage::{CoveredHexStream, Seniority}, data_session::{HotspotMap, ServiceProviderDataSession}, heartbeats::HeartbeatReward, - radio_threshold::VerifiedRadioThresholds, + rewarder::boosted_hex_eligibility::BoostedHexEligibility, speedtests_average::SpeedtestAverages, subscriber_location::SubscriberValidatedLocations, }; use chrono::{DateTime, Duration, Utc}; +use coverage_point_calculator::ServiceProviderBoostedRewardEligibility; use file_store::traits::TimestampEncode; use futures::{Stream, StreamExt}; use helium_crypto::PublicKeyBinary; @@ -434,7 +435,7 @@ struct RadioInfo { coverage_obj_uuid: Uuid, seniority: Seniority, trust_scores: Vec, - verified_radio_threshold: coverage_point_calculator::RadioThreshold, + sp_boosted_reward_eligibility: ServiceProviderBoostedRewardEligibility, speedtests: Vec, } @@ -450,7 +451,7 @@ impl CoverageShares { heartbeats: impl Stream>, speedtest_averages: &SpeedtestAverages, boosted_hexes: &BoostedHexes, - verified_radio_thresholds: &VerifiedRadioThresholds, + boosted_hex_eligibility: &BoostedHexEligibility, reward_period: &Range>, ) -> anyhow::Result { let mut radio_infos: HashMap = HashMap::new(); @@ -521,12 +522,8 @@ impl CoverageShares { }) .collect(); - use coverage_point_calculator::RadioThreshold; - let verified_radio_threshold = - match verified_radio_thresholds.is_verified(pubkey, cbsd_id) { - true => RadioThreshold::Verified, - false => RadioThreshold::Unverified, - }; + let sp_boosted_reward_eligibility = + boosted_hex_eligibility.eligibility(pubkey, cbsd_id); use coverage_point_calculator::LocationTrust; let trust_scores = heartbeat @@ -544,7 +541,7 @@ impl CoverageShares { coverage_obj_uuid: heartbeat.coverage_object, seniority, trust_scores, - verified_radio_threshold, + sp_boosted_reward_eligibility, speedtests, }, ); @@ -575,7 +572,7 @@ impl CoverageShares { let coverage_points = coverage_point_calculator::CoveragePoints::new( radio_info.radio_type, - radio_info.verified_radio_threshold, + radio_info.sp_boosted_reward_eligibility, radio_info.speedtests.clone(), radio_info.trust_scores.clone(), hexes, @@ -1374,7 +1371,7 @@ mod test { stream::iter(heartbeat_rewards), &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &epoch, ) .await @@ -1546,7 +1543,7 @@ mod test { stream::iter(heartbeat_rewards), &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &epoch, ) .await @@ -1676,7 +1673,7 @@ mod test { stream::iter(heartbeat_rewards), &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &epoch, ) .await @@ -1806,7 +1803,7 @@ mod test { stream::iter(heartbeat_rewards), &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &epoch, ) .await @@ -1903,7 +1900,7 @@ mod test { inserted_at: now, update_reason: 0, }, - verified_radio_threshold: coverage_point_calculator::RadioThreshold::Verified, + sp_boosted_reward_eligibility: ServiceProviderBoostedRewardEligibility::Eligible, speedtests: vec![ coverage_point_calculator::Speedtest { upload_speed: coverage_point_calculator::BytesPs::new(100_000_000), @@ -1936,7 +1933,7 @@ mod test { inserted_at: now, update_reason: 0, }, - verified_radio_threshold: coverage_point_calculator::RadioThreshold::Verified, + sp_boosted_reward_eligibility: ServiceProviderBoostedRewardEligibility::Eligible, speedtests: vec![], }, ); diff --git a/mobile_verifier/src/rewarder.rs b/mobile_verifier/src/rewarder.rs index e0ed055e9..2811236d4 100644 --- a/mobile_verifier/src/rewarder.rs +++ b/mobile_verifier/src/rewarder.rs @@ -4,7 +4,7 @@ use crate::{ heartbeats::{self, HeartbeatReward}, radio_threshold, reward_shares::{self, CoverageShares, MapperShares, ServiceProviderShares, TransferRewards}, - speedtests, + sp_boosted_rewards_bans, speedtests, speedtests_average::SpeedtestAverages, subscriber_location, telemetry, Settings, }; @@ -39,6 +39,10 @@ use std::{ops::Range, time::Duration}; use task_manager::{ManagedTask, TaskManager}; use tokio::time::sleep; +use self::boosted_hex_eligibility::BoostedHexEligibility; + +pub mod boosted_hex_eligibility; + const REWARDS_NOT_CURRENT_DELAY_PERIOD: i64 = 5; pub struct Rewarder { @@ -285,6 +289,7 @@ where speedtests::clear_speedtests(&mut transaction, &reward_period.start).await?; data_session::clear_hotspot_data_sessions(&mut transaction, &reward_period.start).await?; coverage::clear_coverage_objects(&mut transaction, &reward_period.start).await?; + sp_boosted_rewards_bans::clear_bans(&mut transaction, reward_period.start).await?; // subscriber_location::clear_location_shares(&mut transaction, &reward_period.end).await?; let next_reward_period = scheduler.next_reward_period(); @@ -398,15 +403,17 @@ async fn reward_poc( let boosted_hexes = BoostedHexes::get_all(hex_service_client).await?; - let verified_radio_thresholds = - radio_threshold::verified_radio_thresholds(pool, reward_period).await?; + let boosted_hex_eligibility = BoostedHexEligibility::new( + radio_threshold::verified_radio_thresholds(pool, reward_period).await?, + sp_boosted_rewards_bans::db::get_banned_radios(pool, reward_period.end).await?, + ); let coverage_shares = CoverageShares::new( pool, heartbeats, &speedtest_averages, &boosted_hexes, - &verified_radio_thresholds, + &boosted_hex_eligibility, reward_period, ) .await?; diff --git a/mobile_verifier/src/rewarder/boosted_hex_eligibility.rs b/mobile_verifier/src/rewarder/boosted_hex_eligibility.rs new file mode 100644 index 000000000..583165543 --- /dev/null +++ b/mobile_verifier/src/rewarder/boosted_hex_eligibility.rs @@ -0,0 +1,43 @@ +use std::collections::HashSet; + +use coverage_point_calculator::ServiceProviderBoostedRewardEligibility; +use helium_crypto::PublicKeyBinary; + +use crate::radio_threshold::VerifiedRadioThresholds; + +#[derive(Debug, Default)] +pub struct BoostedHexEligibility { + radio_thresholds: VerifiedRadioThresholds, + sp_bans: HashSet<(Option, Option)>, +} + +impl BoostedHexEligibility { + pub fn new( + radio_thresholds: VerifiedRadioThresholds, + sp_bans: HashSet<(Option, Option)>, + ) -> Self { + Self { + radio_thresholds, + sp_bans, + } + } + + pub fn eligibility( + &self, + key: PublicKeyBinary, + cbsd_id_opt: Option, + ) -> ServiceProviderBoostedRewardEligibility { + let ban_key = match cbsd_id_opt.clone() { + Some(cbsd_id) => (None, Some(cbsd_id)), + None => (Some(key.clone()), None), + }; + + if self.sp_bans.contains(&ban_key) { + ServiceProviderBoostedRewardEligibility::ServiceProviderBanned + } else if self.radio_thresholds.is_verified(key, cbsd_id_opt) { + ServiceProviderBoostedRewardEligibility::Eligible + } else { + ServiceProviderBoostedRewardEligibility::RadioThresholdNotMet + } + } +} diff --git a/mobile_verifier/src/sp_boosted_rewards_bans.rs b/mobile_verifier/src/sp_boosted_rewards_bans.rs index 4355a6d00..9d6f447d3 100644 --- a/mobile_verifier/src/sp_boosted_rewards_bans.rs +++ b/mobile_verifier/src/sp_boosted_rewards_bans.rs @@ -28,7 +28,6 @@ use tokio::sync::mpsc::Receiver; use crate::Settings; const CLEANUP_DAYS: i64 = 7; -const CLEANUP_INTERVAL_SECS: u64 = 12 * 60 * 60; struct BannedRadioReport { received_timestamp: DateTime, @@ -153,16 +152,10 @@ where async fn run(mut self, mut shutdown: triggered::Listener) -> anyhow::Result<()> { tracing::info!("service provider boosted rewards ban ingestor starting"); - let mut cleanup_interval = - tokio::time::interval(std::time::Duration::from_secs(CLEANUP_INTERVAL_SECS)); - loop { tokio::select! { biased; _ = &mut shutdown => break, - _ = cleanup_interval.tick() => { - db::cleanup(&self.pool).await?; - } Some(file) = self.receiver.recv() => { self.process_file(file).await?; } @@ -234,20 +227,61 @@ where } } -mod db { +pub async fn clear_bans( + transaction: &mut Transaction<'_, Postgres>, + before: DateTime, +) -> anyhow::Result<()> { + db::cleanup(transaction, before).await +} + +pub mod db { + use std::{collections::HashSet, str::FromStr}; + use chrono::Duration; + use sqlx::Row; use super::*; - pub(super) async fn cleanup(pool: &PgPool) -> anyhow::Result<()> { + pub async fn get_banned_radios( + pool: &PgPool, + date_time: DateTime, + ) -> anyhow::Result, Option)>> { sqlx::query( r#" - DELETE FROM sp_boosted_rewards_bans - WHERE until < $1 or invalidated_at < $1 - "#, + SELECT radio_type, radio_key + FROM sp_boosted_rewards_bans + WHERE until < $1 or invalidated_at < $1 + "#, ) - .bind(Utc::now() - Duration::days(CLEANUP_DAYS)) - .execute(pool) + .bind(date_time) + .fetch(pool) + .map_err(anyhow::Error::from) + .try_fold(HashSet::new(), |mut set, row| async move { + let radio_type = row.get::<&str, &str>("radio_type"); + let radio_key = row.get::("radio_key"); + match radio_type { + "wifi" => set.insert((Some(PublicKeyBinary::from_str(&radio_key)?), None)), + "cbrs" => set.insert((None, Some(radio_key))), + _ => anyhow::bail!("Inavlid radio type: {}", radio_type), + }; + + Ok(set) + }) + .await + } + + pub(super) async fn cleanup( + transaction: &mut Transaction<'_, Postgres>, + before: DateTime, + ) -> anyhow::Result<()> { + sqlx::query( + r#" + DELETE FROM sp_boosted_rewards_bans + WHERE until < $1 or invalidated_at < $1 + "#, + ) + .bind(before - Duration::days(CLEANUP_DAYS)) + .execute(transaction) .await .map(|_| ()) .map_err(anyhow::Error::from) @@ -271,9 +305,9 @@ mod db { ) -> anyhow::Result<()> { sqlx::query( r#" - INSERT INTO sp_boosted_rewards_bans(radio_type, radio_key, received_timestamp, until) - VALUES($1,$2,$3,$4) - "#, + INSERT INTO sp_boosted_rewards_bans(radio_type, radio_key, received_timestamp, until) + VALUES($1,$2,$3,$4) + "#, ) .bind(report.radio_type) .bind(report.radio_key) @@ -295,7 +329,7 @@ mod db { SET invalidated_at = now() WHERE radio_type = $1 AND radio_key = $2 - AND received_timestamp <= $3 + AND received_timestamp <= $3 "#, ) .bind(report.radio_type) diff --git a/mobile_verifier/tests/integrations/boosting_oracles.rs b/mobile_verifier/tests/integrations/boosting_oracles.rs index 1436437b5..1a6c8f4d4 100644 --- a/mobile_verifier/tests/integrations/boosting_oracles.rs +++ b/mobile_verifier/tests/integrations/boosting_oracles.rs @@ -21,8 +21,8 @@ use mobile_verifier::{ last_location::LocationCache, Heartbeat, HeartbeatReward, SeniorityUpdate, ValidatedHeartbeat, }, - radio_threshold::VerifiedRadioThresholds, reward_shares::CoverageShares, + rewarder::boosted_hex_eligibility::BoostedHexEligibility, speedtests::Speedtest, speedtests_average::{SpeedtestAverage, SpeedtestAverages}, GatewayResolution, GatewayResolver, @@ -405,7 +405,7 @@ async fn test_footfall_and_urbanization_and_landtype(pool: PgPool) -> anyhow::Re heartbeats, &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &epoch, ) .await diff --git a/mobile_verifier/tests/integrations/modeled_coverage.rs b/mobile_verifier/tests/integrations/modeled_coverage.rs index e8ab799ba..2253cbe04 100644 --- a/mobile_verifier/tests/integrations/modeled_coverage.rs +++ b/mobile_verifier/tests/integrations/modeled_coverage.rs @@ -21,8 +21,8 @@ use mobile_verifier::{ last_location::LocationCache, Heartbeat, HeartbeatReward, KeyType, SeniorityUpdate, ValidatedHeartbeat, }, - radio_threshold::VerifiedRadioThresholds, reward_shares::CoverageShares, + rewarder::boosted_hex_eligibility::BoostedHexEligibility, speedtests::Speedtest, speedtests_average::{SpeedtestAverage, SpeedtestAverages}, GatewayResolution, GatewayResolver, IsAuthorized, @@ -497,7 +497,7 @@ async fn scenario_one(pool: PgPool) -> anyhow::Result<()> { heartbeats, &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &reward_period, ) .await?; @@ -599,7 +599,7 @@ async fn scenario_two(pool: PgPool) -> anyhow::Result<()> { heartbeats, &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &reward_period, ) .await?; @@ -887,7 +887,7 @@ async fn scenario_three(pool: PgPool) -> anyhow::Result<()> { heartbeats, &speedtest_avgs, &boosted_hexes, - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &reward_period, ) .await?; @@ -976,7 +976,7 @@ async fn scenario_four(pool: PgPool) -> anyhow::Result<()> { heartbeats, &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &reward_period, ) .await?; @@ -1077,7 +1077,7 @@ async fn scenario_five(pool: PgPool) -> anyhow::Result<()> { heartbeats, &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &reward_period, ) .await?; @@ -1326,7 +1326,7 @@ async fn scenario_six(pool: PgPool) -> anyhow::Result<()> { heartbeats, &speedtest_avgs, &BoostedHexes::default(), - &VerifiedRadioThresholds::default(), + &BoostedHexEligibility::default(), &reward_period, ) .await?;