Tracking: Add parameters to `Network::Testnet` variant
Motivation
Zebra currently hard-codes some consensus parameters that may need to be changed for testing.
Scope
To be discussed in https://github.com/ZcashFoundation/zebra/discussions/7967.
Preparatory Refactors:
- [x] #8325
- [x] #8326
- [x] #7968
After these changes are merged, we should decide which parameters we want to add and create more issues like #7970 for each of them.
Adding Parameters:
- [x] #7970
- [x] #7840
- [x] #8361
- [x] #8362
- [x] #8327
- [x] #8412
- [ ] Add a
default_portfield toNetworkParameters(needed for custom Testnets but not Regtest) - [ ] #8364
- [x] #8365
- [x] #8366
- [ ] #8367
Possible Design
- Turn the
Testnetvariant into:
Testnet(Arc<NetworkParameters {
cache_name,
genesis_hash,
network_id,
default_port,
activation_heights,
..
>)
- Consider adding fields for:
-
slow_start_interval(nSubsidySlowStartInterval) -
target_difficulty_limit(powLimit) -
key_prefixes -
debug_mandatory_checkpoint_height: Option<Height> -
checkpoints: Path -
pow_avg_window(update logic to usemin(num_blocks_in_cache, 17))
-
- Add a
new_testnet()method orDEFAULT_TESTNETconstant with the existing testnet defaults, to replace literalTestnetvariant. - Replace matching against
Testnetwith anis_mainnet()method. (This is only required when we're matching againstTestnet, we can change theMainnetmatches gradually.)
Lowering priority as it's not clear that it's a blocker for ZSA testing anymore
Elevating priority so ZSAs can be tested with a new genesis block.
Elevating priority so ZSAs can be tested with a new genesis block.
Mining a new genesis block is out of scope for this ticket. It's an extremely tricky process, let's check what zcashd does, and open another ticket?
(It's possible they just re-use the mainnet or testnet block for all networks.)
zcashd uses a separate genesis block for testnet, and does not support multiple testnets without modifying code and rebuilding. Is it sufficient to just use that block and upgrade at height 1?
zcashd uses a separate genesis block for testnet, and does not support multiple testnets without modifying code and rebuilding. Is it sufficient to just use that block and upgrade at height 1?
@arya2 let's ask the QEDIT team when we get in touch with them? (Along with everything else, it's not an urgent question.)
@arya2 can you split out what we're going to work on from here on Sprint 24?