-
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): Add an empty Parameters
struct in Network::Testnet
#8368
Conversation
dbf3296
to
c342e5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have new_default_regtest and is_a_regtest methods similar to testnet? This would be useful for wallets to use in testing and simplify migration. They could also be used where we need to distinguish between public_testnet and regtest.
Yes, we should add a |
Yep. It caused some indecisiveness when I was naming the PR and choosing labels, since the PR is related to which Zcash network the node is in, but I think "consensus" actually fits better, I'll update the PR title to include both. Running a full sync test here: |
NetworkParameters
struct in Network::Testnet
NetworkParameters
struct in Network::Testnet
NetworkParameters
struct in Network::Testnet
Parameters
struct in Network::Testnet
I changed |
Added a do-not-merge label to wait on the full sync test to finish. |
@Mergifyio refresh |
✅ Pull request refreshed |
@Mergifyio refresh |
✅ Pull request refreshed |
@Mergifyio refresh |
✅ Pull request refreshed |
Motivation
We want to add configurable network parameters to
Network
for supportingRegtest
and custom Testnets to be used in integration tests.Closes #7968.
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.
Complex Code or Requirements
The db format for
HistoryTree
s andtransparent::Address
es are the same across any test networks, this could mean that aRegtest
cache or a customTestnet
cache could be used on the defaultTestnet
. We may want to follow up this PR with a change that ensures Zebra panics if it's configured to run on the default public testnet with aRegtest
cache, or we may want to make that change in this PR.I'd like special attention to changes in:
network == Testnet
condition was replaced withnetwork.is_a_test_network()
Network::iter()
was used instead of running withMainnet
andTestnet
being applicable toRegtest
Solution
NetworkParameters
struct and includes it inNetwork::Testnet
new_default_testnet()
method for creating the default publicTestnet
FUNDING_STREAM_HEIGHT_RANGES
,FUNDING_STREAM_ADDRESSES
, andINITIAL_MIN_NETWORK_PROTOCOL_VERSION
Testnet
to return appropriate valuesNetwork::iter()
in tests that run equivalent code for bothMainnet
andTestnet
Testnet
constructor withNetwork::new_default_testnet()
network
field ontransparent::Address
andHistoryTreeParts
toNetworkKind
Testing
Network::iter()
was used in most tests that check bothMainnet
andTestnet
so they'll cover any new networks we return from that function.This PR may still need a test for the custom deserialization of
Network
or other changes.Review
Anyone can review.
This PR may be easier to review by commit:
NetworkKind
and uses it instead ofNetwork
intransparent::Address
andHistoryTreeParts
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
NetworkParameters
, starting withactivation_heights
(Add a field for the network upgrade activation heights toTestnetParameters
#7970)