-
Notifications
You must be signed in to change notification settings - Fork 183
Description
This is kind of a small addition to my proposal in #1578 and might be something to think about when changing the reward calculations.
The current code uses at least three different definitions of time intervals:
-
1 day = 960 blocks
- Consequence of
GetTargetSpacing()
in main.h - Used for difficulty calculation
- Consequence of
-
1 day = 1000 blocks
- Defined in main.h
- Used for mag unit calculation/PoR average tallying,
- for the PoR lookback limit
- and for lookbacks in some RPC commands
-
1 day = 60*60*24 seconds = 86400 seconds
Note that the second definition doesn't even make sense, it's just plain wrong.
While this isn't really a problem, it does seem like a giant mess to me and I could see it leading to some confusion. It seems that even simple questions like "What is the daily emission for BOINC research?" don't really have definite answers because of this: The mag unit calculation seems to be supposed to target 25000 GRC per 1000 blocks, which would be 24000 per 960 blocks. But what if there are much more or much less blocks generated on a day than the anticipated 960? The reward calculation itself doesn't directly react to this, the rewards only adjust once the mag unit changes... eventually.
So does the emission target a timespan or a blockspan now? You see, it's just very confusing...
I feel like using timestamps for consensus rules where blocks could be used instead is pretty much frowned upon in the blockchain developer community anyway...
With the proposed mandatory changes to the reward calculations in #768, this seems like a good opportunity to clean this up a little bit: Change the stuff using timestamps to use block spans instead, and consistently use a 960 block interval for everything that is supposed to be one day on average (get rid of the "1000 blocks per day" nonsense).
It might also be a good idea to make the users more aware that things are based on block spans in RPC outputs/help texts and in the GUI by either writing "per N blocks" instead of "per N days" or prefixing time information with something like "ca." or "~".