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

Include share values in rewards manifest #827

Merged
merged 36 commits into from
Jul 11, 2024

Conversation

andymck
Copy link
Contributor

@andymck andymck commented Jun 7, 2024

This PR adds the bones_per_coverage_point among other information to the rewards manifest.

@andymck andymck changed the title Andymck/includes share values in manifest includes share values in rewards manifest Jun 7, 2024
andymck and others added 13 commits June 7, 2024 13:12
This is preparing for being able to make sure boosted rewards do not take more than 10% of the reward shares.

base_coverage_points will always be recieved, but boosted_coverage_points may receive less rewards per share depending on how many there are in a reward epoch.

Note that boosted_coverage_points _do not_ contain base_coverage_points.
If boosted rewards are above the allowed 10% of total emissions, the rewards per share needs to be recalculated _not including_ leftover DC from Data Transfer rewards. 

To make this easier, we store data transfer allocated rewards and resulting unallocated rewards separately from the 10% buckets for poc and boosting.
Points considered when doing math for shares for a radio should always include speedtest and location multipliers.
- Add a way for receiving rewards from the mock sink to determine if it needs to await for an unallocated msg.

- Derive the expected rewards from math outside the oracles repo
This test really illustrates the preference for coverage over boosting. A hotspot covering 2 hexes can far surpass a hotspot covering a single hex with a strong boost multiplier.
This tests math looks different because it's the first time we're dealing with different coverage point values from radios because of degraded location trust scores.
This test almost exactly the same as `test_poc_with_multi_coverage_boosted_hexes` but the last radio is CBRS instead of a WIFI with a degraded location score. Interestingly, the coverage points work out to the same values between the differences.
@maplant maplant changed the title includes share values in rewards manifest Include share values in rewards manifest Jun 28, 2024
@maplant maplant marked this pull request as ready for review June 28, 2024 19:23
michaeldjeffrey and others added 12 commits June 28, 2024 14:26
- Break out getting the poc allocation bucket sizes.
- Make sure math in comments checks out.
- Try to make the math for rewards look similar enough to feel good.
- coverage_point_calculator -> reward_shares as it has to do directly with reward shares, and is not about calculating coverage points.
- AllocatedRewardShares -> DataTransferAndPocAllocatedRewardBuckets
- `HexPoints` to public so the doc comment can be seem
bumper rails retracting
There will soon be a mobile rewards v2 proto. In which we better define
what a "point" means. It was considered that Location Trust was part of
a "coverage", that will no longer be the case.

Points are the base value provided from covering a Hex, a "coverage
point" if you will.

Combining those points with location and speedtest multipliers, both
things having to with the radio directly, we arrive at "shares".
…ence

coverage points including the location trust multiplier, but not the
speedtest multiplier has been a source of confusion. Shortly, that will
no longer be the case.

This method has been renamed to raise an eyebrow as to why it needs a v1
specifier.
Copy link
Contributor Author

@andymck andymck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but as a committer i cant approve

@@ -301,12 +305,21 @@ where
transaction.commit().await?;

// now that the db has been purged, safe to write out the manifest
let reward_data = ManifestMobileRewardData {
poc_bones_per_coverage_point: Some(helium_proto::Decimal {
value: poc_dc_shares.normal.to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to support a maximum amount precision?

The rust_decimal docs says trailing zeros may be exposed when in string form, do we want to remove those?

Copy link
Contributor

@maplant maplant Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To more precisely address this, here is what the google decimal specification says (which we are adhering to):

 Additionally, services **may** preserve trailing zeroes in the fraction
 to indicate increased precision, but are not required to do so.

so either option is fine

@maplant maplant merged commit fe83fa3 into main Jul 11, 2024
17 checks passed
@maplant maplant deleted the andymck/includes-share-values-in-manifest branch July 11, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants