Skip to content

Commit

Permalink
Merge pull request #433 from helium/mj/hip-134-unique-connections
Browse files Browse the repository at this point in the history
HIP-134 unique connections
  • Loading branch information
macpie authored Dec 11, 2024
2 parents 8e3edc2 + 331dca2 commit 16d6838
Showing 1 changed file with 60 additions and 7 deletions.
67 changes: 60 additions & 7 deletions src/service/poc_mobile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,47 @@ service poc_mobile {
returns (hex_usage_stats_res_v1);
rpc submit_radio_usage_stats_report(radio_usage_stats_req_v1)
returns (radio_usage_stats_res_v1);
rpc submit_unique_connections(unique_connections_req_v1)
returns (unique_connections_resp_v1);
}

message unique_connections_req_v1 {
// Wifi Radio pubkey
bytes pubkey = 1;
// Start timestamp in milliseconds of window used
// to calculate unique connections
uint64 start_timestamp = 2;
// End timestamp in milliseconds of window used
// to calculate unique connections
uint64 end_timestamp = 3;
// Number of unique connection over the window looking
// backwards from timestamp
uint64 unique_connections = 4;

// Timestamp unique counts was sent in milliseconds
uint64 timestamp = 5;
bytes carrier_key = 6;
bytes signature = 7;
}

message unique_connections_resp_v1 { uint64 timestamp = 1; }

message unique_connections_ingest_report_v1 {
// Timestamp in milliseconds report was received by ingestor
uint64 received_timestamp = 1;
unique_connections_req_v1 report = 2;
}

enum verified_unique_connections_ingest_report_status {
verified_unique_connections_ingest_report_status_valid = 0;
verified_unique_connections_ingest_report_status_invalid_carrier_key = 1;
}

message verified_unique_connections_ingest_report_v1 {
// Timestamp in milliseconds report was verified by oracles
uint64 timestamp = 1;
unique_connections_ingest_report_v1 report = 2;
verified_unique_connections_ingest_report_status status = 3;
}

message file_info {
Expand Down Expand Up @@ -547,12 +588,21 @@ message radio_reward {
repeated boosted_hex boosted_hexes = 10;
}

enum boosted_hex_status {
boosted_hex_status_eligible = 0;
boosted_hex_status_location_score_below_threshold = 1;
boosted_hex_status_radio_threshold_not_met = 2;
boosted_hex_status_service_provider_ban = 3;
boosted_hex_status_average_asserted_distance_over_limit = 4;
enum sp_boosted_hex_status {
sp_boosted_hex_status_eligible = 0;
sp_boosted_hex_status_location_score_below_threshold = 1;
sp_boosted_hex_status_radio_threshold_not_met = 2;
sp_boosted_hex_status_service_provider_ban = 3;
sp_boosted_hex_status_average_asserted_distance_over_limit = 4;
}

enum oracle_boosted_hex_status {
oracle_boosted_hex_status_eligible = 0;
oracle_boosted_hex_status_banned = 1;
// Radio meets the requirements to be a "Qualified Hotspot"
// laid out in HIP-134
// https://github.com/helium/HIP/blob/main/0134-reward-mobile-carrier-offload-hotspots.md#detailed-explanation
oracle_boosted_hex_status_qualified = 2;
}

message radio_reward_v2 {
Expand Down Expand Up @@ -621,13 +671,16 @@ message radio_reward_v2 {
Decimal speedtest_multiplier = 14;

// eligibility of radio to earn service provider boosted rewards
boosted_hex_status boosted_hex_status = 15;
sp_boosted_hex_status sp_boosted_hex_status = 15;

// all hexes covered by the radio
repeated covered_hex covered_hexes = 16;

// average speedtests result
speedtest speedtest_average = 17;

// eligibility of radio to earn oracle boosted rewards
oracle_boosted_hex_status oracle_boosted_hex_status = 18;
}

message boosted_hex {
Expand Down

0 comments on commit 16d6838

Please sign in to comment.