Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Jan 17, 2024
1 parent 876585a commit 8471b77
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 44 deletions.
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const MESSAGES: &[&str] = &[
"src/reward_manifest.proto",
"src/blockchain_region_param_v1.proto",
"src/price_report.proto",
"src/hex_boosting.proto",
];

macro_rules! config {
Expand Down
21 changes: 21 additions & 0 deletions src/hex_boosting.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";

package helium.hex_boosting;

import "service_provider.proto";

message boosted_hex_info {
// The res12 h3 index of the boosted hex
uint64 location = 1;
// The timestamp of the start of the boost period
// 0 if the boosting has not yet started
int64 start_ts = 2;
// The length of the boost period in months
uint32 period_length = 3;
// the minimum number of periods to boost
uint32 minimum_periods = 4;
// the boost price in USD @ 10^6
uint64 boost_price = 5;
// The on chain entity key of service provider providing the boost
service_provider service_provider_id = 6;
}
23 changes: 1 addition & 22 deletions src/service/mobile_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package helium.mobile_config;

import "service_provider.proto";
import "hex_boosting.proto";

// ------------------------------------------------------------------
// Message Definitions
Expand Down Expand Up @@ -228,27 +228,6 @@ message boosted_hex_info_stream_res_v1 {
bytes signature = 4;
}

message boosted_hex_info {
// The res12 h3 index of the boosted hex
uint64 location = 1;
// The timestamp of the start of the boost period
// 0 if the boosting has not yet started
int64 start_ts = 2;
// The length of the boost period in months
uint32 period_length = 3;
// the minimum number of periods to boost
uint32 minimum_periods = 4;
// the boost amount in USD @ 10^6
// TODO: confirm if boost price should be mobile or USD
// If USD, does mobile verifier convert that to mobile at the prevailing
// mobile price at the point of rewarding ? this total available boost
// in MOBILE then gets distributed across all radios providing coverage
// in the boosted hex
uint64 boost_price = 5;
// The on chain entity key of service provider providing the boost
service_provider service_provider_id = 6;
}

// ------------------------------------------------------------------
// Service Definitions
// ------------------------------------------------------------------
Expand Down
39 changes: 17 additions & 22 deletions src/service/poc_mobile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package helium.poc_mobile;

import "mapper.proto";
import "hex_boosting.proto";
import "service_provider.proto";

message speedtest_req_v1 {
Expand Down Expand Up @@ -333,33 +334,25 @@ message radio_reward {
// rewardable period
// value is 0.0 to 1.0 multiplied by 1000
uint32 speedtest_multiplier = 9;
// reward for providing coverage within boosted hexes
hex_boosting_reward hex_boosting_reward = 10;
// list of all boosted hexes covered by this radio
boosted_hexes boosted_hexes = 10;
}

message hex_boosting_reward {
// the summed total amount in mobile bones for all boosted hexes covered by
// the radio
uint64 amount = 1;
// a list of all boosted hexes covered by the radio
repeated boosted_hex_reward boosted_hex_reward = 2;
}

message boosted_hex_reward {
/// Boosted hex reward amount in mobile bones
uint64 amount = 1;

// TODO: maybe just copy across the full boosted_hex_info object from mobile
// config????

message boosted_hexes {
// the multiplier applied to this hex and paid for by the relevant service
// provider value is 0.0 to 1.0 multiplied by 1000
uint32 multiplier = 1;
// The res12 h3 index of the boosted hex
uint64 location = 2;
// the boost amount in USD @ 10^6
uint64 boost_price = 3;
/// Price of MOBILE @ 10^6 used when calculating rewards
uint64 price = 4;
// The on chain entity key of service provider providing the boost
service_provider service_provider_id = 5;
service_provider service_provider_id = 3;
}

message boosted_hexes_v1 {
/// Unix timestamp in seconds which the boosted hexes info is valid for
uint64 timestamp = 1;
// Details of all modified hexes
repeated boosted_hex_info hexes = 2;
}

message gateway_reward {
Expand Down Expand Up @@ -504,3 +497,5 @@ message invalid_data_transfer_ingest_report_v1 {
// epoch
uint64 timestamp = 3;
}

message boosted_hexes_v1 {}

0 comments on commit 8471b77

Please sign in to comment.