Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZSA integration (step 3): Add initial Transaction V6 support to Zebra (currently copies V5 behavior) #16

Open
wants to merge 39 commits into
base: zsa-integration-zsadeps
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
054e655
Merge remote-tracking branch 'origin/main' into switch-to-zsa-crates-…
dmidem Aug 18, 2024
a3a61f5
Add initial Transaction V6 support in zebra-chain crate.
dmidem Aug 28, 2024
83d981b
Add initial Transaction V6 support in other crates and tests (just co…
dmidem Aug 28, 2024
c8fa779
Fix compilation errors in tests
dmidem Aug 28, 2024
2d23d6b
Merge branch 'zsa1' into switch-to-zsa-crates-nu6
dmidem Sep 2, 2024
9d6c8e9
Merge branch 'switch-to-zsa-crates-nu6' into switch-to-zsa-crates-nu6…
dmidem Sep 2, 2024
53c65b6
Trigger CI
dmidem Sep 2, 2024
c67e2ae
Merge branch 'switch-to-zsa-crates-nu6' into switch-to-zsa-crates-nu6…
dmidem Sep 2, 2024
c238847
Add basic CI checks workflow
dmidem Sep 3, 2024
2c13ae9
Fix ci-basic.yml
dmidem Sep 3, 2024
5a839c6
Fix ci-basic.yml (2)
dmidem Sep 3, 2024
367a14b
Add installing of build-essential to ci-basic.yml
dmidem Sep 3, 2024
f425747
Try to use librocksdb-dev in ci-basic.yml
dmidem Sep 3, 2024
831c847
Run ci-basic.yml on ubuntu-24.04
dmidem Sep 3, 2024
ecaf98d
Enable nu6 cfg flag in ci-basic.yml
dmidem Sep 3, 2024
7d11159
Adjust the code with librustzcash/zcash_protocol nu6 related changes
dmidem Sep 4, 2024
6a0196e
Add RUSTDOCFLAGS to ci-basic.yml
dmidem Sep 4, 2024
8e53d24
Merge branch 'switch-to-zsa-crates-nu6' into switch-to-zsa-crates-nu6…
dmidem Sep 9, 2024
1526276
Merge remote-tracking branch 'origin/main' into switch-to-zsa-crates-nu6
dmidem Sep 22, 2024
654b8d4
Merge branch 'switch-to-zsa-crates-nu6' into switch-to-zsa-crates-nu6…
dmidem Sep 22, 2024
9e94dc5
Merge remote-tracking branch 'zcash/main' into switch-to-zsa-crates-nu6
dmidem Sep 22, 2024
a6405d7
Merge branch 'switch-to-zsa-crates-nu6' into switch-to-zsa-crates-nu6…
dmidem Sep 22, 2024
12ade98
Merge branch 'main' into switch-to-zsa-crates-nu6
dmidem Oct 2, 2024
a09774e
Merge branch 'main' into switch-to-zsa-crates-nu6-txv6
dmidem Oct 2, 2024
a026dd2
Merge branch 'switch-to-zsa-crates-nu6' into switch-to-zsa-crates-nu6…
dmidem Oct 2, 2024
bb1395c
Merge branch 'main' into switch-to-zsa-crates-nu6
dmidem Oct 17, 2024
8d18425
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Oct 17, 2024
f90a10f
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Oct 29, 2024
9e5a01c
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Oct 30, 2024
9e51b24
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 10, 2025
a158e9f
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 13, 2025
bed9fb5
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 13, 2025
164e5de
Change TX_V6_VERSION_GROUP_ID value back to a temporary 0x7777_7777, …
dmidem Feb 13, 2025
8195426
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 13, 2025
4ad68ae
Revert "Update zebra-chain to sync with the updated librustzcash (zca…
dmidem Feb 14, 2025
b219b66
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 14, 2025
08de3de
Change TX_V6_VERSION_GROUP_ID value back to 0x124A_69F8, to aling wit…
dmidem Feb 14, 2025
f16bd20
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 14, 2025
51eaeda
Merge branch 'zsa-integration-zsadeps' into zsa-integration-txv6
dmidem Feb 17, 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
7 changes: 7 additions & 0 deletions zebra-chain/src/parameters/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ pub const SAPLING_VERSION_GROUP_ID: u32 = 0x892F_2085;
/// Orchard transactions must use transaction version 5 and this version
/// group ID. Sapling transactions can use v4 or v5 transactions.
pub const TX_V5_VERSION_GROUP_ID: u32 = 0x26A7_270A;

/// The version group ID for version 6 transactions.
///
/// Orchard transactions must use transaction version 5 and this version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Orchard transactions must use transaction version 5 and this version
/// Orchard ZSA transactions must use transaction version 6 and this version

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to this comment copied to #37.

/// group ID.
// FIXME: use a proper value!
pub const TX_V6_VERSION_GROUP_ID: u32 = 0x26A7_270B;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use a random number in the meanwhile.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: It's 0x124A69F8 in zcash_primitives, if that was random, let's use that so it won't need an update.

Copy link
Author

@dmidem dmidem Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to 0x124A69F8 in #37. Link to this comment copied to #37.

Copy link
Author

@dmidem dmidem Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily changed to 0x7777_7777 to align with the a new value used in librustzcash (zcash_primitives) and test vectors. Kept a FIXME comment to change it in the future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily changed to 0x124A_69F8 to align with the a value used in OLD version of librustzcash (zcash_primitives) and test vectors. Kept a FIXME comment to change it in the future.

5 changes: 4 additions & 1 deletion zebra-chain/src/primitives/zcash_primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,16 @@ impl TryFrom<&Transaction> for zp_tx::Transaction {
///
/// # Panics
///
/// If the transaction is not V5. (Currently there is no need for this
/// If the transaction is not V5/V6. (Currently there is no need for this
/// conversion for other versions.)
#[allow(clippy::unwrap_in_result)]
fn try_from(trans: &Transaction) -> Result<Self, Self::Error> {
let network_upgrade = match trans {
Transaction::V5 {
network_upgrade, ..
}
| Transaction::V6 {
network_upgrade, ..
} => network_upgrade,
Transaction::V1 { .. }
| Transaction::V2 { .. }
Expand Down
Loading