Skip to content

Base PoR rewards on superblock windows #768

@denravonska

Description

@denravonska

Right now when a user stakes we check the magnitude at the time of the previous stake and base the payments on that. This allows you to stake and go offline without actually crunching, and you will still get paid in full on the next stake. We should change this to base the payments on all the superblock windows from the previous stake:

Assuming there is a superblock every day it looks something like this now:

  • Stake, SB1: Magnitude 100 -> 10 GRC
  • Offline, SB2: Magnitude 10
  • Offline, SB3: Magnitude 0
  • Stake, SB4: Magnitude 0 -> 10 (SB2) + 10 (SB3) + 10 (SB4) = 30 GRC

I want to change this to:

  • Stake, SB1: Magnitude 100 -> 10 GRC
  • Offline, SB2: Magnitude 10 -> 0.1 GRC
  • Offline, SB3: Magnitude 0 -> 0 GRC
  • Stake, SB4: Magnitude 0 -> 0.1 (SB2) + 0 (SB3) + 0 (SB4) = 0.1 GRC

I did a test for this a while ago and it was too slow to verify. Even scanning a few weeks back took a few seconds, so scanning 6 months would be really slow. However, with the recent optimizations it is very likely that this operation is much smoother now.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions