Closed Zannick closed 2 years ago
utACK f416446b0fca307f68dbb8ce21c407197bbd1085
Is there any specific test I can do to confirm the extension of PoW to the end of supply? (I have run this, and it worked fine in the current era.)
The only thing I can think of would be to change this value for regtest to a much lower height and verify that PoW stops at that height, thus validating the behavior of the parameter.
Aside from my adding the extension to all chains, I'm not really seeing where this value is compared in the code for the lower number to have had any effect whatsoever. Maybe it was never going to happen?
Aside from my adding the extension to all chains, I'm not really seeing where this value is compared in the code for the lower number to have had any effect whatsoever. Maybe it was never going to happen?
Ah, found it in validation.cpp
!
After chainparams.h passes the value of nLastPOWBlock to LAST_POW_BLOCK it then uses that below.
//Do not accept PoW blocks after the last pow height
if (pindex->nHeight > chainparams.LAST_POW_BLOCK() && !block.IsProofOfStake())
return state.DoS(100, error("%s: Proof of Work block added after the last allowed PoW height", __func__), REJECT_INVALID, "pow-after-cutoff");
Per the team, POW should be extended throughout the end of the supply.
As a change to the chainparams, this will be a mandatory change--versions without this update will reject POW blocks starting in November 2022, causing a fork. It may be prudent to add a protocol version bump as well to enforce separately.