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

Add APIs to prepare ivk and epk and implement them for Sapling #633

Merged
merged 3 commits into from
Sep 15, 2022

Conversation

daira
Copy link
Contributor

@daira daira commented Sep 12, 2022

No description provided.

@daira daira force-pushed the prepare-epks-and-ivks branch 2 times, most recently from ec986bf to d0df35c Compare September 12, 2022 22:21
Cargo.toml Outdated Show resolved Hide resolved
@daira daira marked this pull request as ready for review September 13, 2022 10:30
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Base: 75.92% // Head: 50.76% // Decreases project coverage by -25.15% ⚠️

Coverage data is based on head (badb956) compared to base (3bc8627).
Patch coverage: 14.28% of modified lines in pull request are covered.

❗ Current head badb956 differs from pull request most recent head 20e869f. Consider uploading reports for the commit 20e869f to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #633       +/-   ##
===========================================
- Coverage   75.92%   50.76%   -25.16%     
===========================================
  Files         100       99        -1     
  Lines       10978     9737     -1241     
===========================================
- Hits         8335     4943     -3392     
- Misses       2643     4794     +2151     
Impacted Files Coverage Δ
components/zcash_note_encryption/src/lib.rs 22.90% <0.00%> (-67.04%) ⬇️
zcash_primitives/src/sapling/note_encryption.rs 61.58% <20.00%> (-38.42%) ⬇️
components/zcash_note_encryption/src/batch.rs 21.73% <50.00%> (-78.27%) ⬇️
...imitives/src/sapling/pedersen_hash/test_vectors.rs 5.56% <0.00%> (-94.44%) ⬇️
zcash_primitives/src/transaction/util/sha256d.rs 9.09% <0.00%> (-80.91%) ⬇️
zcash_client_backend/src/scan.rs 25.49% <0.00%> (-59.70%) ⬇️
...h_primitives/src/transaction/components/orchard.rs 28.57% <0.00%> (-58.29%) ⬇️
zcash_proofs/src/hashreader.rs 43.75% <0.00%> (-56.25%) ⬇️
... and 94 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@daira daira added this to the Release 5.3.0 milestone Sep 13, 2022
Cargo.toml Outdated Show resolved Hide resolved
components/zcash_note_encryption/src/lib.rs Show resolved Hide resolved
zcash_primitives/src/sapling/note_encryption.rs Outdated Show resolved Hide resolved
zcash_primitives/src/sapling/note_encryption.rs Outdated Show resolved Hide resolved
@str4d
Copy link
Contributor

str4d commented Sep 13, 2022

Force-pushed to remove some unnecessary patch directives and clean up the history.

@str4d str4d force-pushed the prepare-epks-and-ivks branch 2 times, most recently from d2d299f to ce178ab Compare September 13, 2022 20:12
@str4d
Copy link
Contributor

str4d commented Sep 13, 2022

Force-pushed to migrate to using zkcrypto/group#36. Compilation is expected to fail because of an issue in zcash_client_backend that needs addressing, but this PR should work as a dependency for zcashd.

@str4d
Copy link
Contributor

str4d commented Sep 13, 2022

Force-pushed with a fix to a test. The compilation issue will be addressed by rebasing this PR on main once #636 has been reviewed and merged.

@str4d str4d force-pushed the prepare-epks-and-ivks branch 2 times, most recently from 54c817f to 1b49d6d Compare September 13, 2022 21:51
@str4d str4d changed the base branch from main to batch-scanner-tag-ivks September 13, 2022 21:52
@str4d
Copy link
Contributor

str4d commented Sep 13, 2022

Rebased on #636.

@nuttycom nuttycom deleted the branch zcash:main September 13, 2022 22:49
@nuttycom nuttycom closed this Sep 13, 2022
@str4d str4d reopened this Sep 13, 2022
@str4d str4d changed the base branch from batch-scanner-tag-ivks to main September 13, 2022 22:54
@str4d
Copy link
Contributor

str4d commented Sep 13, 2022

Force-pushed to update the benchmarks for the API changes.

Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor Author

@daira daira left a comment

Choose a reason for hiding this comment

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

utACK. (I'm the original PR author so I can't Approve.)

Copy link
Contributor Author

@daira daira left a comment

Choose a reason for hiding this comment

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

Actually please hold up on merging this; I want to add a benchmark for the multiple-ivk, multiple-epk case.
Done.

@str4d
Copy link
Contributor

str4d commented Sep 14, 2022

Force-pushed to address @daira's comment.

daira and others added 2 commits September 15, 2022 03:20
…puts).

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
@daira
Copy link
Contributor Author

daira commented Sep 15, 2022

Benchmark added. It is added as the first commit, so that it's possible to roll back to that one to get a "before" benchmark. zcash/orchard#357 was updated to reference the second commit with the API changes (515b0a4), and then merged. Finally the last commit in this PR was updated to specify the merge commit for zcash/orchard#357 in Cargo.toml.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

ACK 20e869f

@@ -21,4 +21,5 @@ codegen-units = 1
[patch.crates-io]
zcash_encoding = { path = "components/zcash_encoding" }
zcash_note_encryption = { path = "components/zcash_note_encryption" }
orchard = { git = "https://github.com/zcash/orchard.git", rev = "33f1c1141e50adb68715f3359bd75378b4756cca" }
Copy link
Contributor

Choose a reason for hiding this comment

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

I confirmed that this is the merge commit for zcash/orchard#357.

@str4d str4d merged commit 8483503 into zcash:main Sep 15, 2022
@daira daira deleted the prepare-epks-and-ivks branch September 15, 2022 14:11
str4d added a commit that referenced this pull request Sep 24, 2022
As of #633, `SaplingDomain::IncomingViewingKey` now
allocates memory internally, and this memory persists as long as the
`BatchRunner` is alive. Now that we have decoupled the measurement of
heap usage for batch tasks from their internals, we can add bounds to
all of the generic parameters of `Batch` to enable correctly measuring
their actual heap usage.

We also add `DynamicUsage` impls for a bunch of `zcash_primitives` types
that will be used with `BatchRunner` (or its equivalent implementation
in `zcashd`) by callers.
str4d added a commit to daira/zcash that referenced this pull request Sep 26, 2022
As of zcash/librustzcash#633, `SaplingDomain::IncomingViewingKey` now
allocates memory internally, and this memory persists as long as the
`BatchRunner` is alive. Now that we have decoupled the measurement of
heap usage for batch tasks from their internals, we can add bounds to
all of the generic parameters of `Batch` to enable correctly measuring
their actual heap usage.

Ported from zcash/librustzcash@913aa0a.
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.

None yet

3 participants