Add testnet configuration#149
Conversation
| } | ||
|
|
||
| // 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). |
There was a problem hiding this comment.
This fixes a bug where funding_streams = [] in the TOML config was silently ignored
PaulLaux
left a comment
There was a problem hiding this comment.
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.
| // 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 |
There was a problem hiding this comment.
We are aiming for a testnet, not necessarily isolated.
There was a problem hiding this comment.
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.
| let genesis_block = if is_regtest { | ||
| regtest_genesis_block() | ||
| } else { | ||
| testnet_genesis_block() | ||
| }; | ||
| let genesis_hash = block_verifier_router |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 = [] |
There was a problem hiding this comment.
if [] is a problem just specify a fixed address.
There was a problem hiding this comment.
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
Add testnet configuration to Zebra