From addf76ad3c3f8674c72a93566dce3e88c8ea574c Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Fri, 26 Apr 2024 13:23:41 -0700 Subject: [PATCH 1/3] Add `boosted_hex_device_type_v1` for HIP-109 The first iteration of HIP-109[1] adds the ability to boost by a device type. Pre-existing boosts will continue to boost _all_ device types. From the way the HIP reads, at some point, a hex may be boosted by the same provider for multiple device types. It was undecided wether that would be implemented as multiple device_types attached to a boosted hex, or multiple instances of a boosted hex. [1]: https://github.com/helium/HIP/blob/main/0109-hex-boosting-by-deployment.md --- src/hex_boosting.proto | 10 ++++++++++ src/lib.rs | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/hex_boosting.proto b/src/hex_boosting.proto index dbc135c9..bb59927a 100644 --- a/src/hex_boosting.proto +++ b/src/hex_boosting.proto @@ -23,6 +23,8 @@ message boosted_hex_info_v1 { bytes boost_config_pubkey = 7; uint32 version = 8; + // The device type(s) this boost applies to. + boosted_hex_device_type_v1 device_type = 9; } message boosted_hex_update_v1 { @@ -31,3 +33,11 @@ message boosted_hex_update_v1 { // Details of the updated hex boosted_hex_info_v1 update = 2; } + +enum boosted_hex_device_type_v1 { + all = 0; + cbrs_indoor = 1; + cbrs_outdoor = 2; + wifi_indoor = 3; + wifi_outdoor = 4; +} diff --git a/src/lib.rs b/src/lib.rs index 6c84d431..eec44970 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,9 +9,9 @@ pub use prost::{DecodeError, EncodeError, Message}; #[cfg(feature = "services")] pub mod services { use crate::{ - BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, BoostedHexInfoV1, DataRate, - Decimal, EntropyReportV1, GatewayStakingMode, MapperAttach, Region, RoutingAddress, - ServiceProvider, + BlockchainRegionParamsV1, BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, + BoostedHexDeviceTypeV1, BoostedHexInfoV1, BoostedHexUpdateV1, DataRate, Decimal, + EntropyReportV1, GatewayStakingMode, MapperAttach, Region, RoutingAddress, ServiceProvider, }; pub mod iot_config { From 85c223117fdca0784682be01e72454afa99e46b9 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Fri, 30 Aug 2024 12:32:23 -0700 Subject: [PATCH 2/3] define used types before their use Familiarizes the reader with the context of what they're about to get into. --- src/hex_boosting.proto | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hex_boosting.proto b/src/hex_boosting.proto index bb59927a..3062cf96 100644 --- a/src/hex_boosting.proto +++ b/src/hex_boosting.proto @@ -2,6 +2,14 @@ syntax = "proto3"; package helium; +enum boosted_hex_device_type_v1 { + all = 0; + cbrs_indoor = 1; + cbrs_outdoor = 2; + wifi_indoor = 3; + wifi_outdoor = 4; +} + message boosted_hex_info_v1 { // The res12 h3 index of the boosted hex uint64 location = 1; @@ -33,11 +41,3 @@ message boosted_hex_update_v1 { // Details of the updated hex boosted_hex_info_v1 update = 2; } - -enum boosted_hex_device_type_v1 { - all = 0; - cbrs_indoor = 1; - cbrs_outdoor = 2; - wifi_indoor = 3; - wifi_outdoor = 4; -} From dcf951fe0c8d9d58aef29dc128f9176e9276dfb3 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Fri, 30 Aug 2024 12:36:45 -0700 Subject: [PATCH 3/3] remove redundant import after rebase --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index eec44970..dda3a50e 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,9 +9,9 @@ pub use prost::{DecodeError, EncodeError, Message}; #[cfg(feature = "services")] pub mod services { use crate::{ - BlockchainRegionParamsV1, BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, - BoostedHexDeviceTypeV1, BoostedHexInfoV1, BoostedHexUpdateV1, DataRate, Decimal, - EntropyReportV1, GatewayStakingMode, MapperAttach, Region, RoutingAddress, ServiceProvider, + BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, BoostedHexDeviceTypeV1, + BoostedHexInfoV1, BoostedHexUpdateV1, DataRate, Decimal, EntropyReportV1, + GatewayStakingMode, MapperAttach, Region, RoutingAddress, ServiceProvider, }; pub mod iot_config {