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

add(consensus): Add a target_difficulty_limit field on testnet::Parameters #8518

Merged
merged 4 commits into from
May 17, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented May 10, 2024

Motivation

We want to use the same target_difficulty_limit on Regtest as zcashd and allow for it to be configured on custom testnets.

Closes #8479.

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?
For significant changes:
  • Is there a summary in the CHANGELOG?
  • Can these changes be split into multiple PRs?

If a checkbox isn't relevant to the PR, mark it as done.

Solution

  • Adds a target_difficulty_limit field on testnet::Parameters
  • Returns it for Testnets in the Network::target_difficulty_limit method
  • Checks block difficulty thresholds in block/checkpoint verifiers

Testing

Manually tested that the internal miner still works on Regtest, and now that the block/checkpoint verifiers validate the difficulty threshold, the changes in this PR are covered by the validate_regtest_genesis_block and regtest_submit_blocks acceptance tests.

Review

Anyone can review.

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

@arya2 arya2 added A-consensus Area: Consensus rule updates NU-6 Network Upgrade: NU6 specific tasks C-testing Category: These are tests P-Medium ⚡ labels May 10, 2024
@arya2 arya2 self-assigned this May 10, 2024
@arya2 arya2 requested a review from a team as a code owner May 10, 2024 22:12
@arya2 arya2 requested review from upbqdn and removed request for a team May 10, 2024 22:12
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 10, 2024
mergify bot added a commit that referenced this pull request May 14, 2024
@upbqdn upbqdn removed the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 14, 2024
upbqdn
upbqdn previously approved these changes May 16, 2024
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 17, 2024
@arya2 arya2 requested a review from upbqdn May 17, 2024 19:33
mergify bot added a commit that referenced this pull request May 17, 2024
@mergify mergify bot merged commit 99b017e into main May 17, 2024
137 checks passed
@mergify mergify bot deleted the params-target-difficulty-limit branch May 17, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG NU-6 Network Upgrade: NU6 specific tasks P-Medium ⚡
Projects
None yet
2 participants