From bd6b6a1bbcd267b9b7c13c7923ca5d61b2addd52 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Mon, 5 Jan 2026 15:00:51 +0000 Subject: [PATCH 1/2] Fix to sync with the orchard upstream PR471 review changes --- Cargo.lock | 2 +- Cargo.toml | 2 +- zcash_primitives/src/transaction/builder.rs | 30 ++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f374fab5a..50c5a0f026 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2872,7 +2872,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchard" version = "0.11.0" -source = "git+https://github.com/QED-it/orchard?rev=2083efe8d57e6073914ae296db2d41f8bfe1de50#2083efe8d57e6073914ae296db2d41f8bfe1de50" +source = "git+https://github.com/QED-it/orchard?rev=927f40eb6f130fbd8074abab00934ce5758b23f3#927f40eb6f130fbd8074abab00934ce5758b23f3" dependencies = [ "aes", "bitvec", diff --git a/Cargo.toml b/Cargo.toml index 7fac56545a..a5f8fc2b7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -227,7 +227,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [ [patch.crates-io] sapling = { package = "sapling-crypto", git = "https://github.com/QED-it/sapling-crypto", rev = "9393f93fe547d1b3738c9f4618c0f8a2fffed29f" } -orchard = { git = "https://github.com/QED-it/orchard", rev = "2083efe8d57e6073914ae296db2d41f8bfe1de50" } +orchard = { git = "https://github.com/QED-it/orchard", rev = "927f40eb6f130fbd8074abab00934ce5758b23f3" } sinsemilla = { git = "https://github.com/zcash/sinsemilla", rev = "aabb707e862bc3d7b803c77d14e5a771bcee3e8c" } zcash_note_encryption = { git = "https://github.com/zcash/zcash_note_encryption", rev = "9f7e93d42cef839d02b9d75918117941d453f8cb" } halo2_gadgets = { git = "https://github.com/zcash/halo2", rev = "2308caf68c48c02468b66cfc452dad54e355e32f" } diff --git a/zcash_primitives/src/transaction/builder.rs b/zcash_primitives/src/transaction/builder.rs index b6c6e53624..a46067d95f 100644 --- a/zcash_primitives/src/transaction/builder.rs +++ b/zcash_primitives/src/transaction/builder.rs @@ -4,8 +4,8 @@ use core::cmp::Ordering; use core::fmt; use rand::{CryptoRng, RngCore}; -use ::sapling::{builder::SaplingMetadata, Note, PaymentAddress}; -use ::transparent::{address::TransparentAddress, builder::TransparentBuilder, bundle::TxOut}; +use sapling::{builder::SaplingMetadata, Note, PaymentAddress}; +use transparent::{address::TransparentAddress, builder::TransparentBuilder, bundle::TxOut}; use zcash_protocol::{ consensus::{self, BlockHeight, BranchId, NetworkUpgrade, Parameters}, memo::MemoBytes, @@ -30,20 +30,20 @@ use { txid::TxIdDigester, OrchardBundle, TransactionData, Unauthorized, }, - ::sapling::prover::{OutputProver, SpendProver}, - ::transparent::builder::TransparentSigningSet, alloc::vec::Vec, orchard::{ builder::{InProgress, Unproven}, bundle::Authorized, orchard_flavor::OrchardFlavor, }, + sapling::prover::{OutputProver, SpendProver}, + transparent::builder::TransparentSigningSet, }; use orchard::{builder::BundleType, note::AssetBase, orchard_flavor::OrchardVanilla, Address}; #[cfg(feature = "transparent-inputs")] -use ::transparent::builder::TransparentInputInfo; +use transparent::builder::TransparentInputInfo; #[cfg(not(feature = "transparent-inputs"))] use core::convert::Infallible; @@ -289,9 +289,9 @@ impl BuildConfig { /// Returns the Orchard bundle type and anchor for this configuration. pub fn orchard_builder_config(&self) -> Option<(BundleType, orchard::Anchor)> { match self { - BuildConfig::TxV5 { orchard_anchor, .. } => orchard_anchor - .as_ref() - .map(|a| (BundleType::DEFAULT_VANILLA, *a)), + BuildConfig::TxV5 { orchard_anchor, .. } => { + orchard_anchor.as_ref().map(|a| (BundleType::DEFAULT, *a)) + } #[cfg(zcash_unstable = "nu7")] BuildConfig::TxV6 { orchard_anchor, .. } => orchard_anchor .as_ref() @@ -620,7 +620,7 @@ impl Builder<'_, memo: MemoBytes, ) -> Result<(), Error> { let bundle_type = self.build_config.orchard_bundle_type()?; - if bundle_type == BundleType::DEFAULT_VANILLA && !bool::from(asset.is_native()) { + if bundle_type == BundleType::DEFAULT && !bool::from(asset.is_native()) { return Err(Error::OrchardBuild(BundleTypeNotSatisfiable)); } self.orchard_builder @@ -1308,9 +1308,9 @@ mod testing { use super::{BuildResult, Builder, Error}; use crate::transaction::fees::zip317; - use ::sapling::prover::mock::{MockOutputProver, MockSpendProver}; use rand::RngCore; use rand_core::CryptoRng; + use sapling::prover::mock::{MockOutputProver, MockSpendProver}; use transparent::builder::TransparentSigningSet; use zcash_protocol::consensus; @@ -1371,8 +1371,8 @@ mod tests { use rand_core::OsRng; use crate::transaction::builder::BuildConfig; - use ::sapling::{zip32::ExtendedSpendingKey, Node, Rseed}; - use ::transparent::{address::TransparentAddress, builder::TransparentSigningSet}; + use sapling::{zip32::ExtendedSpendingKey, Node, Rseed}; + use transparent::{address::TransparentAddress, builder::TransparentSigningSet}; use zcash_protocol::{ consensus::{NetworkUpgrade, Parameters, TEST_NETWORK}, memo::MemoBytes, @@ -1392,7 +1392,7 @@ mod tests { #[cfg(feature = "transparent-inputs")] use { crate::transaction::{builder::DEFAULT_TX_EXPIRY_DELTA, OutPoint, TxOut}, - ::transparent::keys::{AccountPrivKey, IncomingViewingKey}, + transparent::keys::{AccountPrivKey, IncomingViewingKey}, zip32::AccountId, }; @@ -1427,7 +1427,7 @@ mod tests { #[cfg(feature = "transparent-inputs")] fn binding_sig_absent_if_no_shielded_spend_or_output() { use crate::transaction::builder::{self, TransparentBuilder}; - use ::transparent::{builder::TransparentSigningSet, keys::NonHardenedChildIndex}; + use transparent::{builder::TransparentSigningSet, keys::NonHardenedChildIndex}; use zcash_protocol::consensus::NetworkUpgrade; let sapling_activation_height = TEST_NETWORK @@ -1922,7 +1922,7 @@ mod tests { // Create a test note in the Orchard tree let note = { let mut builder = orchard::builder::Builder::new( - orchard::builder::BundleType::DEFAULT_VANILLA, + orchard::builder::BundleType::DEFAULT, orchard::Anchor::empty_tree(), ); builder From 6ebda070effba120a3040d23a069ea6b1e9a96b8 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Mon, 5 Jan 2026 15:19:50 +0000 Subject: [PATCH 2/2] Rename BundleType::DEFAULT_VANILLA to VANILLA --- pczt/tests/end_to_end.rs | 2 +- zcash_client_backend/src/data_api/wallet/input_selection.rs | 4 ++-- zcash_client_backend/src/fees/orchard.rs | 4 ++-- zcash_client_backend/src/fees/zip317.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pczt/tests/end_to_end.rs b/pczt/tests/end_to_end.rs index 4947aa1724..b19af73ce5 100644 --- a/pczt/tests/end_to_end.rs +++ b/pczt/tests/end_to_end.rs @@ -345,7 +345,7 @@ fn orchard_to_orchard() { let value = orchard::value::NoteValue::from_raw(1_000_000); let note = { let mut orchard_builder = orchard::builder::Builder::new( - orchard::builder::BundleType::DEFAULT_VANILLA, + orchard::builder::BundleType::DEFAULT, orchard::Anchor::empty_tree(), ); orchard_builder diff --git a/zcash_client_backend/src/data_api/wallet/input_selection.rs b/zcash_client_backend/src/data_api/wallet/input_selection.rs index 4fe24be119..7f9a8f4561 100644 --- a/zcash_client_backend/src/data_api/wallet/input_selection.rs +++ b/zcash_client_backend/src/data_api/wallet/input_selection.rs @@ -609,7 +609,7 @@ impl InputSelector for GreedyInputSelector { ), #[cfg(feature = "orchard")] &( - ::orchard::builder::BundleType::DEFAULT_VANILLA, + ::orchard::builder::BundleType::DEFAULT, &orchard_inputs[..], &orchard_outputs[..], ), @@ -761,7 +761,7 @@ where } else { 0 }; - orchard::builder::BundleType::DEFAULT_VANILLA + orchard::builder::BundleType::DEFAULT .num_actions(spendable_notes.orchard.len(), requested_orchard_actions) .map_err(|s| InputSelectorError::Change(ChangeError::BundleError(s)))? }; diff --git a/zcash_client_backend/src/fees/orchard.rs b/zcash_client_backend/src/fees/orchard.rs index f36b4077b4..fb6db11431 100644 --- a/zcash_client_backend/src/fees/orchard.rs +++ b/zcash_client_backend/src/fees/orchard.rs @@ -41,7 +41,7 @@ impl<'a, NoteRef, In: InputView, Out: OutputView> BundleView } } -/// A [`BundleView`] for the empty bundle with [`BundleType::DEFAULT_VANILLA`] bundle type. +/// A [`BundleView`] for the empty bundle with [`BundleType::DEFAULT`] bundle type. pub struct EmptyBundleView; impl BundleView for EmptyBundleView { @@ -49,7 +49,7 @@ impl BundleView for EmptyBundleView { type Out = Infallible; fn bundle_type(&self) -> BundleType { - BundleType::DEFAULT_VANILLA + BundleType::DEFAULT } fn inputs(&self) -> &[Self::In] { diff --git a/zcash_client_backend/src/fees/zip317.rs b/zcash_client_backend/src/fees/zip317.rs index ce5f2d003e..c4d014b12f 100644 --- a/zcash_client_backend/src/fees/zip317.rs +++ b/zcash_client_backend/src/fees/zip317.rs @@ -583,7 +583,7 @@ mod tests { &[] as &[Infallible], ), &( - orchard::builder::BundleType::DEFAULT_VANILLA, + orchard::builder::BundleType::DEFAULT, &[] as &[Infallible], &[OrchardPayment::new(Zatoshis::const_from_u64(30000))][..], ),