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

change(consensus): Build Sprout and Sapling parameters into the zebrad binary, so a download server isn't needed #7800

Merged
merged 13 commits into from
Oct 24, 2023

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Oct 23, 2023

Motivation

We don't want to rely on a single external download server when Zebra first runs.

Close #7613
Close #6963

Fixes known issue in README with parameter downloads
Reduces the size of the full Zebra install and cache on disk by 700 MB (we don't need the full Sprout parameters any more)

This PR series will eventually:

  • Simplify CI and makes it more reliable
  • Remove unnecessary code and tests from Zebra

Specifications

This PR is based on the corresponding zcashd PR zcash/zcash#6661

Complex Code or Requirements

Loading bytes from inside the binary is much simpler, as long as our build disks are large enough. (The final size is smaller because we drop the sprout prover and transcript from the build and binaries.)

Solution

Production code:

  • load sapling parameters from inside the binary
  • load sprout parameters from inside the binary
  • remove parameter download code and dependency features
  • reword log messages and documentation (partial)

CI and testing:

  • remove download examples
  • remove workflow steps that download parameters

Documentation:

  • add a changelog entry based on zebrad's changelog entry

Testing

We have existing comprehensive tests for the Sprout and Sapling parameters. Sapling is tested regularly by our integration and sync tests.

Sprout might not be tested, so

Review

This is a routine change, but it is blocking cleanup work in other PRs.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

Please manually check that the new sprout file contains the correct data. Here is how the zcashd team did it:
https://github.com/zcash/zcash/pull/6661/files#r1248159359

@teor2345 teor2345 added A-consensus Area: Consensus rule updates C-enhancement Category: This is an improvement P-Medium ⚡ I-panic Zebra panics with an internal error message I-usability Zebra is hard to understand or use labels Oct 23, 2023
@teor2345 teor2345 self-assigned this Oct 23, 2023
@teor2345
Copy link
Contributor Author

rpc_endpoint_parallel_threads failed with a timing issue, we might want to fix that test to use the logs rather than a fixed time.

https://github.com/ZcashFoundation/zebra/actions/runs/6607410396/job/17944979809?pr=7800#step:4:6196

This is unrelated and will be cleared the next time I push.

@teor2345 teor2345 changed the title change(consensus): Build Sprout and Sapling parameters into the zebrad binary change(consensus): Build Sprout and Sapling parameters into the zebrad binary, so a download server isn't needed Oct 24, 2023
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Oct 24, 2023
@teor2345 teor2345 removed I-panic Zebra panics with an internal error message C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Oct 24, 2023
@teor2345 teor2345 marked this pull request as ready for review October 24, 2023 01:24
@teor2345 teor2345 requested review from a team as code owners October 24, 2023 01:24
@teor2345 teor2345 requested review from upbqdn and removed request for a team October 24, 2023 01:24
@teor2345 teor2345 requested a review from a team as a code owner October 24, 2023 01:33
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Oct 24, 2023
upbqdn
upbqdn previously approved these changes Oct 24, 2023
zebra-consensus/src/primitives/groth16/params.rs Outdated Show resolved Hide resolved
upbqdn
upbqdn previously approved these changes Oct 24, 2023
@mergify mergify bot merged commit aad883b into main Oct 24, 2023
158 checks passed
@mergify mergify bot deleted the bin-params branch October 24, 2023 23:27
@teor2345 teor2345 mentioned this pull request Oct 25, 2023
18 tasks
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 C-enhancement Category: This is an improvement C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG I-usability Zebra is hard to understand or use
Projects
None yet
2 participants