Skip to content

Commit

Permalink
Update helium-proto to include hip-119 boosting ineligible reason
Browse files Browse the repository at this point in the history
HIP-119 added average distance to asserted further than threshold
reason for a radio to not receive boosted rewards.
  • Loading branch information
michaeldjeffrey committed Jul 16, 2024
1 parent 89b39cd commit 8db686c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions coverage_point_calculator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,9 @@ impl BoostedHexStatus {
) -> Self {
match service_provider_boosted_reward_eligibility {
// hip-125: if radio has been banned by service provider, no boosting
SPBoostedRewardEligibility::ServiceProviderBanned => {
Self::ServiceProviderBanned
}
SPBoostedRewardEligibility::ServiceProviderBanned => Self::ServiceProviderBanned,
// hip-84: if radio has not met minimum data and subscriber thresholds, no boosting
SPBoostedRewardEligibility::RadioThresholdNotMet => {
Self::RadioThresholdNotMet
}
SPBoostedRewardEligibility::RadioThresholdNotMet => Self::RadioThresholdNotMet,
SPBoostedRewardEligibility::Eligible => {
// hip-93: if radio is wifi & location_trust score multiplier < 0.75, no boosting
if radio_type.is_wifi() && location_trust_multiplier < MIN_WIFI_TRUST_MULTIPLIER {
Expand Down Expand Up @@ -414,8 +410,7 @@ mod tests {

// 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(SPBoostedRewardEligibility::RadioThresholdNotMet);
let unverified_wifi = calculate_wifi(SPBoostedRewardEligibility::RadioThresholdNotMet);
assert_eq!(base_points, unverified_wifi.coverage_points_v1());
}

Expand Down
3 changes: 3 additions & 0 deletions mobile_verifier/src/reward_shares/radio_reward_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ impl RadioRewardV2Ext for coverage_point_calculator::CoveragePoints {
coverage_point_calculator::BoostedHexStatus::ServiceProviderBanned => {
BoostedHexStatus::ServiceProviderBan
}
coverage_point_calculator::BoostedHexStatus::AverageAssertedDistanceOverLimit(_) => {
BoostedHexStatus::AverageAssertedDistanceOverLimit
}
}
}

Expand Down

0 comments on commit 8db686c

Please sign in to comment.