Skip to content

Commit 1cde30a

Browse files
authored
chore(deps): pin librustzcash crates to NU6.3 testnet-supporting pre-release version. (#10789)
chore(deps): pin librustzcash crates to NU6.3-testnet supporting versions Add [patch.crates-io] directives pinning equihash, f4jumble, transparent (zcash_transparent), and the zcash_* crates to librustzcash main (rev 703fe3e6608fab8be0dedbbcbf684f030a1ea451). Removes the `zcash_unstable=nu6.3` config flag gates and updates the miner-reward transaction builders in zebra-rpc to adapt to the removed lifetime parameter on zcash_primitives' transaction `Builder` (now `Builder<P, U>` instead of `Builder<'a, P, U>`).
1 parent 9b6c24e commit 1cde30a

25 files changed

Lines changed: 52 additions & 165 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org).
99

1010
### Added
1111

12-
- Experimental, off-by-default support for the NU6.3 "Ironwood" shielded pool and
13-
v6 transaction format, behind the `zcash_unstable="nu6.3"` cfg. This is incomplete
14-
pending the deploy ZIP (no real activation height, version group ID, or consensus
15-
branch ID yet) and is not built by default.
12+
- Experimental support for the NU6.3 "Ironwood" shielded pool and v6 transaction
13+
format. This is incomplete pending the deploy ZIP (no real activation height,
14+
version group ID, or consensus branch ID yet), so it cannot activate on any
15+
network.
1616
- Added a Regtest configuration option, `should_allow_unshielded_coinbase_spends`,
1717
to forbid spending coinbase outputs into transparent outputs (the inverse of
1818
zcashd's `-regtestshieldcoinbase`). It defaults to allowing such spends, preserving

Cargo.lock

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,24 +1551,14 @@ dependencies = [
15511551
[[package]]
15521552
name = "equihash"
15531553
version = "0.3.0"
1554-
source = "registry+https://github.com/rust-lang/crates.io-index"
1555-
checksum = "306286e8dcc39ab3dfceb74c792ce8baffdab90591321d3ffaae64829734c37f"
1554+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
15561555
dependencies = [
15571556
"blake2b_simd",
15581557
"cc",
15591558
"corez",
15601559
"document-features",
15611560
]
15621561

1563-
[[package]]
1564-
name = "equihash"
1565-
version = "0.3.0"
1566-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
1567-
dependencies = [
1568-
"blake2b_simd",
1569-
"corez",
1570-
]
1571-
15721562
[[package]]
15731563
name = "equivalent"
15741564
version = "1.0.2"
@@ -1609,7 +1599,7 @@ dependencies = [
16091599
[[package]]
16101600
name = "f4jumble"
16111601
version = "0.1.1"
1612-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
1602+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
16131603
dependencies = [
16141604
"blake2b_simd",
16151605
]
@@ -3577,8 +3567,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
35773567

35783568
[[package]]
35793569
name = "orchard"
3580-
version = "0.14.0"
3581-
source = "git+https://github.com/valargroup/qr_orchard?rev=6f1a5eaddcf0e016101c0c62a477d48f31e7a83f#6f1a5eaddcf0e016101c0c62a477d48f31e7a83f"
3570+
version = "0.15.0-pre.1"
3571+
source = "registry+https://github.com/rust-lang/crates.io-index"
3572+
checksum = "e8e277dd4b46f5d06deae3ffb8af1a951e8622368f028c2a4d6fe59339566403"
35823573
dependencies = [
35833574
"aes",
35843575
"bitvec",
@@ -7118,8 +7109,8 @@ dependencies = [
71187109

71197110
[[package]]
71207111
name = "zcash_address"
7121-
version = "0.12.0"
7122-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7112+
version = "0.13.0-pre.0"
7113+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
71237114
dependencies = [
71247115
"bech32",
71257116
"bs58",
@@ -7132,7 +7123,7 @@ dependencies = [
71327123
[[package]]
71337124
name = "zcash_encoding"
71347125
version = "0.4.0"
7135-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7126+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
71367127
dependencies = [
71377128
"corez",
71387129
"hex",
@@ -7141,8 +7132,8 @@ dependencies = [
71417132

71427133
[[package]]
71437134
name = "zcash_history"
7144-
version = "0.4.0"
7145-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7135+
version = "0.5.0-pre.0"
7136+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
71467137
dependencies = [
71477138
"blake2b_simd",
71487139
"byteorder",
@@ -7151,8 +7142,8 @@ dependencies = [
71517142

71527143
[[package]]
71537144
name = "zcash_keys"
7154-
version = "0.14.0"
7155-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7145+
version = "0.15.0-pre.0"
7146+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
71567147
dependencies = [
71577148
"bech32",
71587149
"blake2b_simd",
@@ -7191,15 +7182,15 @@ dependencies = [
71917182

71927183
[[package]]
71937184
name = "zcash_primitives"
7194-
version = "0.28.0"
7195-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7185+
version = "0.29.0-pre.0"
7186+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
71967187
dependencies = [
71977188
"blake2b_simd",
71987189
"block-buffer 0.11.0-rc.3",
71997190
"corez",
72007191
"crypto-common 0.2.0-rc.1",
72017192
"document-features",
7202-
"equihash 0.3.0 (git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid)",
7193+
"equihash",
72037194
"ff",
72047195
"hex",
72057196
"incrementalmerkletree",
@@ -7221,8 +7212,8 @@ dependencies = [
72217212

72227213
[[package]]
72237214
name = "zcash_proofs"
7224-
version = "0.28.0"
7225-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7215+
version = "0.29.0-pre.0"
7216+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
72267217
dependencies = [
72277218
"bellman",
72287219
"blake2b_simd",
@@ -7243,8 +7234,8 @@ dependencies = [
72437234

72447235
[[package]]
72457236
name = "zcash_protocol"
7246-
version = "0.9.0"
7247-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7237+
version = "0.10.0-pre.0"
7238+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
72487239
dependencies = [
72497240
"corez",
72507241
"document-features",
@@ -7281,8 +7272,8 @@ dependencies = [
72817272

72827273
[[package]]
72837274
name = "zcash_transparent"
7284-
version = "0.8.0"
7285-
source = "git+https://github.com/valargroup/librustzcash?branch=adam%2Fironwood-split-2-v6-txid#d098a6d7f5f62aa1d50c936f16d81428e17a2898"
7275+
version = "0.9.0-pre.0"
7276+
source = "git+https://github.com/zcash/librustzcash.git?rev=703fe3e6608fab8be0dedbbcbf684f030a1ea451#703fe3e6608fab8be0dedbbcbf684f030a1ea451"
72867277
dependencies = [
72877278
"bip32",
72887279
"bs58",
@@ -7322,7 +7313,7 @@ dependencies = [
73227313
"derive-getters",
73237314
"dirs",
73247315
"ed25519-zebra",
7325-
"equihash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
7316+
"equihash",
73267317
"futures",
73277318
"group",
73287319
"halo2_proofs",

Cargo.toml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ edition = "2021"
3030

3131
[workspace.dependencies]
3232
incrementalmerkletree = { version = "0.8.2", features = ["legacy-api"] }
33-
orchard = "0.14"
33+
orchard = "0.15.0-pre.1"
3434
sapling-crypto = "0.7"
35-
zcash_address = "0.12"
35+
zcash_address = "0.13.0-pre.0"
3636
zcash_encoding = "0.4"
37-
zcash_history = "0.4"
38-
zcash_keys = "0.14"
39-
zcash_primitives = "0.28"
40-
zcash_proofs = "0.28"
41-
zcash_transparent = "0.8"
42-
zcash_protocol = "0.9"
37+
zcash_history = "0.5.0-pre.0"
38+
zcash_keys = "0.15.0-pre.0"
39+
zcash_primitives = "0.29.0-pre.0"
40+
zcash_proofs = "0.29.0-pre.0"
41+
zcash_transparent = "0.9.0-pre.0"
42+
zcash_protocol = "0.10.0-pre.0"
4343
zip32 = "0.2"
4444
abscissa_core = "0.7"
4545
base64 = "0.22.1"
@@ -329,7 +329,7 @@ debug = false
329329
# The linter should ignore these expected config flags/values
330330
unexpected_cfgs = { level = "warn", check-cfg = [
331331
'cfg(tokio_unstable)', # Used by tokio-console
332-
'cfg(zcash_unstable, values("zfuture", "nu6.1", "nu6.3", "nu7", "zip235"))' # Used in Zebra and librustzcash
332+
'cfg(zcash_unstable, values("zfuture", "nu6.1", "nu7", "zip235"))' # Used in Zebra and librustzcash
333333
] }
334334

335335
# High-risk code
@@ -379,19 +379,15 @@ unwrap_in_result = "warn"
379379
# TODOs: fix this lint eventually
380380
result_large_err = "allow"
381381

382-
# EXPERIMENTAL (NU6.3 / Ironwood spike): pin the librustzcash family to the
383-
# valargroup fork that adds v6 Ironwood txid/sighash support, and orchard to the
384-
# matching qr_orchard fork it depends on. Versions match our crates.io pins
385-
# (zcash_primitives 0.28, zcash_protocol 0.9, orchard 0.14), so this is a
386-
# source-only patch. Revert this block to return to the released crates.
387-
# Fork branch is force-pushed; pin to a rev before relying on this.
388382
[patch.crates-io]
389-
zcash_primitives = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
390-
zcash_protocol = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
391-
zcash_proofs = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
392-
zcash_keys = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
393-
zcash_address = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
394-
zcash_encoding = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
395-
zcash_transparent = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
396-
zcash_history = { git = "https://github.com/valargroup/librustzcash", branch = "adam/ironwood-split-2-v6-txid" }
397-
orchard = { git = "https://github.com/valargroup/qr_orchard", rev = "6f1a5eaddcf0e016101c0c62a477d48f31e7a83f" }
383+
# TEMPORARY: Pin librustzcash crates to https://github.com/zcash/librustzcash/pull/2509
384+
equihash = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
385+
f4jumble = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
386+
transparent = { package = "zcash_transparent", git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
387+
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
388+
zcash_encoding = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
389+
zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
390+
zcash_keys = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
391+
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
392+
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }
393+
zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "703fe3e6608fab8be0dedbbcbf684f030a1ea451" }

zebra-chain/src/block/arbitrary.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ where
608608
sapling_shielded_data,
609609
..
610610
} => *sapling_shielded_data = None,
611-
#[cfg(zcash_unstable = "nu6.3")]
612611
Transaction::V6 {
613612
sapling_shielded_data,
614613
..

zebra-chain/src/ironwood.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
//! value pool — while reusing all of Orchard's wire-format and proof-verification machinery.
88
//!
99
//! The Ironwood *state* (nullifier set, note commitment tree, anchors, and chain value pool) is
10-
//! always compiled, so the on-disk database format is stable across build flags; it simply stays
11-
//! empty until NU6.3 transactions appear (which only happens in the experimental
12-
//! `zcash_unstable="nu6.3"` build). The Ironwood *transaction bundle*
13-
//! ([`ShieldedData`]) is only compiled for that experimental build.
10+
//! always present, so the on-disk database format is stable; it simply stays empty until NU6.3
11+
//! transactions appear on-chain.
1412
1513
use crate::orchard;
1614

@@ -39,11 +37,9 @@ impl From<orchard::Nullifier> for Nullifier {
3937
/// Orchard bundle; this newtype keeps the two type-distinct so they cannot be accidentally
4038
/// interchanged, and so the Ironwood bundle can commit into a separate note commitment tree and
4139
/// nullifier set.
42-
#[cfg(zcash_unstable = "nu6.3")]
4340
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
4441
pub struct ShieldedData(orchard::ShieldedDataV6);
4542

46-
#[cfg(zcash_unstable = "nu6.3")]
4743
impl ShieldedData {
4844
/// Wraps a v6 Orchard-protocol bundle as Ironwood shielded data.
4945
pub fn new(shielded_data: orchard::ShieldedDataV6) -> Self {

zebra-chain/src/orchard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ pub use keys::Diversifier;
2424
pub use note::{EncryptedNote, Note, Nullifier, WrappedNoteKey};
2525
pub use shielded_data::{AuthorizedAction, Flags, ShieldedData};
2626

27-
#[cfg(zcash_unstable = "nu6.3")]
2827
pub use shielded_data::{FlagsV6, ShieldedDataV6};

zebra-chain/src/orchard/shielded_data.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ pub struct ShieldedData {
6363
/// pre-NU6.3 serialization that the bare [`ShieldedData`] uses for v5 Orchard bundles. The two
6464
/// formats differ only in which flag bits are reserved; encoding the format in the type keeps the
6565
/// v5 and v6 (de)serialization paths from being confused.
66-
#[cfg(zcash_unstable = "nu6.3")]
6766
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
6867
pub struct ShieldedDataV6(ShieldedData);
6968

70-
#[cfg(zcash_unstable = "nu6.3")]
7169
impl ShieldedDataV6 {
7270
/// Wraps a v5-shaped Orchard [`ShieldedData`] as a v6 (NU6.3) Orchard bundle.
7371
pub fn new(shielded_data: ShieldedData) -> Self {
@@ -311,11 +309,9 @@ bitflags! {
311309
/// pre-NU6.3 (v5 Orchard) format, where bits 2..7 are all reserved. Encoding the format in the type
312310
/// keeps the v5 and v6 flag-parsing paths from being confused (parallels
313311
/// [`ShieldedDataV6`](super::ShieldedDataV6)).
314-
#[cfg(zcash_unstable = "nu6.3")]
315312
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
316313
pub struct FlagsV6(Flags);
317314

318-
#[cfg(zcash_unstable = "nu6.3")]
319315
impl From<FlagsV6> for Flags {
320316
fn from(flags: FlagsV6) -> Self {
321317
flags.0
@@ -327,7 +323,6 @@ impl Flags {
327323
const PRE_NU6_3_RESERVED: u8 = !(Self::ENABLE_SPENDS.bits() | Self::ENABLE_OUTPUTS.bits());
328324

329325
/// The flag bits that are reserved (MUST be zero) in the NU6.3 format.
330-
#[cfg(zcash_unstable = "nu6.3")]
331326
const NU6_3_RESERVED: u8 = !(Self::ENABLE_SPENDS.bits()
332327
| Self::ENABLE_OUTPUTS.bits()
333328
| Self::ENABLE_CROSS_ADDRESS.bits());
@@ -397,7 +392,6 @@ impl ZcashDeserialize for Flags {
397392
}
398393
}
399394

400-
#[cfg(zcash_unstable = "nu6.3")]
401395
impl ZcashDeserialize for FlagsV6 {
402396
/// # Consensus
403397
///

zebra-chain/src/orchard/tests/flags.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use crate::{orchard::Flags, serialization::ZcashDeserialize};
44

5-
#[cfg(zcash_unstable = "nu6.3")]
65
use crate::orchard::FlagsV6;
76

87
/// In the pre-NU6.3 format (the default `Flags` codec, v5 Orchard bundles), only bits 0..1 are
@@ -30,7 +29,6 @@ fn pre_nu6_3_format_rejects_reserved_bits() {
3029

3130
/// In the NU6.3 format (the `FlagsV6` codec, v6 Orchard and Ironwood bundles), bit 2 is the valid
3231
/// `enableCrossAddress` flag; bits 3..7 stay reserved.
33-
#[cfg(zcash_unstable = "nu6.3")]
3432
#[test]
3533
fn nu6_3_format_accepts_cross_address_but_rejects_higher_bits() {
3634
// Bits 0..2 are all valid in the NU6.3 format.

zebra-chain/src/parameters/network_upgrade.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ impl From<zcash_protocol::consensus::NetworkUpgrade> for NetworkUpgrade {
538538
zcash_protocol::consensus::NetworkUpgrade::Nu6 => Self::Nu6,
539539
zcash_protocol::consensus::NetworkUpgrade::Nu6_1 => Self::Nu6_1,
540540
zcash_protocol::consensus::NetworkUpgrade::Nu6_2 => Self::Nu6_2,
541-
#[cfg(zcash_unstable = "nu6.3")]
542541
zcash_protocol::consensus::NetworkUpgrade::Nu6_3 => Self::Nu6_3,
543542
#[cfg(zcash_unstable = "nu7")]
544543
zcash_protocol::consensus::NetworkUpgrade::Nu7 => Self::Nu7,

zebra-chain/src/primitives/zcash_primitives.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ impl PrecomputedTxData {
290290
///
291291
/// The Ironwood bundle reuses the Orchard bundle type; it differs only by pool (separate tree,
292292
/// nullifier set, and value balance) and is verified under the NU6.3 Action circuit key.
293-
#[cfg(zcash_unstable = "nu6.3")]
294293
pub fn ironwood_bundle(
295294
&self,
296295
) -> Option<orchard::bundle::Bundle<orchard::bundle::Authorized, ZatBalance>> {

0 commit comments

Comments
 (0)