-
Notifications
You must be signed in to change notification settings - Fork 106
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/network): Adds new_regtest()
constructors to testnet::Parameters
and Network
#8413
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…pdates production code.
…rts` and `transparent::Address`
…orkKind` as zebra_network::Config::network field type, and converts 'Network' to `NetworkKind` before serializing
…l for zcash_primitives::consensus::Network
Co-authored-by: Marek <mail@marek.onl>
…red configs can be parsed, adds an intermediate representation of activation heights
…rk where there were conversions
…serde(default)] - Panics if a non-zero activation height is provided for the `Genesis` network upgrade - Always sets the `Genesis` and `BeforeOverwinter` network upgrade activation heights to 0 and 1, `BeforeOverwinter` could be overwritten by a later network upgrade - Makes the `activation_heights` field on `Parameters` private, adds/uses an accessor method instead, and adds a builder struct and `build()` method
… the next NetworkUpgrade if it doesn't find the activation height of `&self`
… assertion message
…r how activation heights can be configured
…s test, moves struct with activation heights outside deserialization impl and accepts it in `ParametersBuilder::activation_heights()` instead of a Vec
… in `new_regtest()`. Adds a test for Sapling HRP validation
…ion in `with_sapling_hrps()`
arya2
force-pushed
the
params-new-regtest
branch
from
April 19, 2024 19:44
741c158
to
b38dbfd
Compare
9 tasks
@arya2, this PR needs a manual merge conflict resolution. |
upbqdn
previously approved these changes
Apr 24, 2024
upbqdn
previously approved these changes
Apr 24, 2024
upbqdn
reviewed
Apr 24, 2024
upbqdn
approved these changes
Apr 24, 2024
@Mergifyio refresh |
✅ Pull request refreshed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We want to support
Regtest
in Zebra.This PR adds methods for creating a new
Network
ortestnet::Parameters
with theRegtest
parameters as the values of fields that exist ontestnet::Parameters
so far.We'll need to add at least a few more fields (see 'Follow Up Work') that are needed for
Regtest
totestnet::Parameters
and set them as theirRegtest
values in these methods for Zebra to support a minimal version ofRegtest
. Creating the genesis block may also rely on adding more parameters.Closes #7839.
Depends-On: #8411.
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.
Solution
new_regtest()
constructor methods totestnet::Parameters
andzebra_chain::Network
Network::new_regtest()
instead ofunimplemented!()
in thezebra_network::Config
deserializationwith_sapling_hrps()
method onParametersBuilder
and uses it to set theRegtest
HRPs innew_regtest()
Related Cleanups:
testnet_parameters
in the config onMainnet
andRegtest
(and the Regtest activation heights on other networks)zebra_network::Config
deserializationParametersBuilder
intestnet::Parameters::default()
Testing
Regtest
activation heights inactivates_network_upgrades_correctly()
ParametersBuilder
validates configured Sapling HRPs as expectedReview
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
Regtest
genesis block from zcashd #8412genesis_hash
field toNetworkParameters
#8366debug_disable_pow_check
field toNetwork
#8362disable_peers
field totestnet::Parameters
#8361