-
Notifications
You must be signed in to change notification settings - Fork 35
Removing unallocated rewards #1112
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
base: main
Are you sure you want to change the base?
Conversation
Cargo.toml
Outdated
| # [patch.'https://github.com/helium/proto'] | ||
| # helium-proto = { git = "https://www.github.com/helium/proto.git", branch = "dcyoung/radio-usage-stats-req-v2" } | ||
| [patch.'https://github.com/helium/proto'] | ||
| helium-proto = { git = "https://www.github.com/helium/proto.git", branch = "connor/missing-bones-sp-rewards" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
|
I'd like to see if we can tighten some of this up.
Also wondering if we still need to be committing speedtest_averages during rewards? |
With the current rewarding, depending on the total epoch emissions there may be a bone unaccounted for due to rounding. Currently, we write an unallocated reward for unaccounted for bones during poc rewarding. We do not write unallocated rewards for service providers because the full amount is rewarded. In total, this accounts for 94% of the total epoch emissions.
If the poc unallocated amount is less than 1, it will not be written. The problem is that when we calculate the reward amount for service providers, we round to 0, which could dismiss 0.8 of a bone. If we are dismissing 0.6 of a bone during poc rewarding, and dismissing 0.8 of a bone during service provider rewarding, we then have 1.4 bones that are unaccounted for.
Example:
Total epoch emissions 82191780821915
poc and dc rewards: 57534246575340
sp: 19726027397259
poc unallocated: 0.5
sp unallocated: 0.6 (both less than 0 so no unallocated reward written)
result: 77260273972599
94%: 77260273972600.1
Missing 1.1 bones
In this PR, I have moved the writing of unallocated rewards out of poc. Now we calculate the difference between 94% of total rewards and the allocated poc and dc rewards which is to be rewarded to service providers.