From 8471b77d108e87e422d1ebb14bbbdd4747c13fe9 Mon Sep 17 00:00:00 2001 From: Andrew McKenzie Date: Wed, 17 Jan 2024 15:25:44 +0000 Subject: [PATCH] tweaks --- build.rs | 1 + src/hex_boosting.proto | 21 ++++++++++++++++++ src/service/mobile_config.proto | 23 +------------------ src/service/poc_mobile.proto | 39 ++++++++++++++------------------- 4 files changed, 40 insertions(+), 44 deletions(-) create mode 100644 src/hex_boosting.proto diff --git a/build.rs b/build.rs index 37f0df1f..f24332da 100644 --- a/build.rs +++ b/build.rs @@ -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 { diff --git a/src/hex_boosting.proto b/src/hex_boosting.proto new file mode 100644 index 00000000..56263491 --- /dev/null +++ b/src/hex_boosting.proto @@ -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; +} diff --git a/src/service/mobile_config.proto b/src/service/mobile_config.proto index 83194fde..d83dfbfc 100644 --- a/src/service/mobile_config.proto +++ b/src/service/mobile_config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package helium.mobile_config; -import "service_provider.proto"; +import "hex_boosting.proto"; // ------------------------------------------------------------------ // Message Definitions @@ -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 // ------------------------------------------------------------------ diff --git a/src/service/poc_mobile.proto b/src/service/poc_mobile.proto index 2962569a..8af449f4 100644 --- a/src/service/poc_mobile.proto +++ b/src/service/poc_mobile.proto @@ -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 { @@ -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 { @@ -504,3 +497,5 @@ message invalid_data_transfer_ingest_report_v1 { // epoch uint64 timestamp = 3; } + +message boosted_hexes_v1 {}