-
Notifications
You must be signed in to change notification settings - Fork 108
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): Adds block construction and validation for NU5 from block height 1 for Regtest #8475
Conversation
…ating or updating HistoryTree - Skips call to `check::legacy_chain()` when no NU5 activation height is set (it would return immediately anyway) - Replaces `.map()` with `.filter_map()` in `NetworkUpgrade::target_spacings()` - Removes outdated TODO
…o the network tip in the getblocktemplate method
…esis block if it's missing in the state
…ation root hash, uses Nu5 at height 1 Test passes.
Update: Applied the correct slow start interval, cancelled the first full sync test, and running a new full sync test here: https://github.com/ZcashFoundation/zebra/actions/runs/8904708364 I'm also running one locally with checkpoint sync disabled on the |
zebra-rpc/src/methods/get_block_template_rpcs/get_block_template.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: Marek <[email protected]>
zebra-rpc/src/methods/get_block_template_rpcs/get_block_template.rs
Outdated
Show resolved
Hide resolved
@Mergifyio refresh |
✅ Pull request refreshed |
Motivation
We want to support Regtest in Zebra for integration testing.
Closes #8363.
Closes #8280.
Part of #7119.
This PR shouldn't change much, theregtest_nu5_activation_height
field in the config should be removed, but that's a minor change.Update: This PR shouldn't change anymore except to address review comments.
PR Author Checklist
Check before marking the PR as ready for review:
For significant changes:
If a checkbox isn't relevant to the PR, mark it as done.
Specifications
I couldn't find thePOW_ADJUSTMENT_BLOCK_SPAN
in the protocol spec, I don't think this should be a problem because there are always more than that many blocks where a check was replaced withrelevant_chain.is_empty()
by Canopy activation.Update:
It's based on MedianTime and ActualTimespan in the specification, PoWAveragingWindow is also used in MeanTarget.
Solution
is_regtest()
in the start command, and if it is, commits the Regtest genesis block and skips starting the syncerCanopy
activation for non-default networks (this may need some follow up changes, or changes in this PR)NetworkKind::Regtest
getblocktemplate
method for blocks that should activateHeartwood
network upgradeHeight(0)
if PoW is disabled (this should be changed in a follow up PR or in this PR)Testing
Added a test that gets block templates and submits them as blocks
Review
Anyone can review.
Reviewer Checklist
Check before approving the PR:
PR blockers can be dealt with in new tickets or PRs.
And check the PR Author checklist is complete.
Follow Up Work
debug_validate_without_checkpoints
field totestnet::Parameters
and ignores the ZIP-212 grace period on Regtest #8428zcash_address::Network
instead ofNetworkKind
in transparent addresses?