Skip to content

ZSA synced with the upstream v4.2.0#114

Merged
dmidem merged 543 commits into
mainfrom
sync-zcash-v4.2.0-merge
May 20, 2026
Merged

ZSA synced with the upstream v4.2.0#114
dmidem merged 543 commits into
mainfrom
sync-zcash-v4.2.0-merge

Conversation

@dmidem
Copy link
Copy Markdown
Collaborator

@dmidem dmidem commented Mar 25, 2026

ZSA synced with the upstream v4.2.0

… explicit imlps as const generic are stabilized
…ssuance module as they are not used (librutzcash serialization is used)
….toml, which add PartialEq and Eq derives to orchard flavor marker types
…ZSA marker types from orchard, rename OrchardFlavorExt to ShieldedDataFlavor and rest of the code according those changes
@dmidem dmidem changed the title ZSA (final version from zsa-integration-state) synced with the upstream v4.2.0 ZSA synced with the upstream v4.2.0 Apr 13, 2026
Copy link
Copy Markdown

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

Overall good, added comments.

In addition:
Issuance/burn validation lives entirely in zebra-state (validate_and_get_changes()), not in zebra-consensus.
All other consensus rules (proofs, signatures, scripts) are checked in zebra-consensus . verify_v6_transaction() is a passthrough to verify_v5_transaction (as commented). This means the consensus crate doesn't independently enforce any ZIP-226/227 rules. Need to discuss if this is the best design decision.
The best improvment I can see is to split check_issue_bundle_without_sighash() in Orchard into two functions: one that requires get_global_records and the other that does not and checks everything that does not require state. Move the second function into zebra-consensus. Let's keep this issue for last/later. It is a non-blocking issue for this PR.

Also,
For RPC, getrawtransaction (verbose) and getblock does not expose anything related to v6. The minimum is fee, zip233_amount, burn_exist:bool and issuance_exist:bool. Later we will add full details. Also, enableZSA should be exposed next to enableSpends and enableOutputs.

run: |
df -h
free -h
lscpu | egrep 'Model name|Socket|Thread|Core|CPU\(s\)'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

do we need to submit this file or is it just for us?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this file is only for our internal use. I’ll remove it before preparing the upstream PR.

Comment thread .github/workflows/lint.yml Outdated
Comment thread testnet-single-node-deploy/dockerfile
Comment thread zebra-chain/src/transaction.rs Outdated
.into_iter()
.flat_map(orchard::ShieldedData::nullifiers)
#[cfg(all(zcash_unstable = "nu7", feature = "tx_v6"))]
pub fn orchard_issue_data(&self) -> &Option<orchard_zsa::IssueData> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should not return &Option<_> but Option<&_> or Option<_>

Copy link
Copy Markdown
Collaborator Author

@dmidem dmidem Apr 21, 2026

Choose a reason for hiding this comment

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

Fixed. Also renamed orchard_issue_data() method to orchard_zsa_issue_data() to match Transaction::V6 struct field name.

Comment thread zebra-chain/src/transaction.rs
Comment thread zebra-chain/src/orchard/commitment.rs Outdated
Comment thread zebra-chain/src/orchard/commitment.rs Outdated
Comment thread zebra-chain/src/orchard/commitment.rs Outdated
Comment thread zebra-chain/src/orchard/commitment.rs
Comment thread zebra-chain/src/orchard/tests/preallocate.rs
@dmidem
Copy link
Copy Markdown
Collaborator Author

dmidem commented Apr 22, 2026

Issuance/burn validation lives entirely in zebra-state (validate_and_get_changes()), not in zebra-consensus.
All other consensus rules (proofs, signatures, scripts) are checked in zebra-consensus . verify_v6_transaction() is a passthrough to verify_v5_transaction (as commented). This means the consensus crate doesn't independently enforce any ZIP-226/227 rules. Need to discuss if this is the best design decision.
The best improvment I can see is to split check_issue_bundle_without_sighash() in Orchard into two functions: one that requires get_global_records and the other that does not and checks everything that does not require state. Move the second function into zebra-consensus. Let's keep this issue for last/later. It is a non-blocking issue for this PR.

As discussed, we decided not to do that in this PR.

For RPC, getrawtransaction (verbose) and getblock does not expose anything related to v6. The minimum is fee, zip233_amount, burn_exist:bool and issuance_exist:bool. Later we will add full details. Also, enableZSA should be exposed next to enableSpends and enableOutputs.

Done. I added:

  • burn_exists to the Orchard struct,
  • issuance_exists to the TransactionObject struct,
  • enable_zsa to the OrchardFlags struct
  • zip233_amount to the TransactionObject` struct.

@dmidem dmidem force-pushed the sync-zcash-v4.2.0-merge branch from 3c412b6 to c2b3485 Compare May 4, 2026 20:45
dmidem and others added 7 commits May 5, 2026 13:20
The setup-rust-toolchain action exports RUSTFLAGS=-D warnings, which
replaces (rather than merges with) .cargo/config.toml rustflags, so
--cfg zcash_unstable="nu7" was silently dropped in CI. Pass it via the
action's rustflags input instead.

Also drop the cfg gate on the Nu7 consensus branch ID so chain history
works in builds without zcash_unstable="nu7"; Nu7-specific transaction
support remains cfg-gated elsewhere.
Copy link
Copy Markdown

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

I pushed some comment fixes / todos.

Let's merge it.

(After, please see the follow-up comment)

OrchardWorkflowBlock {
height: 5,
bytes: ORCHARD_ZSA_WORKFLOW_BLOCK_5_BYTES.as_slice(),
is_valid: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

is_valid: bool is not good enough. Any malformed block will fail here, and the test will pass. Replace with the specific expected error/error text so we are sure the correct rejection flow was triggered (follow-up in the next PR).

@dmidem dmidem merged commit e412546 into main May 20, 2026
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants