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
5 changes: 4 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ fail-fast = false

[profile.ci]
fail-fast = false
default-filter = 'not (test(zebra) | test(zaino))'
# devtool_client excluded until CI provisions the zcash-devtool binary in
# test.yaml (the tests arrived with add_client_support and have never had
# their binary in the runner image).
default-filter = 'not (test(zebra) | test(zaino) | test(devtool_client))'
4 changes: 3 additions & 1 deletion .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
tool: cargo-binstall

- name: Install cargo-check-external-types
run: cargo binstall cargo-check-external-types -y --force
# Pinned to match PINNED_NIGHTLY (nightly-2025-10-18, rustdoc JSON
# format 56). 0.5.0 requires format 57; bump both together.
run: cargo binstall cargo-check-external-types@0.4.0 -y --force

- name: Run checks
run: just check-external-types
Expand Down
10 changes: 10 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
This file collects conventions that AI contributors (and humans
reviewing AI-authored work) should apply to PRs in this repository.

## Tool selection

Always prefer Rust-native tools in domains where they are designed to
operate. Dependency and manifest changes go through `cargo add` /
`cargo remove` / `cargo update`. Code navigation and refactors go
through rust-analyzer. Verification goes through `cargo check` /
`cargo clippy` / `cargo fmt` / `cargo nextest`. Do not reach for
Python, sed, or regex sweeps over Rust source or `Cargo.toml` when a
Rust tool covers the job.

## Code-review checklist: bugs Rust won't catch

Memory-safety guarantees and the type system catch a lot, but the
Expand Down
16 changes: 5 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
[workspace]
members = ["zcash_local_net", "zingo_test_vectors", "regtest-launcher"]
members = [
"zcash_local_net",
"zingo-consensus",
"zingo_test_vectors",
"regtest-launcher",
]
resolver = "2"

[workspace.dependencies]

# workspace
zingo_test_vectors = { path = "zingo_test_vectors" }
zcash_local_net = { path = "zcash_local_net" }

# zingo-common
zingo_common_components = "0.3.1"
zingo-consensus = { path = "zingo-consensus" }

#zcash
zcash_protocol = { version = "0.9.0", features = ["local-consensus"] }
Expand Down
8 changes: 8 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ 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"
Expand Down
1 change: 0 additions & 1 deletion regtest-launcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ 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"
zingo_common_components = { workspace = true }

[dev-dependencies]
anyhow = "1.0.100"
Expand Down
4 changes: 2 additions & 2 deletions regtest-launcher/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ mod tests {

// Mirror the field-by-field conversion done in
// regtest-launcher::main: ConfiguredActivationHeights ->
// zingo_common_components::ActivationHeights. `before_overwinter`
// local_net::protocol::ActivationHeights. `before_overwinter`
// exists on the former but not the latter and is dropped.
let from_cli = zingo_common_components::protocol::ActivationHeights::builder()
let from_cli = local_net::protocol::ActivationHeights::builder()
.set_overwinter(parsed.overwinter)
.set_sapling(parsed.sapling)
.set_blossom(parsed.blossom)
Expand Down
2 changes: 1 addition & 1 deletion regtest-launcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use owo_colors::OwoColorize;

use tokio::{signal::ctrl_c, time::interval};

use local_net::protocol::ActivationHeights;
use zebra_node_services::rpc_client::RpcRequestClient;
use zebra_rpc::{
client::{
Expand All @@ -38,7 +39,6 @@ use zebra_rpc::{
},
proposal_block_from_template,
};
use zingo_common_components::protocol::ActivationHeights;

use crate::{cli::Cli, keygen::generate_regtest_transparent_keypair};

Expand Down
7 changes: 4 additions & 3 deletions zcash_local_net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ github = { repository = "zingolabs/infrastructure/services" }
[dependencies]

# zingo
zingo_common_components = { workspace = true }
zingo-consensus = { workspace = true }
zingo_test_vectors = { workspace = true }

# zcash
Expand Down Expand Up @@ -47,8 +47,9 @@ tokio = { workspace = true, features = ["macros", "fs", "rt-multi-thread"] }
allowed_external_types = [
"tempfile::dir::TempDir",
"zcash_protocol::PoolType",
"zingo_common_components::protocol::ActivationHeights",
"zingo_common_components::protocol::NetworkType",
"zingo_consensus::ActivationHeights",
"zingo_consensus::ActivationHeightsBuilder",
"zingo_consensus::NetworkType",
"zebra_node_services::rpc_client::RpcRequestClient",
"reqwest::error::Error",
]
7 changes: 3 additions & 4 deletions zcash_local_net/src/client/zcash_devtool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::process::{Child, Stdio};
use getset::Getters;
use tempfile::TempDir;

use zingo_common_components::protocol::NetworkType;
use zingo_consensus::NetworkType;
use zingo_test_vectors::seeds::{ABANDON_ART_SEED, HOSPITAL_MUSEUM_SEED};

use crate::{
Expand Down Expand Up @@ -56,9 +56,8 @@ const AGE_IDENTITY_FILENAME: &str = "age-identity.txt";
/// mining begins, i.e. all-at-2. The NU6.1 lockbox requirement is
/// still satisfiable at height 2 because the default `ZebradConfig`
/// funding stream starts depositing at the activation block itself.
pub fn supported_regtest_activation_heights() -> zingo_common_components::protocol::ActivationHeights
{
zingo_common_components::protocol::ActivationHeights::builder()
pub fn supported_regtest_activation_heights() -> zingo_consensus::ActivationHeights {
zingo_consensus::ActivationHeights::builder()
.set_overwinter(Some(1))
.set_sapling(Some(1))
.set_blossom(Some(1))
Expand Down
4 changes: 2 additions & 2 deletions zcash_local_net/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fs::File;
use std::io::{BufWriter, Write};
use std::path::{Path, PathBuf};

use zingo_common_components::protocol::{ActivationHeights, NetworkType};
use zingo_consensus::{ActivationHeights, NetworkType};

/// Convert `NetworkKind` to its config string representation
fn network_type_to_string(network: NetworkType) -> &'static str {
Expand Down Expand Up @@ -387,7 +387,7 @@ zcash-conf-path: {zcashd_conf}"
mod tests {
use std::path::PathBuf;

use zingo_common_components::protocol::{ActivationHeights, NetworkType};
use zingo_consensus::{ActivationHeights, NetworkType};

use crate::logs;

Expand Down
4 changes: 2 additions & 2 deletions zcash_local_net/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ pub enum ClientError {
UnsupportedActivationHeights {
/// The heights requested in the client config (boxed to keep
/// `Result<_, ClientError>` small — clippy::result_large_err)
configured: Box<zingo_common_components::protocol::ActivationHeights>,
configured: Box<zingo_consensus::ActivationHeights>,
/// The fixture heights the client binary supports
expected: Box<zingo_common_components::protocol::ActivationHeights>,
expected: Box<zingo_consensus::ActivationHeights>,
},
}

Expand Down
2 changes: 1 addition & 1 deletion zcash_local_net/src/indexer/zainod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{path::PathBuf, process::Child};
use getset::{CopyGetters, Getters};
use tempfile::TempDir;

use zingo_common_components::protocol::NetworkType;
use zingo_consensus::NetworkType;

use crate::logs::LogsToDir;
use crate::logs::LogsToStdoutAndStderr as _;
Expand Down
2 changes: 1 addition & 1 deletion zcash_local_net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub use zcash_protocol::PoolType;
pub mod protocol {
pub use zcash_protocol::PoolType;
pub use zebra_node_services::rpc_client::RpcRequestClient;
pub use zingo_common_components::protocol::{ActivationHeights, NetworkType};
pub use zingo_consensus::{ActivationHeights, ActivationHeightsBuilder, NetworkType};
}

/// External re-exported types.
Expand Down
2 changes: 1 addition & 1 deletion zcash_local_net/src/utils/type_conversions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use zebra_chain::parameters::testnet::ConfiguredActivationHeights;
use zingo_common_components::protocol::ActivationHeights;
use zingo_consensus::ActivationHeights;

pub(crate) fn zingo_to_zebra_activation_heights(
value: ActivationHeights,
Expand Down
2 changes: 1 addition & 1 deletion zcash_local_net/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;

use tempfile::TempDir;
use zcash_protocol::PoolType;
use zingo_common_components::protocol::{ActivationHeights, NetworkType};
use zingo_consensus::{ActivationHeights, NetworkType};

use crate::process::Process;

Expand Down
2 changes: 1 addition & 1 deletion zcash_local_net/src/validator/zcashd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tempfile::TempDir;

use zcash_protocol::PoolType;

use zingo_common_components::protocol::{ActivationHeights, NetworkType};
use zingo_consensus::{ActivationHeights, NetworkType};
use zingo_test_vectors::{
REG_O_ADDR_FROM_ABANDONART, REG_T_ADDR_FROM_ABANDONART, REG_Z_ADDR_FROM_ABANDONART,
};
Expand Down
2 changes: 1 addition & 1 deletion zcash_local_net/src/validator/zebrad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
validator::{Validator, ValidatorConfig},
};
use zcash_protocol::PoolType;
use zingo_common_components::protocol::{ActivationHeights, NetworkType};
use zingo_consensus::{ActivationHeights, NetworkType};
use zingo_test_vectors::{
REG_O_ADDR_FROM_ABANDONART, REG_T_ADDR_FROM_ABANDONART, ZEBRAD_DEFAULT_MINER,
};
Expand Down
14 changes: 14 additions & 0 deletions zingo-consensus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "zingo-consensus"
version = "0.1.0"
edition = "2024"
license = "MIT"
description = "Zcash network-upgrade activation schedules and network identity types shared by Zingo projects."
authors = ["Zingolabs <zingo@zingolabs.org>"]
repository = "https://github.com/zingolabs/infrastructure"
homepage = "https://github.com/zingolabs/infrastructure"

[badges]
maintenance = { status = "actively-developed" }

[dependencies]
Loading
Loading