Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions coverage_point_calculator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
//! - provider boosted hexes increase oracle boosting to 1x
//! - [HIP-134][carrier-offload]
//! - serving >25 unique connection increase oracle boosting to 1x
//! - [HRP-20250409][urban-area-adjustment]
//! - all footfall C hexes now have a 0.03 multiplier
//!
//! - [CoveredHex::rank]
//! - [HIP-105][hex-limits]
Expand Down Expand Up @@ -71,6 +73,7 @@
//! [anti-gaming]: https://github.com/helium/HIP/blob/main/0131-bridging-gap-between-verification-mappers-and-anti-gaming-measures.md
//! [carrier-offload]: https://github.com/helium/HIP/blob/main/0134-reward-mobile-carrier-offload-hotspots.md
//! [sp-boost-qualifiers]: https://github.com/helium/HIP/blob/main/0140-adjust-service-provider-boost-qualifiers.md
//! [urban-area-adjustment] https://github.com/helium/helium-release-proposals/blob/main/releases/20250409-core-devs.md#1-hip-103-urban-area-multiplier-adjustment
//!
pub use crate::{
hexes::{CoveredHex, HexPoints},
Expand Down Expand Up @@ -644,16 +647,14 @@ mod tests {
ranked_coverage(B, B, B, C), // 8
ranked_coverage(B, C, B, C), // 8
// 24
// light blue - No POI Urbanized, no SP override
ranked_coverage(C, A, A, C), // 6.4
ranked_coverage(C, B, A, C), // 4.8
ranked_coverage(C, C, A, C), // 0.8
// 12
// dark blue - No POI Not Urbanized, no SP override
ranked_coverage(C, A, B, C), // 3.2
ranked_coverage(C, B, B, C), // 2.4
// HRP-20250409 - footfall C
ranked_coverage(C, A, A, C), // 0.48
ranked_coverage(C, B, A, C), // 0.48
ranked_coverage(C, C, A, C), // 0.48
ranked_coverage(C, A, B, C), // 0.48
ranked_coverage(C, B, B, C), // 0.48
ranked_coverage(C, C, B, C), // 0.48
// 6.08
// 2.88
// gray - Outside of USA, no SP override
ranked_coverage(A, A, C, C), // 0
ranked_coverage(A, B, C, C), // 0
Expand All @@ -669,8 +670,8 @@ mod tests {
)
.expect("outdoor wifi");

// 48 + 48 + 56 + 24 + 12 + 6.08 = 194.08
assert_eq!(dec!(194.08), outdoor_wifi.coverage_points_v1());
// 48 + 48 + 56 + 24 + 2.88 = 178.88
assert_eq!(dec!(178.88), outdoor_wifi.coverage_points_v1());
}

#[rstest]
Expand Down
10 changes: 2 additions & 8 deletions hex_assignments/src/assignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,10 @@ impl HexAssignments {
(B, A, B, _) => dec!(0.50),
(B, B, B, _) => dec!(0.50),
(B, C, B, _) => dec!(0.50),
// light blue - No POI Urbanized
(C, A, A, _) => dec!(0.40),
(C, B, A, _) => dec!(0.30),
(C, C, A, _) => dec!(0.05),
// dark blue - No POI Not Urbanized
(C, A, B, _) => dec!(0.20),
(C, B, B, _) => dec!(0.15),
(C, C, B, _) => dec!(0.03),
// gray - Outside of USA
(_, _, C, _) => dec!(0.00),
//HRP-20250409 - all footfall C hexes are 0.03 multiplier
(C, _, _, _) => dec!(0.03),
}
}
}
Expand Down
50 changes: 24 additions & 26 deletions mobile_verifier/tests/integrations/boosting_oracles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ async fn test_footfall_and_urbanization_report(pool: PgPool) -> anyhow::Result<(
new_hex_assignment(&mut cell, B, A, B, C, 500),
new_hex_assignment(&mut cell, B, B, B, C, 500),
new_hex_assignment(&mut cell, B, C, B, C, 500),
// light blue - No POI Urbanized, no service provider override
new_hex_assignment(&mut cell, C, A, A, C, 400),
new_hex_assignment(&mut cell, C, B, A, C, 300),
new_hex_assignment(&mut cell, C, C, A, C, 50),
// dark blue - No POI Not Urbanized, no service provider override
new_hex_assignment(&mut cell, C, A, B, C, 200),
new_hex_assignment(&mut cell, C, B, B, C, 150),
// HRP-20250409 footfall C
new_hex_assignment(&mut cell, C, A, A, C, 30),
new_hex_assignment(&mut cell, C, B, A, C, 30),
new_hex_assignment(&mut cell, C, C, A, C, 30),
new_hex_assignment(&mut cell, C, A, B, C, 30),
new_hex_assignment(&mut cell, C, B, B, C, 30),
new_hex_assignment(&mut cell, C, C, B, C, 30),
// gray - Outside of USA, no service provider override
new_hex_assignment(&mut cell, A, A, C, C, 0),
Expand Down Expand Up @@ -431,33 +430,32 @@ async fn test_footfall_and_urbanization_and_landtype_and_service_provider_overri
// hex10 | B, A, B, C | 100 * 0.50 | 50
// hex11 | B, B, B, C | 100 * 0.50 | 50
// hex12 | B, C, B, C | 100 * 0.50 | 50
// == light blue - No POI Urbanized, no service provider override
// hex13 | C, A, A, C | 100 * 0.40 | 40
// hex14 | C, B, A, C | 100 * 0.30 | 30
// hex15 | C, C, A, C | 100 * 0.05 | 5
// == dark blue - No POI Not Urbanized, no service provider override
// hex16 | C, A, B, C | 100 * 0.20 | 20
// hex17 | C, B, B, C | 100 * 0.15 | 15
// == HRP-20250409 footfall C
// hex13 | C, A, A, C | 100 * 0.03 | 3
// hex14 | C, B, A, C | 100 * 0.03 | 3
// hex15 | C, C, A, C | 100 * 0.03 | 3
// hex16 | C, A, B, C | 100 * 0.03 | 3
// hex17 | C, B, B, C | 100 * 0.03 | 3
// hex18 | C, C, B, C | 100 * 0.03 | 3
// == gray - Outside of USA, no service provider override
// hex19 | A, A, C, C | 100 * 0.00 | 0
// hex20 | A, B, C, C | 100 * 0.00 | 0
// hex21 | A, C, C, C | 100 * 0.00 | 0
// hex22 | B, A, C, C | 100 * 0.00 | 0
// hex23 | B, B, C, C | 100 * 0.00 | 0
// hex24 | B, C, C, C | 100 * 0.00 | 0
// hex25 | C, A, C, C | 100 * 0.00 | 0
// hex26 | C, B, C, C | 100 * 0.00 | 0
// hex27 | C, C, C, C | 100 * 0.00 | 0
// hex19 | A, A, C, C | 100 * 0.00 | 0
// hex20 | A, B, C, C | 100 * 0.00 | 0
// hex21 | A, C, C, C | 100 * 0.00 | 0
// hex22 | B, A, C, C | 100 * 0.00 | 0
// hex23 | B, B, C, C | 100 * 0.00 | 0
// hex24 | B, C, C, C | 100 * 0.00 | 0
// hex25 | C, A, C, C | 100 * 0.00 | 0
// hex26 | C, B, C, C | 100 * 0.00 | 0
// hex27 | C, C, C, C | 100 * 0.00 | 0
// == gray - Outside of USA, HAS service provider override
// hex28 | A, A, C, A | 100 * 1.00 | 100
// hex28 | A, A, C, A | 100 * 1.00 | 100

// -----------------------------------------------
// = 1,173
// = 1,078

assert_eq!(
coverage_shares.test_hotspot_reward_shares(&pub_key),
dec!(1173.0)
dec!(1078.0)
);

Ok(())
Expand Down