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

book: add section about private testnet testing #8937

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

conradoplg
Copy link
Contributor

@conradoplg conradoplg commented Oct 14, 2024

Motivation

We want to document how to do a private testnet testing, so that we can more easily make another one in the future when required.

Specifications & References

Solution

Tests

Follow-up Work

PR Author's Checklist

  • The PR name will make sense to users.
  • The PR provides a CHANGELOG summary.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.

PR Reviewer's Checklist

  • The PR Author's checklist is complete.
  • The PR resolves the issue.

@conradoplg conradoplg requested a review from arya2 October 14, 2024 22:32
@conradoplg conradoplg requested a review from a team as a code owner October 14, 2024 22:32
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Oct 14, 2024
Copy link
Contributor

@mpguerra mpguerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor typo fixes

book/src/dev/private-testnet.md Outdated Show resolved Hide resolved
book/src/dev/private-testnet.md Outdated Show resolved Hide resolved
Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the documentation!

There aren't any blockers, I left a few minor suggestions but they can all be safely ignored.

Comment on lines +3 to +5
The objective of a private testnet test is to test testnet activation in an
isolated fashion, before the actual testnet activation. It is usually
done using the current state of the existing testnet. For NU6, it was done
Copy link
Contributor

@arya2 arya2 Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional/Nitpick:

Suggested change
The objective of a private testnet test is to test testnet activation in an
isolated fashion, before the actual testnet activation. It is usually
done using the current state of the existing testnet. For NU6, it was done
The objective of a private Testnet test is to test Testnet activation of an upcoming
network upgrade in an isolated fashion, before the actual Testnet activation.
It is usually done using the current state of the existing Testnet. For NU6, it was done

Comment on lines +12 to +13
Make a backup of your current testnet state. Rename/copy the `testnet` folder to
`unknowntest` (because that is the name used by Zebra for custom testnets).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional/Nitpick:

Suggested change
Make a backup of your current testnet state. Rename/copy the `testnet` folder to
`unknowntest` (because that is the name used by Zebra for custom testnets).
Make a backup of your current Testnet state. Rename/copy the `testnet` folder in
Zebra's state cache directory to the lowercase version of the configured network name,
or the default `unknowntestnet` if no network name is explicitly configured.

### Set Up Lightwalletd Server

It's a good idea to set up a lightwalletd server connected to your node, and
have a (testnet) wallet connected to your lightwalletd server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point!

Optional/Nitpick:

Suggested change
have a (testnet) wallet connected to your lightwalletd server.
have a (Testnet) wallet connected to your lightwalletd server.


Choose an activation height with the other participants. It should be in
the near future, but with enough time for people to set things up; something
like 30 minutes in the future?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall us using ~30-40 blocks too, it might be better to suggest a range and note that we can usually speed up mining on Testnet or stall it altogether if we're using a different network magic.

It might also be easier to test Zebra's behaviour at the network upgrade activation under varying conditions by by restarting it to drop non-finalized blocks if it's a little further from Zebra's finalized tip.


### Ensure the Activation Height is Set in Code

While Zebra allows creating a private testnet in the config file, the height is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good note, I think we forgot to do this in our first attempt and had to set a new activation height. We may want to offer creating a new branch as an example of how to modify Zebra's relevant dependencies, though it does seem like the best way (alternatives could be to use a path or make modifications in the local Cargo registry then use cargo build --offline).

Optional/Nitpick:

Suggested change
While Zebra allows creating a private testnet in the config file, the height is
While Zebra allows creating a private Testnet in the config file, the height is


### Getting peers

It seems Zebra is not very reliable at returning its currently connected peers;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is issue #7893, it seems to affect the cached peer list as well, though it may be desirable to avoid caching inbound connection addresses in that case.

[mining]
debug_like_zcashd = true
miner_address = "t27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v"
# if you want to enable mining
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# if you want to enable mining
# if you want to enable mining, which also requires selecting the `internal-miner` compilation feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG P-Low ❄️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants