Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,952 changes: 470 additions & 4,482 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,10 @@ resolver = "2"

# workspace
zingo_test_vectors = { path = "zingo_test_vectors" }
zcash_local_net = { path = "zcash_local_net" }
zingo-consensus = { path = "zingo-consensus" }

#zcash
zcash_protocol = { version = "0.9.0", features = ["local-consensus"] }

# zebra
zebra-chain = "9.0.0"
zebra-node-services = "7.0.0"
zebra-rpc = "9.0.0"

#protocol
bip0039 = "0.12.0"

# other
getset = "0.1.3"
hex = "0.4.3"
json = "0.12.4"
reqwest = { version = "0.12", default-features = false }
Expand All @@ -39,6 +27,3 @@ tracing-subscriber = "0.3.15"

[profile.dev.package]
insta.opt-level = 3

[patch.crates-io]
libzcash_script = { git = "https://github.com/zancas/zcash_script", branch = "fix-bindgen-rust-target" }
9 changes: 0 additions & 9 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ all-features = false
no-default-features = false
exclude = ["bincode", "json"]

[advisories]
ignore = [
# proc-macro-error2 (unmaintained) arrives via getset, which orchard 0.14
# pins inside the zebra-rpc chain, so no local change can remove it from
# the lock. Compile-time-only proc-macro, not runtime code. Remove this
# entry once orchard/zebra drop getset upstream.
{ id = "RUSTSEC-2026-0173", reason = "getset -> proc-macro-error2 pinned by orchard 0.14; no upgrade path" },
]

[bans]
multiple-versions = "warn"
wildcards = "allow"
Expand Down
13 changes: 2 additions & 11 deletions regtest-launcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,12 @@ repository = "https://github.com/zingolabs/infrastructure"
homepage = "https://github.com/zingolabs/infrastructure"

[dependencies]
bip0039.workspace = true
clap = { version = "4.5.53", features = ["derive"] }
hex.workspace = true
local-net = { path = "../zcash_local_net", package = "zcash_local_net" }
owo-colors = "4.2.3"
ripemd = "0.1.3"
secp256k1 = "0.29.1"
sha2 = "0.10.9"
tokio = { workspace = true, features = ["signal"] }
zcash_keys = "0.13.0"
zcash_protocol = "0.8.0"
zcash_transparent = { version = "0.7.0", features = ["transparent-inputs"] }
zebra-node-services = { workspace = true, features = ["rpc-client"] }
zebra-rpc.workspace = true
zip32 = "0.2.1"
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "time"] }
zingo_test_vectors.workspace = true

[dev-dependencies]
anyhow = "1.0.100"
Expand Down
18 changes: 12 additions & 6 deletions regtest-launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ Tiny Rust binary that launches a local Zcash regtest network (Zebrad & Zainod) a
## Overview

- Starts a local validator + indexer using `zcash_local_net`.
- Uses a provided miner transparent address **or** generates a fresh regtest transparent keypair.
- Mines to a provided transparent address, defaulting to the well-known
ABANDONART fixture address. Its seed is the public BIP-39 test mnemonic
(`abandon` x23, `art`), so default-mined funds are spendable by importing
that phrase into any wallet. Supply `--miner-address` to mine directly to
a wallet you control.
- Bootstraps the chain up to height **101**.
- Then mines a new block every **5s**.
- Prints indexer port + miner address, if generated.
- Prints indexer port + miner address.

## Usage

Expand All @@ -17,14 +21,16 @@ Usage: regtest-launcher [OPTIONS]

Options:
--activation-heights <ACTIVATION_HEIGHTS>
Comma-separated activation heights, e.g. "all=1,nu5=1000,nu6=off,nu6_1=off,nu6_2=off,nu7=off"
Comma-separated activation heights, e.g. "all=1,nu5=1000,nu6=off,nu6_1=off,nu6_2=off,nu6_3=off,nu7=off"

Keys: before_overwinter, overwinter, sapling, blossom, heartwood, canopy, nu5, nu6, nu6_1, nu6_2, nu7, all Values: u32 or off|none|disable
Keys: before_overwinter, overwinter, sapling, blossom, heartwood, canopy, nu5, nu6, nu6_1, nu6_2, nu6_3, nu7, all Values: u32 or off|none|disable

[default: all=1,nu5=2,nu6=2,nu6_1=5,nu6_2=5,nu7=off]
[default: all=1,nu5=2,nu6=2,nu6_1=5,nu6_2=5,nu6_3=off,nu7=off]

--miner-address <MINER_ADDRESS>
Optional miner address for receiving block rewards
Miner address for receiving block rewards

[default: tmBsTi2xWTjUdEXnuTceL7fecEQKeWaPDJd]

-h, --help
Print help (see a summary with '-h')
Expand Down
61 changes: 53 additions & 8 deletions regtest-launcher/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
use clap::Parser;
use local_net::validator::REGTEST_FIXTURE_HEIGHTS_CLI_STRING;
use zebra_rpc::client::zebra_chain::parameters::testnet::ConfiguredActivationHeights;

/// Activation heights parsed from the CLI.
///
/// A superset of `zingo_consensus::ActivationHeights`: the CLI also accepts
/// zebra's `before_overwinter` slot, which the zingo type does not model
/// (it is dropped when the parsed heights convert for the harness).
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct ConfiguredActivationHeights {
/// BeforeOverwinter activation height.
pub before_overwinter: Option<u32>,
/// Overwinter activation height.
pub overwinter: Option<u32>,
/// Sapling activation height.
pub sapling: Option<u32>,
/// Blossom activation height.
pub blossom: Option<u32>,
/// Heartwood activation height.
pub heartwood: Option<u32>,
/// Canopy activation height.
pub canopy: Option<u32>,
/// NU5 activation height.
pub nu5: Option<u32>,
/// NU6 activation height.
pub nu6: Option<u32>,
/// NU6.1 activation height.
pub nu6_1: Option<u32>,
/// NU6.2 activation height.
pub nu6_2: Option<u32>,
/// NU6.3 activation height.
pub nu6_3: Option<u32>,
/// NU7 activation height.
pub nu7: Option<u32>,
}

#[derive(Parser, Debug)]
pub struct Cli {
/// Comma-separated activation heights, e.g.
/// "all=1,nu5=1000,nu6=off,nu6_1=off,nu6_2=off,nu7=off"
/// "all=1,nu5=1000,nu6=off,nu6_1=off,nu6_2=off,nu6_3=off,nu7=off"
///
/// Keys: before_overwinter, overwinter, sapling, blossom, heartwood, canopy, nu5, nu6, nu6_1, nu6_2, nu7, all
/// Keys: before_overwinter, overwinter, sapling, blossom, heartwood, canopy, nu5, nu6, nu6_1, nu6_2, nu6_3, nu7, all
/// Values: u32 or off|none|disable
///
/// Default comes from
Expand All @@ -23,9 +55,15 @@ pub struct Cli {
)]
pub activation_heights: ConfiguredActivationHeights,

/// Optional miner address for receiving block rewards.
#[arg(long)]
pub miner_address: Option<String>,
/// Miner address for receiving block rewards.
///
/// Defaults to the well-known ABANDONART fixture address
/// ([`zingo_test_vectors::REG_T_ADDR_FROM_ABANDONART`]), whose seed
/// phrase is the public BIP-39 test mnemonic (abandon x23, art), so the
/// mined funds are spendable by importing that phrase into any wallet.
/// Supply your own address to mine directly to a wallet you control.
#[arg(long, default_value = zingo_test_vectors::REG_T_ADDR_FROM_ABANDONART)]
pub miner_address: String,
}

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
Expand All @@ -40,10 +78,11 @@ enum UpgradeKey {
Nu6,
Nu6_1,
Nu6_2,
Nu6_3,
Nu7,
}

const UPGRADE_ORDER: [UpgradeKey; 11] = [
const UPGRADE_ORDER: [UpgradeKey; 12] = [
UpgradeKey::BeforeOverwinter,
UpgradeKey::Overwinter,
UpgradeKey::Sapling,
Expand All @@ -54,6 +93,7 @@ const UPGRADE_ORDER: [UpgradeKey; 11] = [
UpgradeKey::Nu6,
UpgradeKey::Nu6_1,
UpgradeKey::Nu6_2,
UpgradeKey::Nu6_3,
UpgradeKey::Nu7,
];

Expand All @@ -71,6 +111,7 @@ fn parse_key(k: &str) -> Option<UpgradeKey> {
"nu6" => Some(UpgradeKey::Nu6),
"nu6_1" | "nu6.1" | "nu61" => Some(UpgradeKey::Nu6_1),
"nu6_2" | "nu6.2" | "nu62" => Some(UpgradeKey::Nu6_2),
"nu6_3" | "nu6.3" | "nu63" => Some(UpgradeKey::Nu6_3),
"nu7" => Some(UpgradeKey::Nu7),
_ => None,
}
Expand All @@ -88,6 +129,7 @@ fn set_field(cfg: &mut ConfiguredActivationHeights, key: UpgradeKey, val: Option
UpgradeKey::Nu6 => cfg.nu6 = val,
UpgradeKey::Nu6_1 => cfg.nu6_1 = val,
UpgradeKey::Nu6_2 => cfg.nu6_2 = val,
UpgradeKey::Nu6_3 => cfg.nu6_3 = val,
UpgradeKey::Nu7 => cfg.nu7 = val,
}
}
Expand Down Expand Up @@ -122,11 +164,13 @@ fn parse_activation_heights(s: &str) -> Result<ConfiguredActivationHeights, Stri
nu6: None,
nu6_1: None,
nu6_2: None,
nu6_3: None,
nu7: None,
};

// Matches clap's default behaviour. Is there a better way to do this?
set_all(&mut cfg, Some(1));
cfg.nu6_3 = None;
cfg.nu7 = None;

for part in s.split(',').map(str::trim).filter(|p| !p.is_empty()) {
Expand All @@ -145,7 +189,7 @@ fn parse_activation_heights(s: &str) -> Result<ConfiguredActivationHeights, Stri
let from = parse_key(&key).ok_or_else(|| {
format!(
"Unknown activation key '{k}'. Valid keys: \
before_overwinter, overwinter, sapling, blossom, heartwood, canopy, nu5, nu6, nu6_1, nu6_2, nu7, all"
before_overwinter, overwinter, sapling, blossom, heartwood, canopy, nu5, nu6, nu6_1, nu6_2, nu6_3, nu7, all"
)
})?;

Expand Down Expand Up @@ -381,6 +425,7 @@ mod tests {
.set_nu6(parsed.nu6)
.set_nu6_1(parsed.nu6_1)
.set_nu6_2(parsed.nu6_2)
.set_nu6_3(parsed.nu6_3)
.set_nu7(parsed.nu7)
.build();

Expand Down
46 changes: 0 additions & 46 deletions regtest-launcher/src/keygen.rs

This file was deleted.

Loading
Loading