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

Tracking: Add regtest network #7119

Open
9 of 11 tasks
Tracked by #8632
arya2 opened this issue Jun 30, 2023 · 11 comments
Open
9 of 11 tasks
Tracked by #8632

Tracking: Add regtest network #7119

arya2 opened this issue Jun 30, 2023 · 11 comments
Labels
A-consensus Area: Consensus rule updates A-network Area: Network protocol updates or fixes C-enhancement Category: This is an improvement C-testing Category: These are tests C-tracking-issue Category: This is a tracking issue for other tasks I-usability Zebra is hard to understand or use S-blocked Status: Blocked on other tasks S-needs-design Status: Needs a design decision S-needs-triage Status: A bug report needs triage

Comments

@arya2
Copy link
Contributor

arya2 commented Jun 30, 2023

Motivation

This has been requested, and could be useful for testing.

Depends-On: #7845

Possible Design

@arya2 arya2 added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage A-consensus Area: Consensus rule updates I-usability Zebra is hard to understand or use A-network Area: Network protocol updates or fixes C-testing Category: These are tests labels Jun 30, 2023
@teor2345
Copy link
Collaborator

teor2345 commented Jul 2, 2023

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.

  • update From<Network> for &'static str for db_path()

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.

  • Set peerset_initial_target_size to 0 (Zebra should not make any peer connections)

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.

  • Update prefixes

Which prefixes?

  • Match other differences between zcashd testnet vs regtest in chainparams

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:

  • changes needed to have a regtest mode
  • changes requested by the people who requested regtest mode (please link to the request in the ticket)
  • other changes that are useful for full compatibility with zcashd

That way, when we schedule this work, we can split the ticket, give the categories different priorities, then do the estimates.

@teor2345 teor2345 added the S-needs-design Status: Needs a design decision label Jul 2, 2023
@teor2345
Copy link
Collaborator

teor2345 commented Jul 2, 2023

Here's one request for regtest in Zebra:
https://twitter.com/thecodebuffet/status/1674606998908727297

Screenshot in case twitter goes down:
Screenshot 2023-07-03 at 07 27 25

@teor2345
Copy link
Collaborator

This is currently blocked by some kind of network refactor. (It doesn't have to be #1135 specifically.)

@mpguerra
Copy link
Contributor

Hey team! Please add your planning poker estimate with Zenhub @arya2 @oxarbitrage @teor2345 @upbqdn

@teor2345
Copy link
Collaborator

@mpguerra this ticket is outdated. @arya2 and I have had some private conversations about it, and I think we should update it before we estimate it. (Or replace it with another ticket.)

@teor2345
Copy link
Collaborator

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.

  • Add a Regtest variant to Network, update From<Network> for &'static str for db_path(), default port, and genesis hash

It will be much easier to gradually add network settings inside the existing Testnet variant. Adding new variants requires changing a lot of code.

  • Add config field or CLI option for accepting network upgrade heights

This should be split into a different ticket, it's not required to match the default zcashd regtest.

@teor2345
Copy link
Collaborator

I added these issues to the ticket description, we might need to fix them depending on the required scope:

  • difficulty adjustment for heights less than 17
  • contextual validation of the genesis block (it has to be a checkpoint)

#7770 (comment)

@mpguerra mpguerra added the C-tracking-issue Category: This is a tracking issue for other tasks label Oct 26, 2023
@mpguerra mpguerra changed the title Add regtest network Tracking: Add regtest network Oct 26, 2023
@hhanh00
Copy link

hhanh00 commented Feb 24, 2024

Personally, the lack of regtest support blocks me from moving to zebrad because it is too hard to write integration tests.

@arya2
Copy link
Contributor Author

arya2 commented Apr 30, 2024

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?

@hhanh00
Copy link

hhanh00 commented May 1, 2024

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 arya2 self-assigned this May 1, 2024
@arya2 arya2 added this to the Regtest Network support milestone May 1, 2024
@mpguerra mpguerra linked a pull request May 21, 2024 that will close this issue
9 tasks
@arya2 arya2 removed their assignment Jun 3, 2024
@mpguerra
Copy link
Contributor

mpguerra commented Sep 5, 2024

@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
Do we know what these are? If so we should update this issue with the remaining work to make them compatible

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-testing Category: These are tests C-tracking-issue Category: This is a tracking issue for other tasks I-usability Zebra is hard to understand or use S-blocked Status: Blocked on other tasks S-needs-design Status: Needs a design decision S-needs-triage Status: A bug report needs triage
Projects
Status: Product Backlog
Development

No branches or pull requests

4 participants