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

Factor sapling into a module that can be extracted to a separate crate. #351

Merged
merged 10 commits into from
Mar 27, 2021

Conversation

nuttycom
Copy link
Contributor

@nuttycom nuttycom commented Mar 4, 2021

Builds on #348

@nuttycom nuttycom force-pushed the refactor/component_modules_1 branch from f5efa7c to 6c8af37 Compare March 5, 2021 00:48
@nuttycom nuttycom force-pushed the refactor/component_modules_1 branch 2 times, most recently from e8e5158 to 315bcc7 Compare March 22, 2021 15:24
@nuttycom nuttycom changed the title Begin factoring sapling pieces into a module that can be extracted to a separate crate. Factor sapling into a module that can be extracted to a separate crate. Mar 22, 2021
@nuttycom nuttycom force-pushed the refactor/component_modules_1 branch from 315bcc7 to de7b52f Compare March 23, 2021 18:21
@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #351 (ab66b2d) into master (d03a197) will increase coverage by 0.01%.
The diff coverage is 62.60%.

❗ Current head ab66b2d differs from pull request most recent head eefc516. Consider uploading reports for the commit eefc516 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #351      +/-   ##
==========================================
+ Coverage   64.91%   64.92%   +0.01%     
==========================================
  Files          73       72       -1     
  Lines        7171     7168       -3     
==========================================
- Hits         4655     4654       -1     
+ Misses       2516     2514       -2     
Impacted Files Coverage Δ
zcash_client_backend/src/address.rs 78.94% <ø> (ø)
zcash_client_backend/src/data_api.rs 17.30% <ø> (ø)
zcash_client_backend/src/data_api/chain.rs 88.46% <ø> (ø)
zcash_client_backend/src/data_api/wallet.rs 86.48% <ø> (-3.26%) ⬇️
zcash_client_backend/src/encoding.rs 88.23% <ø> (ø)
zcash_client_backend/src/proto.rs 64.00% <ø> (ø)
zcash_client_backend/src/wallet.rs 66.66% <ø> (ø)
zcash_client_backend/src/welding_rig.rs 91.79% <ø> (ø)
zcash_client_backend/src/zip321.rs 68.97% <ø> (ø)
zcash_client_sqlite/src/lib.rs 54.23% <ø> (ø)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d03a197...eefc516. Read the comment docs.

@nuttycom nuttycom force-pushed the refactor/component_modules_1 branch 2 times, most recently from 2dc1ea3 to 8cbb274 Compare March 25, 2021 00:35
@nuttycom nuttycom marked this pull request as ready for review March 25, 2021 00:36
@str4d str4d force-pushed the refactor/component_modules_1 branch from 8cbb274 to 33effb7 Compare March 27, 2021 03:18
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 (including my fixup commit). I confirmed this PR is move-only.

@@ -4,7 +4,7 @@ use std::fmt::Debug;
use zcash_primitives::{
consensus::{self, BranchId, NetworkUpgrade},
memo::MemoBytes,
prover::TxProver,
sapling::prover::TxProver,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't entirely agree with this refactor; TxProver was intended to be a generic prover interface that handled whatever proofs were necessary. But currently in the orchard crate we are inlining proof creation, so let's do this refactor for now and then figure out a common prover interface later.

@str4d str4d force-pushed the refactor/component_modules_1 branch from ce8cf56 to ab66b2d Compare March 27, 2021 03:57
@str4d str4d force-pushed the refactor/component_modules_1 branch from ab66b2d to eefc516 Compare March 27, 2021 04:10
@str4d str4d added this to the Core Sprint 2021-10 milestone Mar 27, 2021
@str4d str4d merged commit c876f76 into zcash:master Mar 27, 2021
@nuttycom nuttycom deleted the refactor/component_modules_1 branch March 29, 2021 14:33
mat-if added a commit to mat-if/ironfish that referenced this pull request Mar 23, 2022
mat-if added a commit to iron-fish/ironfish that referenced this pull request Apr 5, 2022
* Update to librustzcash commit 139fc09f1028f0f2d073748dfca8529dbe98807b

* Update to librustzcash commit 81c3b54b24cb4a402e70a13c79711edada583a1e

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - prep Cargo.toml

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - remove obsolete generic arguments

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - Remove JubJubEngine

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - Remove Jubjub Params

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - add new jubjub crate

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - change J:Fs to jubjub::Fr

* Fix cargo.toml jubjub version

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - change edwards::Point<_, Unknown> to ExtendedPoint

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - change edwards::Point<_, PrimeOrder> to SubgroupPoint

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - change edwards::Point::zero() to ExtendedPoint::identity()

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - Remove fn is_small_order() in favor of ExtendedPoint::is_small_order()

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - FixedGenerators::ValueCommitmentValue -> VALUE_COMMITMENT_VALUE_GENERATOR

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - FixedGenerators::SpendingKeyGenerator -> SPENDING_KEY_GENERATOR

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - FixedGenerators::ProofGenerationKey -> PROOF_GENERATION_KEY_GENERATOR

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - FixedGenerators::ValueCommitmentRandomness -> VALUE_COMMITMENT_RANDOMNESS

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - Remove ToUniform, replace to_uniform with from_bytes_wide

* Cargo.toml: Add bls12_381, format

* librustzcash commit fdf06032e3d549cd31aae67eecbb8e4a6692d8d9 - pairing::bls12_381 -> bls12_381

* Add temporary phantom data to avoid too much unnecessary refactoring right away - we have plenty of errors to fix, but cargo is adamant this is more important for now

* Replace .negate() with - operator

* Replace .add() with +

* Remove more unneeded generic arguments: PublicKey, PrivateKey, ValueCommitment, pedersen_hash

* Replace .mul() with *

* .is_small_order() -> is_small_order().into() to properly cast to bool

* Add type annotations that the compiler is requesting

* .to_xy() changed to .to_affine()

* Fix typo to_bytes_wide

* Add missing phantom

* .write() to copy_from_slice/write_all

* More type annotations

* .read to from_bytes/read_exact

* First pass of removing J from PublicAddress

* Begin removing J trait from helper fns

* Remove J trait from Sapling

* Remove J from IncomingViewKey

* Remove J from OutgoingViewKey

* Remove J from ViewKeys

* Remove J from SaplingKey

* Remove J From Note

* Finish removing J from PublicAddress

* More J removals, mostly from tests

* Begin removing J::Fr in favor of Scalar from some key fns

* Remove J from MerkleNote

* Remove J from MerkleNoteHash

* Use Bls12 directly for groth16::Proof

* Remove J from ReceiptProof

* Remove J from ReceiptParams

* Remove J from Witness

* Remove J from SpendProof

* Remove J from Transaction

* Remove J from SpendParams

* Remove J from ProposedTransaction

* Remove J from test utils

* Function renames, cm -> cmu/commitment

* Update to now-separate libs

* ff update: BitIterator deprecated in favor of .to_le_bits()

* Another J removal from util fn

* Update cargo.toml with update note

* Use librustzcash Nullifier, implemented here: zcash/librustzcash#307

* Log commit in cargo.toml

* Remove aes* patches from Cargo since we are now using versions still listed on crates.io

* Update imports for zcash_primitives, mostly now under zcash_primitives::sapling: zcash/librustzcash#351

* Update deps; -wasm probably doesnt work atm. librustzcash commit: d50bb12a97da768dc8f3ee39b81f84262103e6eb

* Dep updates; minor trait change for librustzcash 2ba80739710f2511b18b67a7f9e082d390427a00

* Minor change, dep upgrades to latest version of librustzcash

* Update ironfish-rust-nodejs to latest version of librustzcash/ironfish-rust changes

* Update ironfish-rust-nodejs to latest version of librustzcash/ironfish-rust changes

* Remove now unneeded Sapling in many places, smattering of other lint fixes

* Clippy pass

* Downgrade to tagged release version 0.5 for testing

* Remove unneeded deps from -wasm cargo

* Remove unneeded pairing dep, use intended version of blake2 deps

* Cargo cleanup and clippy fix

* Update tarpaulin and add --avoid-cfg-tarpaulin to work around bug in pinned bitvec sub-dependency

* Use forked bellman for performance

* Alphabetize cargo deps

* Remove hasher from Witness

* Add initialize_sapling fn to explicitly load the sapling parameters

* Update tests to use initializeSapling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants