feat: add NuTachyon support to forked librustzcash crates - #178
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
TalDerei
left a comment
There was a problem hiding this comment.
left some observations that need to be fixed.
| /// V4 node metadata. | ||
| /// | ||
| /// This extends the NU6.3 history node format with metadata for the Tachyon | ||
| /// shielded pool. Tachyon has no note commitment tree; its pool state is a | ||
| /// running anchor, so the anchor takes the place a tree root has for the other | ||
| /// pools. | ||
| #[cfg(zcash_unstable = "nutachyon")] | ||
| #[derive(Debug, Clone, Default)] | ||
| #[cfg_attr(test, derive(PartialEq, Eq))] | ||
| pub struct V4 { | ||
| /// The V3 node data retained in V4. | ||
| pub v3: V3, | ||
| /// Tachyon anchor at the start of this node's interval. | ||
| pub start_tachyon_anchor: [u8; 32], | ||
| /// Tachyon anchor at the end of this node's interval. | ||
| pub end_tachyon_anchor: [u8; 32], | ||
| /// Number of transactions containing a Tachyon bundle. | ||
| pub tachyon_tx: u64, | ||
| } |
There was a problem hiding this comment.
I know this copies V3's structure, but something came to mind when thinking about the tachyon_tx field that sources back to a previous zebra review tachyon-zcash/zebra#32 (comment).
This PR documents bundle presence and zakura-core/zakura#795 calculates bundle presence. For Ironwood, a present bundle implies at least one action
common/crates/orchard/src/bundle.rs
Lines 438 to 443 in 69d1bc6
but we're breaking that equivalence by allowing a bundle with zero actions. I don't know if that's the right decision or how deeply this decision is grounded in our proof tree? cc @turbocrime
There was a problem hiding this comment.
this still hasn't been addressed and is an open question, but shouldn't block PR. can we put a todo comment?
There was a problem hiding this comment.
can we rebase over main and exercise CI now that zakura-core/zakura#903?
| pub tachyon_tx: u64, | ||
| } | ||
|
|
||
| #[cfg(zcash_unstable = "nutachyon")] |
There was a problem hiding this comment.
so there's a coverage gap in CI. experimental nutachyon requires MSRV 1.97 (since it's inheriting downstream configs as a cfg-gated zcash_tachyon) so it doesn't build zakura-primitives with that configuration in CI since that crate requires MSRV 1.91.
we should ideally bump MSRV for entire common, but we can just have a separate CI job that builds and tests the tachyon enabled zakura-primitives using rust 1.97.
There was a problem hiding this comment.
Bumping it seems better
…nto-nutachyon # Conflicts: # Cargo.toml
…nto-nutachyon # Conflicts: # Cargo.lock # Cargo.toml
| /// V4 node metadata. | ||
| /// | ||
| /// This extends the NU6.3 history node format with metadata for the Tachyon | ||
| /// shielded pool. Tachyon has no note commitment tree; its pool state is a | ||
| /// running anchor, so the anchor takes the place a tree root has for the other | ||
| /// pools. | ||
| #[cfg(zcash_unstable = "nutachyon")] | ||
| #[derive(Debug, Clone, Default)] | ||
| #[cfg_attr(test, derive(PartialEq, Eq))] | ||
| pub struct V4 { | ||
| /// The V3 node data retained in V4. | ||
| pub v3: V3, | ||
| /// Tachyon anchor at the start of this node's interval. | ||
| pub start_tachyon_anchor: [u8; 32], | ||
| /// Tachyon anchor at the end of this node's interval. | ||
| pub end_tachyon_anchor: [u8; 32], | ||
| /// Number of transactions containing a Tachyon bundle. | ||
| pub tachyon_tx: u64, | ||
| } |
There was a problem hiding this comment.
this still hasn't been addressed and is an open question, but shouldn't block PR. can we put a todo comment?
| /// V4 node metadata. | ||
| /// | ||
| /// This extends the NU6.3 history node format with metadata for the Tachyon | ||
| /// shielded pool. Tachyon has no note commitment tree; its pool state is a | ||
| /// running anchor, so the anchor takes the place a tree root has for the other | ||
| /// pools. | ||
| #[cfg(zcash_unstable = "nutachyon")] | ||
| #[derive(Debug, Clone, Default)] | ||
| #[cfg_attr(test, derive(PartialEq, Eq))] | ||
| pub struct V4 { | ||
| /// The V3 node data retained in V4. | ||
| pub v3: V3, | ||
| /// Tachyon anchor at the start of this node's interval. | ||
| pub start_tachyon_anchor: [u8; 32], | ||
| /// Tachyon anchor at the end of this node's interval. | ||
| pub end_tachyon_anchor: [u8; 32], | ||
| /// Number of transactions containing a Tachyon bundle. | ||
| pub tachyon_tx: u64, | ||
| } |
There was a problem hiding this comment.
can we rebase over main and exercise CI now that zakura-core/zakura#903?
Motivation
Add experimental NuTachyon support to the forked librustzcash crates used by
Zakura. This includes ZIP-233-compatible V7 transactions containing Tachyon
bundles and the V4 history-tree format needed to commit to Tachyon state.
Overview
zcash_tachyon::TachyonBundleto transaction data, usingTachyonBundle::NoBundleto represent absence.zip-233feature are enabled.transaction IDs, signature hashes, and authorization digests.
empty, Adjunct, single-action Proven, and multi-action Proven V7 bundles.
zcash_historyaszakura-historyand adds cfg-gated NuTachyon V4history nodes, including Tachyon anchors and transaction counts.
metadata.
All experimental Tachyon behavior is gated by
zcash_unstable="nutachyon". ZIP-233 support additionally uses the existingzcash_unstable="nu7"configuration andzip-233feature.Follow-up Work
TachyonBundle::NoBundle. V7 transactions with Tachyon bundles can beconstructed without the builder; builder support will be added separately.
and the new history dependencies.
Dependencies
main,pinned at
c7235b1fc4b4296b8af2e26bf2f6adb24f873f56. The Tachyon bundle and V4history changes not yet present upstream are maintained in this repository's
forks.
pins this PR and adds the node-side NuTachyon and V7 support.
Validation
cargo +1.91.0 test -p zakura-history --all-features --lockedzakura-historytests on Rust 1.91.0zakura-primitivestests on Rust 1.97.1zakura-primitivestests on Rust 1.97.1, including exact Zakura V7 serialization vectorszakura-historyno-std build forthumbv7em-none-eabihf