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

Convert the repo into a Cargo workspace #32

Merged
merged 492 commits into from
Aug 29, 2018
Merged

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Aug 23, 2018

The librustzcash crate is now a library inside the workspace.

Several new libraries have been created, which we can refactor existing code into. We can also reorganise code between them more seamlessly than if they were split across several repositories.

If we later want to extract a library into a separate repository, we can use git subtree split.

Jay Graber and others added 30 commits December 18, 2017 10:58
Group Hash implementation in the circuit
Tidy up the codebase (TODOs into github issues)
Pedersen hashes inside and outside the circuit
Edwards scalar multiplication inside the circuit
@ebfull
Copy link
Collaborator

ebfull commented Aug 28, 2018

ACK

str4d added 4 commits August 28, 2018 23:03
git-subtree-dir: pairing
git-subtree-mainline: ad16ba6
git-subtree-split: 09b6e6f
git-subtree-dir: bellman
git-subtree-mainline: e924247
git-subtree-split: 10c5010
…02fb0e'

git-subtree-dir: sapling-crypto
git-subtree-mainline: 9f74855
git-subtree-split: 21084bd
@str4d
Copy link
Contributor Author

str4d commented Aug 28, 2018

I added the pairing, bellman and sapling-crypto crates to the workspace as git subtrees using the following commands:

$ git subtree add -P pairing https://github.com/zkcrypto/pairing.git 09b6e6f9212020f385218e5cf5287e381ccd312b
$ git subtree add -P bellman https://github.com/zkcrypto/bellman.git master
$ git subtree add -P sapling-crypto https://github.com/zcash-hackworks/sapling-crypto.git master

and then modified all the crates in the workspace to correctly depend on each other.

@ebfull
Copy link
Collaborator

ebfull commented Aug 29, 2018

Why did we suddenly inherit all these new packages in Cargo.lock? Is there any way to avoid that so that this PR is a no-op in terms of behavior and dependencies?

@ebfull
Copy link
Collaborator

ebfull commented Aug 29, 2018

Nevermind, I guess we can't avoid it. Cargo will want all the dev-dependencies in Cargo.lock for the packages we brought in, and we want that anyway for CI to work predictably.

There are some packages that could be updated, but we shouldn't do that in this PR.

Side note, here is what gets compiled now:

   Compiling typenum v1.10.0
   Compiling num-traits v0.2.5
   Compiling libc v0.2.40
   Compiling num-integer v0.1.39
   Compiling nodrop v0.1.12
   Compiling byte-tools v0.2.0
   Compiling num-bigint v0.2.0
   Compiling byteorder v1.2.2
   Compiling futures v0.1.21
   Compiling opaque-debug v0.1.1
   Compiling crossbeam v0.3.2
   Compiling bit-vec v0.4.4
   Compiling constant_time_eq v0.1.3
   Compiling lazy_static v1.0.0
   Compiling zcash_proofs v0.0.0 (file:///home/sean/Shared/librustzcash/zcash_proofs)
   Compiling zcash_primitives v0.0.0 (file:///home/sean/Shared/librustzcash/zcash_primitives)
   Compiling zcash_wallet v0.0.0 (file:///home/sean/Shared/librustzcash/zcash_wallet)
   Compiling arrayvec v0.4.7
   Compiling rand v0.4.2
   Compiling num_cpus v1.8.0
   Compiling blake2-rfc v0.2.18 (https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9#7a5b5fc9)
   Compiling generic-array v0.9.0
   Compiling block-cipher-trait v0.5.3
   Compiling digest v0.7.2
   Compiling aes-soft v0.2.0
   Compiling pairing v0.14.2 (file:///home/sean/Shared/librustzcash/pairing)
   Compiling aes v0.2.0
   Compiling futures-cpupool v0.1.8
   Compiling fpe v0.1.0
   Compiling bellman v0.1.0 (file:///home/sean/Shared/librustzcash/bellman)
   Compiling sapling-crypto v0.0.1 (file:///home/sean/Shared/librustzcash/sapling-crypto)
   Compiling zip32 v0.0.0 (file:///home/sean/Shared/librustzcash/zip32)
   Compiling librustzcash v0.1.0 (file:///home/sean/Shared/librustzcash/librustzcash)

I'd love for us to eventually do the following:

  1. Figure out our blake2-rfc dependency which is currently pointing to a revision on gtank's github.
  2. Remove futures* and crossbeam
  3. Remove libc (we actually don't need it for anything, afaik)
  4. Remove generic-array and typenum unless we actually need it for something.
  5. Upgrade to rand 0.5
  6. Remove bit-vec or implement it ourselves
  7. Perhaps other internalizations of external crates that I don't want to depend on, like isolated implementations of hash functions etc. that have wonky APIs and bring in dependencies that we don't really need.
  8. Remove any num-* crates, these are huge and we shouldn't need them for anything during runtime.

Copy link
Contributor

@Eirik0 Eirik0 left a comment

Choose a reason for hiding this comment

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

utACK

@ebfull ebfull merged commit e1c6232 into zcash:master Aug 29, 2018
@str4d str4d deleted the cargo-workspace branch August 29, 2018 19:12
str4d added a commit to str4d/librustzcash that referenced this pull request Aug 12, 2020
d0ea5d4 Merge pull request zcash#32 from narodnik/sum
24aa1a4 Merge pull request zcash#31 from zkcrypto/release-0.1.1
fb7c4cb add cargo fmt for sum traits (code we added)
ccef392 add sum iterator implementations
82e14ed Release 0.1.1
a3608d4 Put endo optimizations behind endo crate feature.
e32494e Merge pull request zcash#18 from mmaker/master
948b199 Fix typo in comment.
b3d1fe1 Merge pull request zcash#27 from rex4539/fix-typos
253f681 Merge pull request zcash#25 from mmaker/fix/sage-script
c55f88f Fix typos
14b5e16 No need to define a polynomial ring in notes/design.rs.
c9d17f6 Make sage script in notes/design.rs work with sage 3.9.
af9ec4d Minor changes to comments documenting `clear_cofactor`
7dc6f31 Add clear_cofactor.

git-subtree-dir: bls12_381
git-subtree-split: d0ea5d4958cae999dea1800207704171aa07a9ef
str4d added a commit to str4d/librustzcash that referenced this pull request Aug 22, 2020
38d38af3 Merge pull request zcash#32 from kevaundray/patch-1
af5598da Merge pull request zcash#33 from ZcashFoundation/scalar
109ec40d Add public Scalar type alias for Fr
8e9c5fe6 typo in Fr.rs
8e9337ee Merge pull request zcash#30 from rex4539/typos
5f4374c8 Fix typo

git-subtree-dir: jubjub
git-subtree-split: 38d38af3b792d2c55d815d214a7cd157dc8f71ad
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.

7 participants