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

Implement Sapling serialization in Transaction V5 #2020

Merged
merged 13 commits into from
Apr 18, 2021

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Apr 15, 2021

Motivation

Transaction V5 is a required change in NU5.

Solution

  • Cleanup the Transaction V5 sapling serialization code

The code in this pull request has:

  • Documentation Comments
  • Unit Tests and Property Tests

Review

@teor2345 can review @oxarbitrage's commits.
@oxarbitrage can review @teor2345's commits.

Related Issues

Part of #1829
Rebased from oxarbitrage#90

Follow Up Work

Redesign Sapling data model for V5 shared anchor and spends #2021

TODO - make tickets:

Orchard in V5 #1979

@teor2345 teor2345 added C-design Category: Software design work A-consensus Area: Consensus rule updates A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks P-Medium labels Apr 15, 2021
@teor2345 teor2345 added this to the 2021 Sprint 7 milestone Apr 15, 2021
@teor2345 teor2345 requested a review from oxarbitrage April 15, 2021 22:48
@teor2345 teor2345 self-assigned this Apr 15, 2021
Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

Everything looks great to me.

Comment on lines +102 to +108
let (spend_prefixes, spend_proofs_sigs): (Vec<_>, Vec<_>) = self
.spends()
.cloned()
.map(sapling::Spend::<SharedAnchor>::into_v5_parts)
.map(|(prefix, proof, sig)| (prefix, (proof, sig)))
.unzip();
let (spend_proofs, spend_sigs) = spend_proofs_sigs.into_iter().unzip();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Comment on lines +182 to +187
let mut spends: Vec<_> = spend_prefixes
.into_iter()
.zip(spend_proofs.into_iter())
.zip(spend_sigs.into_iter())
.map(|((prefix, proof), sig)| Spend::<SharedAnchor>::from_v5_parts(prefix, proof, sig))
.collect();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

zebra_test::init();

// we need at least one output to delete all the spends
prop_assume!(shielded_v4.outputs().count() > 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@teor2345 teor2345 added this to the 2021 Sprint 7 milestone Apr 18, 2021
@teor2345 teor2345 merged commit b9ac221 into ZcashFoundation:main Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-dependencies Area: Dependency file updates A-rust Area: Updates to Rust code C-design Category: Software design work C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants