-
Notifications
You must be signed in to change notification settings - Fork 120
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
Download Zcash Sapling parameters and load them from cached files #3057
Conversation
ICYMI, we have a
I'd be interested in collaborating on extending that Rust function with additional functionality, or building out a separate dependency for it. |
Thanks, I had missed It looks like our code is an uncredited copy of that method 😞
We need to fetch Sprout to close ticket #3037, so I'm happy to submit a patch with those changes.
IPFS is out of scope for Zebra for NU5 mainnet activation.
We're trying to minimise our scope before Zebra for NU5 mainnet activation. So I don't really want to rewrite working code. We can just spawn a blocking async task for these downloads, and the executor will put it on its own thread. Then we can open a ticket for an async rewrite that uses (We haven't explicitly picked a HTTP stack yet. But some of Zebra's dependencies use
We don't really have time to split dependencies right now. But I'd be happy to work on a Sprout download. |
4a1da00
to
5e3bb5e
Compare
54c60fa
to
b077e70
Compare
it seems like building Zebra is too slow for the time limits on these tests. That's weird, because all the built crates should just get re-used. Maybe there is some minor difference between I might have to make a "test" that just downloads the parameter files. That should be much smaller than all of |
You might find this logic interesting, which we use in our CI to cache the parameters in GH Actions workers: https://github.com/zcash/librustzcash/blob/master/.github/workflows/ci.yml#L20-L33 |
2063ece
to
19bd11c
Compare
Thanks, this was really helpful, I've used similar logic in our CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I just added some optional suggestions.
f8ec0e9
to
3ec1bff
Compare
This command isn't required for nomrmal usage. But it's useful when testing, or launching multiple Zebra instances.
This avoids re-compining Zebra with and without coverage.
```sh fastmod SaplingParams SaplingParameters zebra* fastmod Groth16Params Groth16Parameters zebra* fastmod PARAMS GROTH16_PARAMETERS zebra* fastmod params_folder directory zebra* ``` And a manual variable name tweak.
3ec1bff
to
e3f4bda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Motivation
We want to avoid linking half a gigabyte of Zcash parameters into the
zebrad
executable, tests, and build products.This might also save us some redundant copies of the parameters crates, if they are duplicated for dev and release builds.
This is the Sapling refactor part of ticket #3037.
Solution
Zebra:
zebrad download
and the cached parameters directory in download error messagesCI:
zebrad download
commandzebra-consensus
examples, likezcash_proofs
doesTODO in the next PR:
zcash_proofs
zcash_proofs
, just needs glue)Review
@jvff is reviewing this PR.
Reviewer Checklist
Follow Up Work
zcash_proofs
- the rest of Download JoinSplit Groth16 verification parameters and load them from disk #3037