Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hex boosting protos #389

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
33 changes: 33 additions & 0 deletions src/hex_boosting.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto3";

package helium;

message boosted_hex_info_v1 {
// The res12 h3 index of the boosted hex
uint64 location = 1;
// Unix timestamp in seconds of the start of the boost period
// 0 if the boosting has not yet started
uint64 start_ts = 2;
// Unix timestamp in seconds of the end of the boost period
// 0 if the boosting has not yet started
uint64 end_ts = 3;
// The length of the boost period in months expressed as seconds
// where one month = 30 days
uint32 period_length = 4;
// the multipliers valid for this hex
// for each period
repeated uint32 multipliers = 5;
// the onchain address of the boosted hex account
bytes boosted_hex_pubkey = 6;
// the onchain address of the boost config account
bytes boost_config_pubkey = 7;

uint32 version = 8;
}

message boosted_hex_update_v1 {
// Unix timestamp in seconds the hex was updated
uint64 timestamp = 1;
// Details of the updated hex
boosted_hex_info_v1 update = 2;
}
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ pub use prost::{DecodeError, EncodeError, Message};
#[cfg(feature = "services")]
pub mod services {
use crate::{
BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, DataRate, EntropyReportV1,
GatewayStakingMode, MapperAttach, Region, RoutingAddress, ServiceProvider,
BlockchainRegionParamsV1, BlockchainTokenTypeV1, BlockchainTxn, BoostedHexInfoV1,
BoostedHexUpdateV1, DataRate, EntropyReportV1, GatewayStakingMode, MapperAttach, Region,
RoutingAddress, ServiceProvider,
};

pub mod iot_config {
Expand All @@ -37,6 +38,8 @@ pub mod services {
pub use entity_server::{Entity, EntityServer};
pub use gateway_client::GatewayClient;
pub use gateway_server::{Gateway, GatewayServer};
pub use hex_boosting_client::HexBoostingClient;
pub use hex_boosting_server::{HexBoosting, HexBoostingServer};
}

pub mod downlink {
Expand Down
42 changes: 42 additions & 0 deletions src/service/mobile_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package helium.mobile_config;

import "hex_boosting.proto";

// ------------------------------------------------------------------
// Message Definitions
// ------------------------------------------------------------------
Expand Down Expand Up @@ -210,6 +212,37 @@ message admin_key_res_v1 {
bytes signature = 3;
}

message boosted_hex_info_stream_req_v1 {
// max number of boosted hex info records in each message of the response
// stream
uint32 batch_size = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
bytes signature = 3;
}

message boosted_hex_modified_info_stream_req_v1 {
// max number of boosted hex info records in each message of the response
// stream
uint32 batch_size = 1;
// return only those records which were modified after the specified timestamp
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}

message boosted_hex_info_stream_res_v1 {
// a list of boosted hex info
repeated boosted_hex_info_v1 hexes = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}

// ------------------------------------------------------------------
// Service Definitions
// ------------------------------------------------------------------
Expand Down Expand Up @@ -253,3 +286,12 @@ service admin {
// Deauthorize a public key for validating trusted rpcs
rpc remove_key(admin_remove_key_req_v1) returns (admin_key_res_v1);
}

service hex_boosting {
// Get a stream of hex boost info
rpc info_stream(boosted_hex_info_stream_req_v1)
returns (stream boosted_hex_info_stream_res_v1);
// Get a stream of modified hex boost info since the specified timestamp
rpc modified_info_stream(boosted_hex_modified_info_stream_req_v1)
returns (stream boosted_hex_info_stream_res_v1);
}
10 changes: 10 additions & 0 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 @@ -335,6 +336,15 @@ message radio_reward {
// rewardable period
// value is 0.0 to 1.0 multiplied by 1000
uint32 speedtest_multiplier = 9;
// list of all boosted hexes covered by this radio
repeated boosted_hex boosted_hexes = 10;
}

message boosted_hex {
// The res12 h3 index of the boosted hex
uint64 location = 1;
// the multiplier applied to this hex
uint32 multiplier = 2;
}

message gateway_reward {
Expand Down
Loading