From 243354c9c291838d97297414831f521cee209765 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Fri, 26 Apr 2024 13:23:41 -0700 Subject: [PATCH] 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 {