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

rewards halvening #577

Merged
merged 4 commits into from
Jul 31, 2023
Merged

rewards halvening #577

merged 4 commits into from
Jul 31, 2023

Conversation

andymck
Copy link
Contributor

@andymck andymck commented Jul 24, 2023

This updates the iot and mobile verifier to account for the rewards halvening to be applied in August

Copy link
Contributor

@jeffgrunewald jeffgrunewald left a comment

Choose a reason for hiding this comment

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

Would we not like to gate this feature by date comparison since these rewards are usually calculated in the context of a DateTime range “epoch” period and go ahead and merge this well ahead of the event?

@andymck
Copy link
Contributor Author

andymck commented Jul 24, 2023

Would we not like to gate this feature by date comparison since these rewards are usually calculated in the context of a DateTime range “epoch” period and go ahead and merge this well ahead of the event?

I mean we could but it does add additional risk and will make it that bit more difficult to test and verify before going live. I think merging on the day is likely the best scenario here.

The plan is to implement the reward curve into the code post this halving

@maplant
Copy link
Contributor

maplant commented Jul 24, 2023

Would it make more sense to define some constant that is halving? So instead of having to manually halve all of the constants in the tests, we can just divide them by the constant?

@@ -18,7 +18,7 @@ const DEFAULT_PREC: u32 = 15;
lazy_static! {
// TODO: year 1 emissions allocate 30% of total to PoC with 6% to beacons and 24% to witnesses but subsequent years back
// total PoC percentage off 1.5% each year; determine how beacons and witnesses will split the subsequent years' allocations
static ref REWARDS_PER_DAY: Decimal = (Decimal::from(65_000_000_000_u64) / Decimal::from(365)) * Decimal::from(1_000_000); // 178_082_191_780_822
static ref REWARDS_PER_DAY: Decimal = (Decimal::from(32_500_000_000_u64) / Decimal::from(366)) * Decimal::from(1_000_000); // 88_797_814_207_650.273224043715847
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the 366 because 2024 is a leap year? Are rewards not allocated per 365 days?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct its due to 2024 being a leap year which is accounted for in the number of days

@bbalser bbalser marked this pull request as ready for review July 31, 2023 13:23
@bbalser bbalser merged commit 46b9c71 into main Jul 31, 2023
1 check passed
@bbalser bbalser deleted the andymck/rewards-halvening branch July 31, 2023 13:24
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