vertcoin-project / vertcoin-core

A digital currency with mining decentralisation and ASIC resistance as a key focus
https://vertcoin.org
MIT License
350 stars 134 forks source link

Move the Kimoto setting into chainparams.cpp #160

Closed Jolly-Pirate closed 3 years ago

Jolly-Pirate commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, the difficulty retargeting configuration can be confusing. At first glance, chainparams.cpp contains:

consensus.nPowTargetTimespan = 3.5 * 24 * 60 * 60; // 3.5 days
consensus.nPowTargetSpacing = 2.5 * 60;

The difficulty retargeting nPowTargetTimespan is set at 3.5 days, although according to the website, Vertcoin is using the Kimoto Gravity Well to retarget at every block. After some digging, we find in https://github.com/vertcoin-project/vertcoin-core/blob/master/src/pow.cpp#L22 that indeed the retargeting is set to 2.5 min (i.e. every block): static const int64_t BlocksTargetSpacing = 2.5 * 60; // 2.5 minutes

Describe the solution you'd like It would be less confusing to move the Kimoto BlocksTargetSpacing setting into the chainparams.cpp with the rest of the configurations. If there are other configurable settings, for example the block height when to start the Kimoto Well, move them as well. This would make things easier for testings and forking.