Skip to content

Commit 3677c4b

Browse files
committed
Merge branch 'zsa-integration-txv6' into zsa-integration-generics
2 parents 225dac1 + 8195426 commit 3677c4b

File tree

7 files changed

+53
-41
lines changed

7 files changed

+53
-41
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ dependencies = [
13721372
[[package]]
13731373
name = "equihash"
13741374
version = "0.2.0"
1375-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
1375+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
13761376
dependencies = [
13771377
"blake2b_simd",
13781378
"byteorder",
@@ -1407,7 +1407,7 @@ dependencies = [
14071407
[[package]]
14081408
name = "f4jumble"
14091409
version = "0.1.0"
1410-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
1410+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
14111411
dependencies = [
14121412
"blake2b_simd",
14131413
]
@@ -5814,7 +5814,7 @@ checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546"
58145814
[[package]]
58155815
name = "zcash_address"
58165816
version = "0.3.2"
5817-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5817+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
58185818
dependencies = [
58195819
"bech32",
58205820
"bs58",
@@ -5826,7 +5826,7 @@ dependencies = [
58265826
[[package]]
58275827
name = "zcash_client_backend"
58285828
version = "0.12.1"
5829-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5829+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
58305830
dependencies = [
58315831
"base64 0.21.7",
58325832
"bech32",
@@ -5865,7 +5865,7 @@ dependencies = [
58655865
[[package]]
58665866
name = "zcash_encoding"
58675867
version = "0.2.0"
5868-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5868+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
58695869
dependencies = [
58705870
"byteorder",
58715871
"nonempty",
@@ -5874,7 +5874,7 @@ dependencies = [
58745874
[[package]]
58755875
name = "zcash_history"
58765876
version = "0.4.0"
5877-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5877+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
58785878
dependencies = [
58795879
"blake2b_simd",
58805880
"byteorder",
@@ -5884,7 +5884,7 @@ dependencies = [
58845884
[[package]]
58855885
name = "zcash_keys"
58865886
version = "0.2.0"
5887-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5887+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
58885888
dependencies = [
58895889
"bech32",
58905890
"blake2b_simd",
@@ -5921,7 +5921,7 @@ dependencies = [
59215921
[[package]]
59225922
name = "zcash_primitives"
59235923
version = "0.15.0"
5924-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5924+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
59255925
dependencies = [
59265926
"aes",
59275927
"bip0039",
@@ -5982,7 +5982,7 @@ dependencies = [
59825982
[[package]]
59835983
name = "zcash_protocol"
59845984
version = "0.1.1"
5985-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
5985+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
59865986
dependencies = [
59875987
"document-features",
59885988
"memuse",
@@ -6523,7 +6523,7 @@ dependencies = [
65236523
[[package]]
65246524
name = "zip321"
65256525
version = "0.0.0"
6526-
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#5ea95ea2bfa55ccd8d39c1be39eb4978ec338045"
6526+
source = "git+https://github.com/QED-it/librustzcash?branch=zsa1#6e5a4130f5e7fbd6f195d89d34ed9669686f7635"
65276527
dependencies = [
65286528
"base64 0.21.7",
65296529
"nom",

rust-toolchain.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# FIXME: This file does not exist in the original Zebra repo - consider removing it before the final merge.
2+
[toolchain]
3+
channel = "1.82.0"
4+
components = [ "clippy", "rustfmt" ]

zebra-chain/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,6 @@ required-features = ["bench"]
188188
[[bench]]
189189
name = "redpallas"
190190
harness = false
191+
192+
[lints.rust]
193+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("nu6"))'] }

zebra-chain/src/parameters/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ pub const TX_V5_VERSION_GROUP_ID: u32 = 0x26A7_270A;
1818
/// group ID.
1919
// FIXME: use a proper value!
2020
#[cfg(feature = "tx-v6")]
21-
pub const TX_V6_VERSION_GROUP_ID: u32 = 0x26A7_270B;
21+
pub const TX_V6_VERSION_GROUP_ID: u32 = 0x7777_7777;

zebra-chain/src/primitives/zcash_note_encryption.rs

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ use crate::{
88
transaction::Transaction,
99
};
1010

11+
use orchard::{
12+
bundle::{Authorization, Bundle},
13+
domain::OrchardDomainCommon,
14+
};
15+
16+
use zcash_primitives::transaction::OrchardBundle;
17+
18+
fn orchard_bundle_decrypts_successfully<A: Authorization, V, D: OrchardDomainCommon>(
19+
bundle: &Bundle<A, V, D>,
20+
) -> bool {
21+
for act in bundle.actions() {
22+
if zcash_note_encryption::try_output_recovery_with_ovk(
23+
&orchard::domain::OrchardDomain::for_action(act),
24+
&orchard::keys::OutgoingViewingKey::from([0u8; 32]),
25+
act,
26+
act.cv_net(),
27+
&act.encrypted_note().out_ciphertext,
28+
)
29+
.is_none()
30+
{
31+
return false;
32+
}
33+
}
34+
35+
true
36+
}
37+
1138
/// Returns true if all Sapling or Orchard outputs, if any, decrypt successfully with
1239
/// an all-zeroes outgoing viewing key.
1340
///
@@ -49,18 +76,11 @@ pub fn decrypts_successfully(transaction: &Transaction, network: &Network, heigh
4976
}
5077

5178
if let Some(bundle) = alt_tx.orchard_bundle() {
52-
for act in bundle.actions() {
53-
if zcash_note_encryption::try_output_recovery_with_ovk(
54-
&orchard::domain::OrchardDomain::for_action(act),
55-
&orchard::keys::OutgoingViewingKey::from([0u8; 32]),
56-
act,
57-
act.cv_net(),
58-
&act.encrypted_note().out_ciphertext,
59-
)
60-
.is_none()
61-
{
62-
return false;
63-
}
79+
if !match bundle {
80+
OrchardBundle::OrchardVanilla(bundle) => orchard_bundle_decrypts_successfully(bundle),
81+
OrchardBundle::OrchardZSA(bundle) => orchard_bundle_decrypts_successfully(bundle),
82+
} {
83+
return false;
6484
}
6585
}
6686

zebra-chain/src/primitives/zcash_primitives.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ impl<'a> zp_tx::Authorization for PrecomputedAuth<'a> {
156156
type SaplingAuth = sapling_crypto::bundle::Authorized;
157157
type OrchardAuth = orchard::bundle::Authorized;
158158

159-
#[cfg(zcash_unstable = "nu6" /* TODO nu7 */ )]
160-
type OrchardZsaAuth = orchard::bundle::Authorized;
161-
162159
#[cfg(zcash_unstable = "nu6" /* TODO nu7 */ )]
163160
type IssueAuth = orchard::issuance::Signed;
164161
}
@@ -288,14 +285,9 @@ impl<'a> PrecomputedTxData<'a> {
288285
all_prev_outputs: all_previous_outputs,
289286
},
290287
};
291-
let tx_data: zp_tx::TransactionData<PrecomputedAuth> =
292-
alt_tx.into_data().map_authorization(
293-
f_transparent,
294-
IdentityMap,
295-
IdentityMap,
296-
IdentityMap,
297-
IdentityMap,
298-
);
288+
let tx_data: zp_tx::TransactionData<PrecomputedAuth> = alt_tx
289+
.into_data()
290+
.map_authorization(f_transparent, IdentityMap, IdentityMap, IdentityMap);
299291

300292
PrecomputedTxData {
301293
tx_data,

zebra-consensus/src/primitives/halo2.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ impl From<&zebra_chain::orchard::ShieldedData<OrchardVanilla>> for Item {
138138

139139
let anchor = tree::Anchor::from_bytes(shielded_data.shared_anchor.into()).unwrap();
140140

141-
let enable_spend = shielded_data
142-
.flags
143-
.contains(zebra_chain::orchard::Flags::ENABLE_SPENDS);
144-
let enable_output = shielded_data
145-
.flags
146-
.contains(zebra_chain::orchard::Flags::ENABLE_OUTPUTS);
147-
148141
let flags = orchard::bundle::Flags::from_byte(shielded_data.flags.bits())
149142
.expect("type should not have unexpected bits");
150143

0 commit comments

Comments
 (0)