Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Consensus] Update main chain POW end to supply end #989

Merged
merged 4 commits into from
Jun 23, 2022

Conversation

Zannick
Copy link
Collaborator

@Zannick Zannick commented Feb 9, 2022

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.

As this will affect consensus sometime in November this year,
the release this is included in will be a mandatory release.
@Zannick Zannick added Component: Consensus Part of the core cryptocurrency consensus protocol Tag: PoW Related to Proof of Work consensus Tag: Waiting For Code Review Waiting for code review from a core developer labels Feb 9, 2022
@Zannick Zannick self-assigned this Feb 9, 2022
Copy link
Collaborator

@codeofalltrades codeofalltrades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK f416446

@WetOne
Copy link
Collaborator

WetOne commented Feb 18, 2022

utACK f416446

@codeofalltrades codeofalltrades added Tag: Waiting For QA A pull review is waiting for QA to test the pull request and removed Tag: Waiting For Code Review Waiting for code review from a core developer labels Feb 19, 2022
As this will affect consensus sometime in November this year,
the release this is included in will be a mandatory release.
@seanPhill
Copy link
Collaborator

seanPhill commented Jun 12, 2022

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.)

@Zannick
Copy link
Collaborator Author

Zannick commented Jun 12, 2022

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.

The change for the main chain should apply to testnet, devnet and regtest also.
@seanPhill
Copy link
Collaborator

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?

@seanPhill
Copy link
Collaborator

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");

@seanPhill seanPhill merged commit bca63a3 into Veil-Project:master Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Consensus Part of the core cryptocurrency consensus protocol Tag: PoW Related to Proof of Work consensus Tag: Waiting For QA A pull review is waiting for QA to test the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants