From 876585aca3a95939cf16b06507972e92d6b45e2e Mon Sep 17 00:00:00 2001 From: Andrew McKenzie Date: Wed, 17 Jan 2024 12:41:35 +0000 Subject: [PATCH] initial pass at hex boosting protos --- src/service/mobile_config.proto | 45 +++++++++++++++++++++++++++++++++ src/service/poc_mobile.proto | 27 ++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/src/service/mobile_config.proto b/src/service/mobile_config.proto index b5b6d44b..83194fde 100644 --- a/src/service/mobile_config.proto +++ b/src/service/mobile_config.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package helium.mobile_config; +import "service_provider.proto"; + // ------------------------------------------------------------------ // Message Definitions // ------------------------------------------------------------------ @@ -210,6 +212,43 @@ message admin_key_res_v1 { bytes signature = 3; } +message boosted_hex_info_stream_req_v1 { + // pubkey binary of the signing keypair + bytes signer = 2; + bytes signature = 3; +} + +message boosted_hex_info_stream_res_v1 { + // a list of boosted hex info + repeated boosted_hex_info hexes = 1; + // unix epoch timestamp in seconds + uint64 timestamp = 2; + // pubkey binary of the signing keypair + bytes signer = 3; + 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 // ------------------------------------------------------------------ @@ -253,3 +292,9 @@ service admin { // Deauthorize a public key for validating trusted rpcs rpc remove_key(admin_remove_key_req_v1) returns (admin_key_res_v1); } + +service boosted_hexes { + // Get a stream of hex boost info + rpc info_stream(boosted_hex_info_stream_req_v1) + returns (stream boosted_hex_info_stream_res_v1); +} diff --git a/src/service/poc_mobile.proto b/src/service/poc_mobile.proto index db8eaaa4..2962569a 100644 --- a/src/service/poc_mobile.proto +++ b/src/service/poc_mobile.proto @@ -333,6 +333,33 @@ 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; +} + +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???? + + // 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; } message gateway_reward {