-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat: observer rewards #855
Conversation
} | ||
rewardPerUnit := sdkmath.ZeroInt() | ||
if totalRewardsUnits > 0 && amount.IsPositive() { | ||
rewardPerUnit = amount.Quo(sdk.NewInt(totalRewardsUnits)) |
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.
Ballots can be cleared after this distribution if needed, decided not to do this in this PR . Can be added in later
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.
👍
Many comments but many of them are small.
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.
Looks good, just a few comments.
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.
Overall looks good.
Q: where is the performance of observer votes tracked and rewarded/slashed?
We are not tracking the performance. Is there a reason to do that? The ballots are not deleted, so we could write an off-chain solution to create that if needed. Lets discuss this over a GitHub issue if needed |
Ok we can do that separately. |
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.
👍
@@ -15,7 +15,8 @@ message GenesisState { | |||
repeated Ballot ballots = 1; | |||
repeated ObserverMapper observers = 2; | |||
repeated NodeAccount nodeAccountList = 3; |
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.
put snake case on this field as well?
Description
Add functions to
testutil/network
for addingcrosschain
andobserver
genesis state, which tests can use in all modules. Refactor existing tests to use these functions instead of local counterparts in the module itselfAdd begin block function in
emissions
module to calculate and allocate rewardsMove
Block Reward components
to its file underemissons/keeper
Add ballot creation height to
ballots
.Add
BallotMaturityHeight
param .Add unit tests for
BuildRewardsDistribution
andDistributeObserverRewards
This PR does not add a migration script to modify existing ballots on the testnet , or distribute any of the older rewards
Closes: #839
Type of change