Manual partial sync of upstream (ZcashFoundation) v2.4.2 to reduce future merge conflicts#85
Manual partial sync of upstream (ZcashFoundation) v2.4.2 to reduce future merge conflicts#85
Conversation
The actionlint job in the ZcashFoundation/zebra repository CI reported multiple SC2086 errors. This commit quotes shell variables in push-deploy.yaml to fix the linter failures.
| pub fn has_transparent_or_shielded_outputs(&self) -> bool { | ||
| !self.outputs().is_empty() || self.has_shielded_outputs() | ||
| } |
There was a problem hiding this comment.
let's call it has_any_outputs().
I don't see where it is used.
There was a problem hiding this comment.
Yes, it’s used here:
I didn’t change the function itself; several functions were just re-ordered to match upstream:
- In
QED-it/zebra/zsa1we had:
has_shielded_inputs
has_transparent_or_shielded_outputs
has_shielded_outputs
See: https://github.com/QED-it/zebra/blob/zsa1/zebra-chain/src/transaction.rs#L332-L361
- In
ZcashFoundation/zebra/mainthey have:
has_shielded_inputs
has_shielded_outputs
has_transparent_or_shielded_outputs
See: https://github.com/ZcashFoundation/zebra/blob/main/zebra-chain/src/transaction.rs#L314-L340
So I moved has_transparent_or_shielded_outputs to match the upstream order and reduce future merge conflicts.
| } => outputs, | ||
| Transaction::V3 { | ||
| ref mut outputs, .. | ||
| } => outputs, | ||
| Transaction::V4 { | ||
| ref mut outputs, .. | ||
| } => outputs, | ||
| Transaction::V5 { | ||
| ref mut outputs, .. | ||
| } => outputs, | ||
| #[cfg(feature = "tx_v6")] | ||
| Transaction::V6 { | ||
| ref mut outputs, .. | ||
| } => outputs, | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
does the big chunk of code moved to enable an easier merge?
There was a problem hiding this comment.
Yes, in ZcashFoundation/zebra/main they grouped and moved all functions gated by #[cfg(any(test, feature = "proptest-impl"))] into a dedicated impl Transaction block at the bottom of the file:
#[cfg(any(test, feature = "proptest-impl"))]
impl Transaction {
// ...
}https://github.com/ZcashFoundation/zebra/blob/main/zebra-chain/src/transaction.rs#L1542
In particular, in QED-it/zebra/zsa1 the old style is still used for outputs_mut:
https://github.com/QED-it/zebra/blob/zsa1/zebra-chain/src/transaction.rs#L591
In ZcashFoundation/zebra/main it’s moved into the new impl Transaction:
https://github.com/ZcashFoundation/zebra/blob/main/zebra-chain/src/transaction.rs#L1766
So I applied the same change in our fork to reduce the diff and minimize merge conflicts.
1ef660f to
eb71aa2
Compare
…runner disk exhaustion
This reverts commit 8b334cd.
This PR cherry-picks a subset of changes from the
ZcashFoundation/zebrav2.4.2tag onto our zsa branch to minimize future merge conflicts.Included changes:
tx-v6totx_v6.tx_v5_and_v6macro and inline its logic to match upstream.Transactionmethods gated by the proptest-impl feature into a dedicatedimpl Transactionblock with#[cfg(any(test, feature = "proptest-impl"))]at the bottom of the file, mirroring upstream layout.Each item above is a separate commit.
No other upstream updates or behavioral changes are included.