Skip to content

Commit

Permalink
Merge pull request #407 from helium/bbalser/radio-reward-v2
Browse files Browse the repository at this point in the history
Add radio-reward-v2 for mobile-reward-share
  • Loading branch information
michaeldjeffrey committed Jul 17, 2024
2 parents 04ef234 + 1b8f802 commit 62e22b2
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pub use prost::{DecodeError, EncodeError, Message};
pub mod services {
use crate::{
BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, BoostedHexInfoV1, DataRate,
EntropyReportV1, GatewayStakingMode, MapperAttach, Region, RoutingAddress, ServiceProvider,
Decimal, EntropyReportV1, GatewayStakingMode, MapperAttach, Region, RoutingAddress,
ServiceProvider,
};

pub mod iot_config {
Expand Down
99 changes: 91 additions & 8 deletions src/service/poc_mobile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package helium.poc_mobile;

import "decimal.proto";
import "mapper.proto";
import "hex_boosting.proto";
import "service_provider.proto";
Expand Down Expand Up @@ -443,6 +444,86 @@ 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;
}

message radio_reward_v2 {

message location_trust_score {
uint64 meters_to_asserted = 1;
Decimal trust_score = 2;
}

message covered_hex {
uint64 location = 1;
// modeled coverage points * rank_multiplier * assignment_multiplier
Decimal base_coverage_points = 2;
// base_coverage_points * (boosted_multiplier - 1)
Decimal boosted_coverage_points = 3;

oracle_boosting_assignment urbanized = 4;
oracle_boosting_assignment footfall = 5;
oracle_boosting_assignment landtype = 6;
Decimal assignment_multiplier = 7;
// rank for this hex, 1 indexed
uint32 rank = 8;
Decimal rank_multiplier = 9;

// set to 0 if radio is ineligible for boosted rewards
// or hex is not boosted by service provider
uint32 boosted_multiplier = 10;
}

// Public key of the hotspot of the radio
bytes hotspot_key = 1;
// cbsd Id of the radio
string cbsd_id = 2;

// sum of base_coverage_points for all covered_hexes
Decimal base_coverage_points_sum = 3;
// sum of boosted_coverage_points for all covered hexes
Decimal boosted_coverage_points_sum = 4;

// base_coverage_points * location_trust_score_multiplier *
// speedtest_multiplier
Decimal base_reward_shares = 5;
// boosted_coverage_points * location_trust_score_multiplier *
// speedtest_multiplier
Decimal boosted_reward_shares = 6;

// base_reward_shares * base_poc_bones_per_reward_share
uint64 base_poc_reward = 7;
// boosted_reward_shares * boosted_poc_bones_per_reward_share
uint64 boosted_poc_reward = 8;

// Seniority timestamp for this radio in seconds since the unix epoch
uint64 seniority_timestamp = 9;
// UUID of the coverage object used to reward this radio
bytes coverage_object = 10;

// location_trust_scores used when calculating location_trust_score_multiplier
repeated location_trust_score location_trust_scores = 11;
// only used for wifi radios, all others should have a value of 1.0
Decimal location_trust_score_multiplier = 12;

// speedtests used when calculating speedtest_multiplier
repeated speedtest speedtests = 13;
// based on speedtest averages of speedtests during 48 hour period from end of
// rewardable period
Decimal speedtest_multiplier = 14;

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

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

message boosted_hex {
// The res12 h3 index of the boosted hex
uint64 location = 1;
Expand Down Expand Up @@ -505,6 +586,7 @@ message mobile_reward_share {
subscriber_reward subscriber_reward = 5;
service_provider_reward service_provider_reward = 6;
unallocated_reward unallocated_reward = 7;
radio_reward_v2 radio_reward_v2 = 8;
}
}

Expand Down Expand Up @@ -603,23 +685,24 @@ message oracle_boosting_report_v1 {
uint64 timestamp = 3;
}

enum oracle_boosting_assignment {
a = 0;
b = 1;
c = 2;
}

message oracle_boosting_hex_assignment {
enum assignment {
a = 0;
b = 1;
c = 2;
}
// H3 resolution 12 hex tile
string location = 1;
// Multiplier derived from the assignment, value is 0.0 to 1.0 multiplied by
// 1000
uint32 assignment_multiplier = 2;
// Urbanized assignment
assignment urbanized = 3;
oracle_boosting_assignment urbanized = 3;
// Footfall assignment
assignment footfall = 4;
oracle_boosting_assignment footfall = 4;
// Landtype assignment
assignment landtype = 5;
oracle_boosting_assignment landtype = 5;
}

message service_provider_boosted_rewards_banned_radio_req_v1 {
Expand Down

0 comments on commit 62e22b2

Please sign in to comment.