Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

HIP-28 consensus reward calc grace period #922

Merged
merged 1 commit into from
Aug 23, 2021
Merged

Conversation

PaulVMo
Copy link
Contributor

@PaulVMo PaulVMo commented Jul 15, 2021

As described in HIP-28, this update adds a grace period in the consensus epoch reward calculation. Instead of always basing the calculation on election_interval number of block epochs, allow for up to election_interval + election_retry_interval blocks to be used in an epoch for calculating consensus rewards in order to provide time for the election itself. Change is protected behind reward_version chain var and is active when the value is >=6.

This PR does not address the other suggested changes in the HIP, specifically reallocating unearned consensus rewards to PoC as evanmcc and others have some alternative suggestions.

Lastly, this fixes the epoch reward calc for other reward types as well which was off by one block. Start and End are inclusive but epoch length was calculated as End - Start. Changed to End - Start + 1.

To-Do: add some test cases. I have verified it compiles and all existing EUnit tests execute successfully. However, I have not added any tests specific to the new code.

@PaulVMo
Copy link
Contributor Author

PaulVMo commented Jul 27, 2021

@evanmcc any chance you would be able to review my responses to your comments? I would like to have this included in the agenda for the community call tomorrow July 28 if possible.

@evanmcc
Copy link
Contributor

evanmcc commented Aug 16, 2021

in the future please rebase on master instead of merging master into the branch.

Copy link
Contributor

@Vagabond Vagabond left a comment

Choose a reason for hiding this comment

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

Would be nice to clean up the commit history here.

@PaulVMo
Copy link
Contributor Author

PaulVMo commented Aug 18, 2021

I think i was able to finally clean up the commit history. let me know how it looks.

@evanmcc evanmcc merged commit 9695bae into helium:master Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants