-
Notifications
You must be signed in to change notification settings - Fork 113
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
Tracking: Add regtest network #7119
Comments
These are just some notes for if we eventually do this ticket. No action is needed at this time. We might also want to take a look at: It seems like some of these changes would benefit from the Regtest variant containing a consensus rule configuration. (Like zcashd has for all its network variants.) It would also be a lot easier to make this change if we refactored all our network conditions into methods on the Network enum. For example, a has_slow_start() method, rather than a match statement buried in the zebra-consensus code.
We either need to work out how to make sure the consensus rules match the cached state, or make regtest ephemeral by default. This isn't an issue for mainnet or testnet because their rules are fixed and can't be configured.
This change isn't enough to stop Zebra making outbound connections, because Zebra will try to connect to new peers every minute or so. Instead, the initial seed peers list needs to be empty for regtest.
Which prefixes?
If we're not going to connect to other nodes by default, then compatibility with zcashd seems like a lower priority. So we might want to categorise this ticket into:
That way, when we schedule this work, we can split the ticket, give the categories different priorities, then do the estimates. |
Here's one request for regtest in Zebra: |
This is currently blocked by some kind of network refactor. (It doesn't have to be #1135 specifically.) |
Hey team! Please add your planning poker estimate with Zenhub @arya2 @oxarbitrage @teor2345 @upbqdn |
For example: I'd like to split the tasks in this ticket based on what the ZSA team needs for their testing, then do the rest of regtest later.
It will be much easier to gradually add network settings inside the existing
This should be split into a different ticket, it's not required to match the default |
I added these issues to the ticket description, we might need to fix them depending on the required scope:
|
Personally, the lack of regtest support blocks me from moving to zebrad because it is too hard to write integration tests. |
@hhanh00 Is it enough for Zebra to support NU5 on its Regtest, or is it important that Zebra support Canopy and prior network upgrades on Regtest as well? |
Just nu5 is enough but I would also need the ability to generate, invalidate and reconsider blocks. This is how the project I work on tests forks and reorganizations. |
@arya2 it seems like there are still some meaningful gaps between zebra regtest mode and zcashd regtest mode. See: https://discord.com/channels/809218587167293450/811004767043977288/1280987474918772858 |
Most of the outstanding work is probably in adding the invalidate and reconsiderblock RPCs, but the other remaining differences that come to mind are:
There's also some cleanup to be done in #8367 that would simplify some code and allow for configuring network protocol versions on custom Testnets. |
Motivation
This has been requested, and could be useful for testing.
Depends-On: #7845
Possible Design
regtest()
constructor method toNetwork
#7839name
field toNetworkParameters
to be used at the end of the cache dir path #8327NetworkUpgrade::activation_height
to use zcashd defaults or user-defined heightstarget_difficulty_limit()
andexpected_difficulty
returned bydifficulty_time_and_history_tree()
to match zcashd target difficulty for regtest #8479PoWLimit
must be less than or equal to(2^256 - 1) / PoWAveragingWindow
(approximately2^251
) to avoid overflowSLOW_START_INTERVAL
checks (nSubsidySlowStartInterval
is 0 for regtest in zcashd)disable_peers
field totestnet::Parameters
#8361NetworkParameters
#8367The text was updated successfully, but these errors were encountered: