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

Allow pro-rated rewards to be claimed without ending the validation. #526

Open
cam-schultz opened this issue Sep 5, 2024 · 1 comment · May be fixed by #603
Open

Allow pro-rated rewards to be claimed without ending the validation. #526

cam-schultz opened this issue Sep 5, 2024 · 1 comment · May be fixed by #603
Assignees
Labels

Comments

@cam-schultz
Copy link
Contributor

Context and scope
Currently, validator rewards are claimable only after the validation is ended. This requires validators to end a validation, ending all delegations to it, in order to claim any rewards. This is poor UX for both validators (who want to attract delegators) and delegators (who often want to set and forget).

Instead, we should allow validators to supply an uptime proof at any time to claim the appropriate rewards, without ending the validation.

Discussion and alternatives
One way to accomplish this would be to track the claimableRewards by address, and provide a method submitUptimeProof that updates and releases the claimable rewards based on the received uptime reletive to the validation start time and the current block timestamp. Once #489 is complete, it's likely the same function can be called here as in completeEndValidation to compute and release the rewards.

Open questions
Should this feature be implemented for delegators? The UX considerations are less severe, since there are no other parties affected.

@cam-schultz cam-schultz added the enhancement New feature or request label Sep 5, 2024
@cam-schultz cam-schultz added this to the Staking Manager - post MVP milestone Sep 5, 2024
@cam-schultz cam-schultz added the audit scope Issues required as part of an upcoming audit scope label Sep 5, 2024
@geoff-vball geoff-vball changed the title Allow pro-rated rewards to be claimed without ending the valdiation. Allow pro-rated rewards to be claimed without ending the validation. Sep 6, 2024
@minghinmatthewlam minghinmatthewlam removed the audit scope Issues required as part of an upcoming audit scope label Sep 6, 2024
@cam-schultz
Copy link
Contributor Author

cam-schultz commented Oct 14, 2024

We need to decide how this will interact with uptime based rewards. I think the soundest approach would be to treat each pro-rated rewards collection as starting a new virtual validation period. The existing validation period would remain intact, but we would additionally track all values needed to calculate the uptime based rewards for the current virtual validation period. Each virtual validation period would be independent.

We'd have to separately track the uptime of previous validation intervals to calculate the uptime for subsequent intervals. The uptime rewards check would look something like: (uptimeSeconds-lastClaimUptimeSeconds+lastClaimTime)/(currentClaimTime - lastClaimTime) < UPTIME_REWARDS_THRESHOLD_PERCENTAGE/100. The denominator shifts the calculation to the current validation interval defined by the numerator. We'd then set lastClaimUptimeSeconds to uptimeSeconds and set lastClaimTime to currentClaimTime.

To avoid further complicating the arithmetic, I think we should revert if the pro-rated claim uses an uptime that's not eligible for rewards. There's no real use case to doing otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog 🗄️
Development

Successfully merging a pull request may close this issue.

3 participants