Skip to content

Add testnet configuration#149

Open
ronkq wants to merge 2 commits into
zsa1from
testnet-configuration
Open

Add testnet configuration#149
ronkq wants to merge 2 commits into
zsa1from
testnet-configuration

Conversation

@ronkq

@ronkq ronkq commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Add testnet configuration to Zebra

@ronkq ronkq self-assigned this Jun 30, 2026
}

// Set configured funding streams after setting any parameters that affect the funding stream address period.
// Distinguish "not configured" (None, keep defaults) from "explicitly cleared" (Some([]), clear).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This fixes a bug where funding_streams = [] in the TOML config was silently ignored

@PaulLaux PaulLaux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As discussed below, I'm far from convinced that we need to change Zebra code to enable testnet. I was expecting everything encapsulated into the config file.

Comment on lines +118 to +119
// A configured testnet with PoW disabled and no peers is a private isolated network
// (similar to Regtest). It needs the same bootstrap treatment: commit the genesis block

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We are aiming for a testnet, not necessarily isolated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If we do testnet Zebra by definition will try to connect to other nodes. There is only 1 situation where Zebra can use it's own genesis block without other nodes, and it's gated on is_regtest.
If we want testnet without other nodes the only option is to adapt this code.

Comment on lines +384 to 389
let genesis_block = if is_regtest {
regtest_genesis_block()
} else {
testnet_genesis_block()
};
let genesis_hash = block_verifier_router

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't fully understand why we need to change the zebra code. Zebra has already a stable testnet infrastructure and we need to use it. These changes will not be merged to upstream and will interfere the review process later.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Zebras testnet is designed to sync from the public Zcash testnet via peers.
The genesis block reaches the node via those peers. There is no mechanism to run a testnet node standalone - without peers

# testnet funding stream address-count validation. The funding_streams = [] below clears
# them at runtime, but the extend flag is needed to survive the earlier validation pass.
extend_funding_stream_addresses_as_required = true
funding_streams = []

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if [] is a problem just specify a fixed address.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The tx-tool builds a "coinbase" that doesn't include any funding outputs. If we set a fixed address as a funding stream, Zebra would require the coinbase to pay to it (which we can't do), and every block would be rejected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants