onflow / onflow/flow-core-contracts
Refactor rewards calculation and payment to be done in batches
Nobody has claimed this yet.
- Dominant language
- Cadence
- Stars
- 93
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
Issue To Be Solved
The rewards payment transaction currently is a very long and costly transaction and should be made more efficient.
Suggest A Solution
And ideal solution would dynamically split up the rewards payments into batches that are a reasonable size based on number of delegators, expected gas usage, etc.
The FlowEpoch.EpochMetadata.rewardAmounts still needs to be stored in the current epoch's metadata every time in the same format as usual.
In FlowEpoch.heartbeat(), pay these batches over the course of successive blocks.
Open questions
Specifics about how and where to split these up most efficiently.
How do we determine the ideal size for a batch of rewards payments?
Can we make the batch size dynamically determined so we don't have to update it as the network grows and shrinks?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.