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

change(consensus): Allow configurable NU5 activation height on Regtest #8505

Merged
merged 4 commits into from
May 8, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented May 3, 2024

Motivation

We want to allow configuring an NU5 activation height on Regtest. This was removed in a recent PR because I thought Zebra didn't support Canopy block construction, it does, it was the proposal_block_from_template() function used in tests and the internal-miner that only worked with NU5.

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

  • Accept a current_network_upgrade argument in proposal_block_from_template()
  • Select which field from the template should be used in the block based on the current network upgrade
  • Use the testnet_parameters.activation_heights.nu5 field as the NU5 activation height on Regtest

Related Changes:

  • Updates with_activation_heights() to overwrite activation heights for all network upgrades except Genesis
  • Adds current_with_activation_height() method and uses it in Commitment::from_bytes()

Testing

The regtest_submit_blocks() test was updated to submit Canopy blocks and switch to NU5 blocks at height 100

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 do-not-merge Tells Mergify not to merge this PR P-Medium ⚡ labels May 3, 2024
@arya2 arya2 self-assigned this May 3, 2024
@arya2 arya2 requested review from a team as code owners May 3, 2024 20:51
@arya2 arya2 requested review from oxarbitrage and removed request for a team May 3, 2024 20:51
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 3, 2024
@arya2 arya2 removed the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 3, 2024
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 3, 2024
@arya2 arya2 force-pushed the allow-canopy-on-regtest branch from 80206c0 to 77feb3c Compare May 3, 2024 21:42
@arya2 arya2 changed the title change(consensus): Allow configurable Nu5 activation height on Regtest change(consensus): Allow configurable NU5 activation height on Regtest May 4, 2024
@oxarbitrage oxarbitrage removed the do-not-merge Tells Mergify not to merge this PR label May 7, 2024
Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

looks good to me, thanks!

mergify bot added a commit that referenced this pull request May 8, 2024
@mergify mergify bot merged commit 15e1096 into main May 8, 2024
137 checks passed
@mergify mergify bot deleted the allow-canopy-on-regtest branch May 8, 2024 14:46
@arya2 arya2 mentioned this pull request Jun 28, 2024
43 tasks
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
Development

Successfully merging this pull request may close these issues.

2 participants