Skip to content

Add zingo consensus#275

Merged
zancas merged 9 commits into
devfrom
add_zingo_consensus
Jul 3, 2026
Merged

Add zingo consensus#275
zancas merged 9 commits into
devfrom
add_zingo_consensus

Conversation

@zancas

@zancas zancas commented Jul 2, 2026

Copy link
Copy Markdown
Member

What

  • New zero-dependency workspace member zingo-consensus holding ActivationHeights, ActivationHeightsBuilder, and NetworkType, ported from zingo_common_components 0.4.0 (nu6.3 included). BlockHeight, TxId, and H0 are not ported: an org-wide audit found zero consumers.
  • The all-heights-one regtest schedule is the type's documented Default impl, replacing the old for_test::all_height_one_nus helper.
  • zcash_local_net consumes it by path and re-exports the builder alongside the two types it already re-exported, so consumers can construct the type without a direct dependency.
  • regtest-launcher consumes the zcash_local_net::protocol re-exports and holds no direct dep, per the dependency rule below.
  • Now that Add client support #270 landed add_client_support on dev, this branch merges dev and the diff is purely the zingo-consensus work. The client code's five zingo_common_components references are swapped to zingo-consensus. Note for the zaino side: zaino's drop_zingo_common_components branch currently pins 0a003b4 on this branch; after this merges, that pin should move to the merge commit or the release tag.

Why

Phase 1 of the zingo-common disintegration (see docs/DISINTEGRATION.md in zingolabs/zingo-common). Every network upgrade currently walks a four-repo publish cascade through zingo-common. Co-locating the vocabulary with its main consumer removes one hop, and the leaf-crate shape keeps wallet builds free of the harness: zingolib pulls only this crate, behind its default-off regtest feature (zingolib ADR 0002).

Dependency rule: a crate that depends on zcash_local_net takes the vocabulary through its protocol re-exports and must not also directly depend on zingo-consensus. The only direct dependents are zcash_local_net itself and zingolib's optional regtest feature.

Verification

cargo check --workspace --all-features, cargo clippy --workspace --all-features, and cargo fmt --all -- --check are clean. cargo nextest run -p zingo-consensus passes 5/5.

After merge

Tag and publish zingo-consensus to crates.io, then flip the git pins in zingolib (add_regtest_gate) and zaino (drop_zingo_common_components) to the tag.

🤖 Generated with Claude Code

zancas and others added 5 commits July 2, 2026 11:24
New zero-dependency workspace member holding ActivationHeights,
ActivationHeightsBuilder, and NetworkType, ported from
zingo_common_components 0.4.0 (nu6.3 included). BlockHeight, TxId,
and H0 are not ported: an org-wide audit found zero consumers. The
all-heights-one regtest schedule is the documented Default impl,
replacing the old for_test::all_height_one_nus helper.

zcash_local_net and regtest-launcher consume it by path, and the
prelude re-export gains ActivationHeightsBuilder so consumers can
construct the type without a direct dependency.

Phase 1 of the zingo-common disintegration plan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Crates that depend on zcash_local_net must not also directly depend
on zingo-consensus. The vocabulary reaches them through the
zcash_local_net::protocol re-exports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Zaino dev pins the add_client_support lineage
(#269), so the zingo-consensus migration must
contain it before zaino can bump its pin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zancas zancas requested a review from dannywillems July 2, 2026 19:45

@dannywillems dannywillems left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK 0a003b4.

However, I see the following deps used in Cargo.toml:

#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"

Are they not already defining the structures for the network type and activation heights? If yes, it would be easier to maintain the whole Z3 stack if we avoid duplication.

zancas and others added 4 commits July 2, 2026 15:57
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
anyhow 1.0.102 -> 1.0.103 for RUSTSEC-2026-0190 (unsound
Error::downcast_mut). Ignore RUSTSEC-2026-0173 (proc-macro-error2
unmaintained): it arrives via getset, which orchard 0.14 pins inside
the zebra-rpc chain, so no local change removes it. The direct getset
dependency is slated for elimination in a follow-up PR regardless.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The workflow pins nightly-2025-10-18 (rustdoc JSON format 56) but
installed the tool unpinned. 0.5.0 (released 2026-06-08) requires
format 57, which has failed the External Types job on every PR since.
0.4.0 is the version the last green run used. Bump the tool and
PINNED_NIGHTLY together in a future maintenance PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The zcash-devtool binary is not provisioned in the CI runner image, so
the five devtool_client integration tests (from add_client_support)
have never passed in CI. The zcash_devtool JSON-parsing unit tests
still run. Re-enable when test.yaml installs the binary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zancas

zancas commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Good questions, to be continued...

@zancas zancas merged commit ff65934 into dev Jul 3, 2026
12 checks passed
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