Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
798267c
Quote variables in push-deploy.yaml to pass upstream actionlint checks
dmidem Jun 26, 2025
81054ed
Rename tx-v6 feature flag to tx_v6 to match with the upstream (ZF) ch…
dmidem Jul 6, 2025
d8ac7f5
Expand and remove tx_v5_and_v6 macro
dmidem Jul 6, 2025
a088325
Reorder transaction methods to match the upstream
dmidem Jul 28, 2025
161a294
Merge branch 'zsa1' into zsa-integration-consensus-v2.3.0
dmidem Sep 22, 2025
eb71aa2
Remove a duplicated comment in zebra-chain's expiry_heigh function
dmidem Oct 3, 2025
4ffb6aa
CI: add --locked arg to cargo calls
dmidem Oct 7, 2025
dec6b96
ci: add root probe + safe cleanup and shrink Rust artefacts to avoid …
dmidem Oct 7, 2025
f0b68c4
CI: fix ci-basic.yml for the previous commit
dmidem Oct 7, 2025
1d5adf1
ci: ensure deps see cfgs by mirroring .cargo/config.toml in RUSTFLAGS…
dmidem Oct 7, 2025
2e640f1
Reove RUSTFLAGS from ci-basic.yml
dmidem Oct 7, 2025
8c5feb7
CI: comment out du commands
dmidem Oct 7, 2025
f000ac0
CI: dump largest folders in ci-basic.yml
dmidem Oct 7, 2025
4a65eaa
CI: simplify ci-basic.yml by removing the cleanup step and reducing d…
dmidem Oct 9, 2025
94a7b85
CI: expand disk check to show full system resource summary (disk, mem…
dmidem Oct 10, 2025
14be7c8
Try running ci-basic.yml on ubuntu-latest-m2 to check system resource…
dmidem Oct 10, 2025
8b334cd
CI: print runner/image identity in ci-basic.yml
dmidem Oct 12, 2025
b346c16
CI: switch ci-basic.yml back to ubuntu-latest
dmidem Oct 12, 2025
21fce74
CI: Switch to ubuntu-latest explicitly in ci-basic.yml
dmidem Oct 12, 2025
ac06559
Revert "CI: print runner/image identity in ci-basic.yml"
dmidem Oct 12, 2025
39b68a3
CI: add disk cleanup
dmidem Oct 12, 2025
1b7c813
CI: log free disk space after each disk cleanup
dmidem Oct 12, 2025
4141056
CI: Disk cleanup only for Android tools and preinstalled tool caches
dmidem Oct 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Flags that apply to all Zebra crates and configurations
[target.'cfg(all())']
rustflags = [
# Enable tx-v6 everywhere by default
"--cfg", 'feature="tx-v6"',
# Enable tx_v6 everywhere by default
"--cfg", 'feature="tx_v6"',

# TODO: Consider removing this line later (it's needed for the ZSA version of librustzcash crates)
"--cfg", "zcash_unstable=\"nu7\"",
Expand Down Expand Up @@ -88,8 +88,8 @@ rustflags = [

[build]
rustdocflags = [
# Enable tx-v6 everywhere by default
"--cfg", 'feature="tx-v6"',
# Enable tx_v6 everywhere by default
"--cfg", 'feature="tx_v6"',

# TODO: Consider removing this line later (it's needed for the ZSA version of librustzcash crates)
"--cfg", "zcash_unstable=\"nu7\"",
Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ proptest-impl = [
bench = ["zebra-test"]

# Support for transaction version 6
tx-v6 = [
tx_v6 = [
"nonempty"
]

Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub mod transparent;
pub mod value_balance;
pub mod work;

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
pub mod orchard_zsa;

#[cfg(any(test, feature = "proptest-impl"))]
Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/src/orchard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ pub use note::{EncryptedNote, Note, Nullifier, WrappedNoteKey};
pub use shielded_data::{AuthorizedAction, Flags, ShieldedData};
pub use shielded_data_flavor::{OrchardVanilla, ShieldedDataFlavor};

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
pub use shielded_data_flavor::OrchardZSA;
10 changes: 5 additions & 5 deletions zebra-chain/src/orchard/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use halo2::{
use lazy_static::lazy_static;
use rand_core::{CryptoRng, RngCore};

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
use orchard::{
note::AssetBase,
value::{ValueCommitTrapdoor, ValueSum},
Expand Down Expand Up @@ -243,7 +243,7 @@ impl ValueCommitment {
{
let rcv = generate_trapdoor(csprng)?;

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
let vc = Self::new(
rcv,
// TODO: Make the `ValueSum::from_raw` function public in the `orchard` crate
Expand All @@ -253,7 +253,7 @@ impl ValueCommitment {
AssetBase::native(),
);

#[cfg(not(feature = "tx-v6"))]
#[cfg(not(feature = "tx_v6"))]
let vc = Self::new(rcv, value);

Ok(vc)
Expand All @@ -264,14 +264,14 @@ impl ValueCommitment {
/// ValueCommit^Orchard(v) :=
///
/// <https://zips.z.cash/protocol/nu5.pdf#concretehomomorphiccommit>
#[cfg(not(feature = "tx-v6"))]
#[cfg(not(feature = "tx_v6"))]
pub fn new(rcv: pallas::Scalar, value: Amount) -> Self {
let v = pallas::Scalar::from(value);
Self::from(*V * v + *R * rcv)
}

/// Generate a new `ValueCommitment` from an existing `rcv on a `value` (ZSA version).
#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
pub fn new(rcv: pallas::Scalar, value: ValueSum, asset: AssetBase) -> Self {
// TODO: Add `pub` methods to `ValueCommitTrapdoor` and `ValueCommitment` in `orchard`
// to simplify type conversions when calling `orchard::value::ValueCommitment::derive`.
Expand Down
4 changes: 2 additions & 2 deletions zebra-chain/src/orchard/note/ciphertexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod tests {
serialization::{ZcashDeserialize, ZcashSerialize},
};

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
use crate::orchard::OrchardZSA;

use proptest::prelude::*;
Expand All @@ -138,7 +138,7 @@ mod tests {
}


#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
#[test]
fn encrypted_ciphertext_roundtrip_orchard_zsa(ec in any::<<OrchardZSA as ShieldedDataFlavor>::EncryptedNote>()) {
let _init_guard = zebra_test::init();
Expand Down
14 changes: 7 additions & 7 deletions zebra-chain/src/orchard/shielded_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ use crate::{
},
};

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
use crate::orchard_zsa::compute_burn_value_commitment;

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
use orchard::{note::AssetBase, value::ValueSum};

use super::{OrchardVanilla, ShieldedDataFlavor};

/// A bundle of [`Action`] descriptions and signature data.
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(
not(feature = "tx-v6"),
not(feature = "tx_v6"),
serde(bound(serialize = "Flavor::EncryptedNote: serde::Serialize"))
)]
#[cfg_attr(
feature = "tx-v6",
feature = "tx_v6",
serde(bound(
serialize = "Flavor::EncryptedNote: serde::Serialize, Flavor::BurnType: serde::Serialize",
deserialize = "Flavor::BurnType: serde::Deserialize<'de>"
Expand All @@ -61,7 +61,7 @@ pub struct ShieldedData<Flavor: ShieldedDataFlavor> {
/// Denoted as `bindingSigOrchard` in the spec.
pub binding_sig: Signature<Binding>,

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
/// Assets intended for burning
/// Denoted as `vAssetBurn` in the spec (ZIP 230).
pub burn: Flavor::BurnType,
Expand Down Expand Up @@ -123,13 +123,13 @@ impl<Flavor: ShieldedDataFlavor> ShieldedData<Flavor> {
pub fn binding_verification_key(&self) -> reddsa::VerificationKeyBytes<Binding> {
let cv: ValueCommitment = self.actions().map(|action| action.cv).sum();

#[cfg(not(feature = "tx-v6"))]
#[cfg(not(feature = "tx_v6"))]
let key = {
let cv_balance = ValueCommitment::new(pallas::Scalar::zero(), self.value_balance);
cv - cv_balance
};

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
let key = {
let cv_balance = ValueCommitment::new(
pallas::Scalar::zero(),
Expand Down
10 changes: 5 additions & 5 deletions zebra-chain/src/orchard/shielded_data_flavor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ use orchard::{domain::OrchardDomainCommon, orchard_flavor::OrchardFlavor};

pub use orchard::orchard_flavor::OrchardVanilla;

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
pub use orchard::{note::AssetBase, orchard_flavor::OrchardZSA, value::NoteValue};

use crate::serialization::{ZcashDeserialize, ZcashSerialize};

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
use crate::orchard_zsa::{Burn, BurnItem, NoBurn};

use super::note;
Expand Down Expand Up @@ -50,7 +50,7 @@ pub trait ShieldedDataFlavor: OrchardFlavor {
+ test_arbitrary::TestArbitrary;

/// A type representing a burn field for this protocol version.
#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
type BurnType: Clone
+ Debug
+ ZcashDeserialize
Expand All @@ -62,11 +62,11 @@ pub trait ShieldedDataFlavor: OrchardFlavor {

impl ShieldedDataFlavor for OrchardVanilla {
type EncryptedNote = note::EncryptedNote<{ OrchardVanilla::ENC_CIPHERTEXT_SIZE }>;
#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
type BurnType = NoBurn;
}

#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
impl ShieldedDataFlavor for OrchardZSA {
type EncryptedNote = note::EncryptedNote<{ OrchardZSA::ENC_CIPHERTEXT_SIZE }>;
type BurnType = Burn;
Expand Down
2 changes: 1 addition & 1 deletion zebra-chain/src/parameters/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ pub const TX_V5_VERSION_GROUP_ID: u32 = 0x26A7_270A;
/// OrchardZSA transactions must use transaction version 6 and this version
/// group ID.
// TODO: FIXME: use a proper value!
#[cfg(feature = "tx-v6")]
#[cfg(feature = "tx_v6")]
pub const TX_V6_VERSION_GROUP_ID: u32 = 0x7777_7777;
8 changes: 6 additions & 2 deletions zebra-chain/src/primitives/zcash_primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
amount::{Amount, NonNegative},
parameters::{ConsensusBranchId, Network},
serialization::ZcashSerialize,
transaction::{tx_v5_and_v6, AuthDigest, HashType, SigHash, Transaction},
transaction::{AuthDigest, HashType, SigHash, Transaction},
transparent::{self, Script},
};

Expand Down Expand Up @@ -174,7 +174,11 @@ impl TryFrom<&Transaction> for zp_tx::Transaction {
#[allow(clippy::unwrap_in_result)]
fn try_from(trans: &Transaction) -> Result<Self, Self::Error> {
let network_upgrade = match trans {
tx_v5_and_v6! {
Transaction::V5 {
network_upgrade, ..
} => network_upgrade,
#[cfg(feature = "tx_v6")]
Transaction::V6 {
network_upgrade, ..
} => network_upgrade,
Transaction::V1 { .. }
Expand Down
Loading