Skip to content

Commit

Permalink
Soft disable Service Provider promotions (#873)
Browse files Browse the repository at this point in the history
* comment out service provider promotions that touch mobile_rewards

In it's current form service provider promotions is not being released
yet. This is all the code that deals with promotion rewards in a mobile
reward share.

* keep sp promotions from reaching prime time

- do not write sp allocations to reward manifest.
- always return nothing from the database when asking for promotion
  rewards

These two things will effectively keep promotion rewards from being
released. The Service Provider Reward calculations will continue as
planned thinking there are no promotio rewards to give out.

* back to proto master
  • Loading branch information
michaeldjeffrey authored Oct 8, 2024
1 parent 59595dc commit 5d16871
Show file tree
Hide file tree
Showing 9 changed files with 552 additions and 555 deletions.
66 changes: 25 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ helium-lib = { git = "https://github.com/helium/helium-wallet-rs.git", branch =
hextree = { git = "https://github.com/jaykickliter/HexTree", branch = "main", features = [
"disktree",
] }
helium-proto = { git = "https://github.com/helium/proto", branch = "mj/verified-data-transfer", features = [
helium-proto = { git = "https://github.com/helium/proto", branch = "master", features = [
"services",
] }
beacon = { git = "https://github.com/helium/proto", branch = "mj/verified-data-transfer" }
beacon = { git = "https://github.com/helium/proto", branch = "master" }
solana-client = "1.18"
solana-sdk = "1.18"
solana-program = "1.18"
Expand Down
36 changes: 18 additions & 18 deletions file_store/src/cli/dump_mobile_rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{file_source, Result, Settings};
use futures::stream::StreamExt;
use helium_crypto::PublicKey;
use helium_proto::services::poc_mobile::mobile_reward_share::Reward::*;
use helium_proto::services::poc_mobile::promotion_reward::Entity;
// use helium_proto::services::poc_mobile::promotion_reward::Entity;
use helium_proto::services::poc_mobile::MobileRewardShare;
use prost::Message;
use serde_json::json;
Expand All @@ -24,7 +24,7 @@ impl Cmd {
let mut subscriber_reward = vec![];
let mut service_provider_reward = vec![];
let mut unallocated_reward = vec![];
let mut promotion_reward = vec![];
// let mut promotion_reward = vec![];

while let Some(result) = file_stream.next().await {
let msg = result?;
Expand Down Expand Up @@ -62,21 +62,21 @@ impl Cmd {
"unallocated_reward_type": reward.reward_type,
"amount": reward.amount,
})),
PromotionReward(reward) => {
let entity = reward.entity.unwrap();
match entity {
Entity::SubscriberId(id) => promotion_reward.push(json!({
"subscriber_id": uuid::Uuid::from_slice(&id).unwrap(),
"service_provider_amount": reward.service_provider_amount,
"matched_amount": reward.matched_amount,
})),
Entity::GatewayKey(key) => promotion_reward.push(json!({
"gateway_key": PublicKey::try_from(key)?.to_string(),
"service_provider_amount": reward.service_provider_amount,
"matched_amount": reward.matched_amount,
})),
}
}
// PromotionReward(reward) => {
// let entity = reward.entity.unwrap();
// match entity {
// Entity::SubscriberId(id) => promotion_reward.push(json!({
// "subscriber_id": uuid::Uuid::from_slice(&id).unwrap(),
// "service_provider_amount": reward.service_provider_amount,
// "matched_amount": reward.matched_amount,
// })),
// Entity::GatewayKey(key) => promotion_reward.push(json!({
// "gateway_key": PublicKey::try_from(key)?.to_string(),
// "service_provider_amount": reward.service_provider_amount,
// "matched_amount": reward.matched_amount,
// })),
// }
// }
},
None => todo!(),
}
Expand All @@ -88,7 +88,7 @@ impl Cmd {
"gateway_reward": gateway_reward,
"subscriber_reward": subscriber_reward,
"service_provider_reward": service_provider_reward,
"promotion_reward": promotion_reward,
// "promotion_reward": promotion_reward,
"unallocated_reward": unallocated_reward,
}))?;

Expand Down
2 changes: 1 addition & 1 deletion mobile_verifier/src/rewarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ where
boosted_poc_bones_per_reward_share: Some(helium_proto::Decimal {
value: poc_dc_shares.boost.to_string(),
}),
sp_allocations: service_provider::reward_data_sp_allocations(&self.pool).await?,
// sp_allocations: service_provider::reward_data_sp_allocations(&self.pool).await?,
};
self.reward_manifests
.write(
Expand Down
Loading

0 comments on commit 5d16871

Please sign in to comment.