hyperhyperspace / pulsar

Pulsar: The Web Blockchain
MIT License
5 stars 2 forks source link

Use minimum speedRatio of 2 #3

Closed jio-gl closed 3 years ago

jio-gl commented 3 years ago

Otherwise, the difficulty calculation can degenerate to base (speedRatio) of exponent being close to 1 and slots have no or small impact on the final number of the difficulty.

UPDATE: choosing 1.3 right now because a small minimum has good benefits for variance.

Example:

>>> math.floor(2000 * 2.1**0 )
2000
>>> math.floor(2000 * 2.1**1 )
4200
>>> math.floor(2000 * 2.1**2 )
8820
>>> math.floor(2000 * 2.1**3 )
18522
>>> math.floor(2000 * 2.1**4 )
38896
>>> math.floor(2000 * 2.1**8 )
756457
>>> math.floor(2000 * 2.1**16 )
286113738
>>> math.floor(2000 * 2.1**32 )
40930535550013
>>>
>>> math.floor(2000 * 1.1**0 )
2000
>>> math.floor(2000 * 1.1**1 )
2200
>>> math.floor(2000 * 1.1**2 )
2420
>>> math.floor(2000 * 1.1**3 )
2662
>>> math.floor(2000 * 1.1**4 )
2928
>>> math.floor(2000 * 1.1**8 )
4287
>>> math.floor(2000 * 1.1**16 )
9189
>>> math.floor(2000 * 1.1**32 )
42227
>>>
>>> math.floor(2000 * 1.01**0 )
2000
>>> math.floor(2000 * 1.01**1 )
2020
>>> math.floor(2000 * 1.01**2 )
2040
>>> math.floor(2000 * 1.01**3 )
2060
>>> math.floor(2000 * 1.01**4 )
2081
>>> math.floor(2000 * 1.01**8 )
2165
>>> math.floor(2000 * 1.01**16 )
2345
>>> math.floor(2000 * 1.01**32 )
2749