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 activation_heights field to NetworkParameters and implement Parameters for Network #8383

Merged
merged 37 commits into from
Apr 19, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Apr 3, 2024

Motivation

We want to have an activation_heights field on NetworkParameters so that we can use different values on Regtest and so that it can be configured for custom Testnets.

Closes #7970.
Closes #8365.
Closes #7840.

Depends-On: #8368

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 an activation_heights field to NetworkParameters
  • Adds an intermediate struct for deserializing testnet_parameters from Zebra's config
  • Implements Parameters for Network to avoid tricky conversions to zcash_primitives::consensus::Network
    • Uses placeholder values for unknown testnets, we should discuss what to do there before merging this PR

Testing

  • Adds a stored_configs_parsed_correctly test to check if new configs are valid more quickly
  • Updates the stored config for v1.7.0
  • Checks that the zcash_primitives Parameters impl for zebra-chain's Network's method outputs match those of the Parameters impl for zcash_primitives::consensus::Network.

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 C-enhancement Category: This is an improvement I-usability Zebra is hard to understand or use A-network Area: Network protocol updates or fixes NU-6 Network Upgrade: NU6 specific tasks C-testing Category: These are tests C-feature Category: New features labels Apr 3, 2024
@arya2 arya2 self-assigned this Apr 3, 2024
@arya2 arya2 changed the title add(chain): Add activation_heights field to NetworkParameters and implement Parameters for Network add(consensus): Add activation_heights field to NetworkParameters and implement Parameters for Network Apr 12, 2024
@arya2 arya2 added the do-not-merge Tells Mergify not to merge this PR label Apr 15, 2024
@arya2 arya2 mentioned this pull request Apr 15, 2024
7 tasks
@arya2 arya2 removed the do-not-merge Tells Mergify not to merge this PR label Apr 17, 2024
Base automatically changed from network-params to main April 17, 2024 02:20
upbqdn
upbqdn previously approved these changes Apr 17, 2024
zebrad/tests/acceptance.rs Outdated Show resolved Hide resolved
zebra-chain/src/parameters/network.rs Show resolved Hide resolved
zebra-rpc/src/methods/get_block_template_rpcs.rs Outdated Show resolved Hide resolved
zebra-rpc/src/methods/get_block_template_rpcs.rs Outdated Show resolved Hide resolved
zebra-rpc/src/methods/get_block_template_rpcs.rs Outdated Show resolved Hide resolved
zebra-chain/src/parameters/network_upgrade.rs Show resolved Hide resolved
upbqdn
upbqdn previously approved these changes Apr 18, 2024
zebra-chain/src/parameters/network_upgrade.rs Outdated Show resolved Hide resolved
mergify bot added a commit that referenced this pull request Apr 18, 2024
@arya2
Copy link
Contributor Author

arya2 commented Apr 18, 2024

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Apr 18, 2024

refresh

✅ Pull request refreshed

mergify bot added a commit that referenced this pull request Apr 18, 2024
@mergify mergify bot merged commit f8c1539 into main Apr 19, 2024
189 checks passed
@mergify mergify bot deleted the activ-heights-param-impl branch April 19, 2024 01:20
@arya2 arya2 added this to the Regtest Network support milestone Apr 24, 2024
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 A-network Area: Network protocol updates or fixes C-enhancement Category: This is an improvement C-feature Category: New features C-testing Category: These are tests I-usability Zebra is hard to understand or use NU-6 Network Upgrade: NU6 specific tasks P-Medium ⚡
Projects
None yet
2 participants