-
Notifications
You must be signed in to change notification settings - Fork 50
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
Adds rewards calculation for sporks #365
Conversation
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.
LGTM
false, | ||
) | ||
|
||
// Verifies that the rewards from the previous epoch does not include the new epoch's amount |
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.
When we spork, the rewards for the epoch pre-spork will be paid out when the resetEpoch
transaction is submitted. Currently this is the next day, on Thursday. It would be ideal if this multisig could be moved to Wednesday, so there isn't a 1-day delay in reward payouts, once this is enabled. cc @vishalchangrani
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.
Agreed, it would be nice to reset on the same day as the spork
In onflow/flow-core-contracts#365, we removed the payout argument from the resetEpoch transaction and function. Here, we update the CLI tool which generates arguments for this transaction accordingly.
4286: Remove payout flag, arg from resetEpoch cmd r=jordanschalm a=jordanschalm In onflow/flow-core-contracts#365, we removed the payout argument from the resetEpoch transaction and function. Here, we update the CLI tool which generates arguments for this transaction accordingly. Co-authored-by: Jordan Schalm <[email protected]>
This has been implemented (on 5/3). See the following PRs - onflow/service-account#238 onflow/flow-core-contracts#352 onflow/flow-core-contracts#365
This has been implemented (on 5/3). See the following PRs - onflow/service-account#238 onflow/flow-core-contracts#352 onflow/flow-core-contracts#365
This has been implemented (on 5/3). See the following PRs - onflow/service-account#238 onflow/flow-core-contracts#352 onflow/flow-core-contracts#365
During a spork, the
FlowEpoch.heartbeat.resetEpoch()
method is called after the spork is complete.If automatic rewards are enabled, the reward breakdown for the current epoch needs to be calculated and rewards for the next epoch need to be calculated.
This PR adds
calculateAndSetRewards()
to theresetEpoch()
method so this is done properly and automatic rewards can be paid after a spork.The creation of new epoch metadata has also been moved to before the start of the new epoch in order to have valid epoch metadata for the rewards calculations to modify. This is why it now creates an
EpochMetadata
withcounter + 1
This also removes the rewards parameter from
resetEpoch()
because it is not used any more