Commit Graph

58 Commits

Author SHA1 Message Date
Greg Pfeil 713fc761dd
Apply suggestions from code review 2023-03-07 12:39:06 -07:00
sasha a0869d6a35 Re-download parameters if they already exist but don't have correct sums
We change the help text to allude to this behavior as well.
2023-02-16 17:01:14 -08:00
sasha 862c52c48b Enable the (existing) custom error message for the invalid checksum case
We add a `set +e` around the `sha256sum` invocation, otherwise the shell
errors out instantly (because of the `set -e` at the top), so we have
the chance to print out the custom error message. We `set -e` as soon as
we grab the return value from `sha256sum`.
2023-02-16 16:59:03 -08:00
Yasser Isa 567f586c65 DOWNLOAD_URL dynamic in fetch-params.sh 2023-02-15 19:07:33 -07:00
Greg Pfeil 81cc5b98e1
Support Bash 3.2 in fetch-params.sh
MacOS still ships with a 15-year-old version of Bash so this removes some usage of features that
require newer (only 10 years old) versions.

Fixes #6367.

Co-authored-by: Mohamed AlFalasi <2569171+edubai@users.noreply.github.com>
2023-01-26 15:33:57 -07:00
Greg Pfeil e91aa37b6e
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-06 00:08:08 -07:00
Greg Pfeil e798ffd62c Scope the fetch-params lock file to the user
Also takes the opportunity to use more standard location for the lockfile and
improves the lock-conflict error to help a user if the fetcher crashed without
removing the lock or if they are running it from a distribution in which it’s
called `zcash-fetch-params` instead of `fetch-params.sh`.

Fixes #3925
2022-11-22 08:35:07 -07:00
Greg Pfeil 3bfa1e4ab8 Migrate fetch-params.sh to bash 2022-11-14 17:56:59 -10:00
Greg Pfeil 6a0586e73d Remove trailing whitespace in fetch-params.sh 2022-11-14 17:53:54 -10:00
Jack Grigg 1f94372b86 lint: Fix shell lints 2022-08-19 22:40:02 +00:00
Jack Grigg 09e0af815f Revert "lint: Fix false positive"
This reverts commit fb38cf0d90.

The lint fix caused a problem on macOS, where the escaped double quote
was interpreted as part of an argument, and not as defining an argument.
We will need to find another way to address the lint.

Closes zcash/zcash#5379.
2021-12-16 21:54:48 +00:00
Jack Grigg fb38cf0d90 lint: Fix false positive
shellcheck interprets the single-quoted string as arguments to echo, not
the string that echo echos. Switching to double quotes fixes the lint.
2021-04-01 14:30:35 +13:00
Jack Grigg a1903d2644 Remove usage of local from fetch-params.sh 2021-04-01 14:28:41 +13:00
plutoforever 762f643613 removed bashisms from build scripts
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-03-31 19:24:36 +13:00
Jack Grigg 399ab8afa6 lint: Fix minor shellcheck lints 2020-11-09 23:20:39 +00:00
Jack Grigg dbfb3565d6 lint: Opt out of locale dependence in Zcash shell scripts 2020-11-09 23:06:21 +00:00
Jack Grigg 7c4b19fa4d lint: Use consistent shebangs 2020-11-09 23:06:21 +00:00
Homu 77c2e1c251 Auto merge of #3481 - LarryRuane:fetch-params-testnet-arg, r=mdr0id
zcutil/fetch-params.sh unneeded --testnet arg should warn user

If fetch-params.sh user doesn't know that testnet and mainnet params are the same, and user specifies --testnet, it's confusing that the argument is ignored.
2020-02-25 20:40:49 +00:00
Homu 961c0d58ec Auto merge of #4060 - str4d:remove-libsnark, r=daira
Remove libsnark

Closes #167. Closes #416. Closes #418. Closes #437.
Closes #521. Closes #743. Closes #750. Closes #894.
Closes #903. Closes #1125. Closes #1136. Closes #1240.
Closes #1264. Closes #1516. Closes #1517. Closes #1651.
Closes #2064. Closes #2158. Closes #3478. Closes #3652.
Closes #3744.
2019-09-26 11:21:40 -07:00
Jack Grigg 2efcb9e592
Stop fetching old Sprout parameters
We aren't automatically deleting them yet.
2019-09-17 12:00:03 +01:00
Gareth Davies cecccce6fa
Updating IPFS link for chunking 2019-09-12 21:14:23 -07:00
zebambam c4bfc3a257 Fixes 4097, improves caching on parameter downloads 2019-08-14 16:25:16 -07:00
Gareth Davies fb6cd66660 Add clarifying text for parameter size 2018-10-30 21:10:31 -07:00
Larry Ruane 2bedcd3ecf zcutil/fetch-params.sh unneeded --testnet arg should warn user 2018-10-22 09:40:04 -06:00
Sean Bowe 198dfd3c36 Switch to use the official Sapling parameters. 2018-08-04 16:28:39 -06:00
Charlie OKeefe eb20680502 Remove extra slash from lockfile path 2018-07-24 16:18:30 -06:00
Sean Bowe 45f1cb440e Update Sapling testnet parameters 2018-05-18 13:26:39 -06:00
Sean Bowe acfcdb94b9 Load Sapling testnet parameters into memory. 2018-04-17 15:04:46 -06:00
kozyilmaz 4c2120c736 [macOS] use shlock instead of flock in fetch-params 2017-12-17 20:18:03 +03:00
kozyilmaz 3c3623ef23 [macOS] added curl method for param download 2017-12-17 19:30:19 +03:00
kpcyrd 076e177dd9 Prefer wget over ipfs 2017-09-21 03:28:14 +02:00
kpcyrd 3ccbbe31a4 Fetch params from ipfs if possible
Disable ipfs with ZC_DISABLE_IPFS=
2017-09-21 03:28:04 +02:00
Murilo Santana 5ad3193ac8 Fix sha256sum on busybox by using -c instead of --check 2016-11-20 16:04:51 -02:00
Kevin Gallagher 4bc627b6a3 Improves usability of fetch-params.sh
Remove the lockfile at the end (fixes #1731)
Makes it clearer what happens in the script output if params already exist.
2016-11-02 11:06:55 -07:00
zkbot 278439fbe3 Auto merge of #1623 - ebfull:sprout-params, r=str4d
Zcash zk-SNARK public parameters for 1.0 "Sprout".

Created in the ceremony this weekend! 🎉

We're writing a blog post about this, I'm going to publish the code shortly too.

Closes #1553
2016-10-27 03:08:10 +00:00
Kevin Gallagher a885ee4668 Prefer sha256sum but fall back to shasum if not available
One is provided by coreutils, the other is a Perl module.
2016-10-24 14:39:52 -07:00
Sean Bowe 27e3f362f0 Zcash zk-SNARK public parameters for 1.0 "Sprout". 2016-10-24 11:22:39 -06:00
Kevin Gallagher e3320f4f0f Increases timeout to 30s, wait before retry to 3s
Default: 20 tries
2016-10-11 10:56:01 -07:00
Kevin Gallagher f964718c83 Set wget retry options for fetching parameters
This will retry upon refused connections and similar errors, wait 1 second
before the next retry, time out after 10 seconds if no data is received or
the connection times out, plus try an infinite number of times.
2016-10-10 20:34:55 -07:00
Sean Bowe 796c7ee52f Update to `beta2` public parameters, remove `regtest`/`testnet3` parameters
subdirectories.
2016-10-03 15:58:02 -06:00
Kevin Gallagher e70213103c Verify TLS certificates w/ wget in fetch-params.sh
Per NCC-2016-017, wget was run with --no-check-certificate,
which means that the connection can be man-in-the-middled,
even if we are verifying the integrity of the params later via hash sums.
The rationale cited in the Bash comments does not stand up to scrutiny.
There's really no persuasive reason not to verify certificates.

Fixes #1346.
2016-09-30 12:08:15 -07:00
Kevin Gallagher 2e113f6b9d Lock to prevent parallel execution of fetch-params.sh
Two instances of the fetch-params.sh script running at once will
result in corruption of the proving key and an error when the
hashes are computed. This implements a lock to stop such a
scenario from occurring.

We also terminate and don't create the symlinks if the downloaded
parameters fail the checksum command.
2016-09-22 03:08:42 -07:00
Alfie John 70db019c6a Updating wording to match Beta Guide 2016-09-15 22:00:13 +10:00
Alfie John 42c03d49f2 Typo in params README 2016-09-15 21:58:55 +10:00
Sean Bowe 393b2b7834 Update proving/verifying keys. 2016-08-22 15:48:43 -06:00
Sean Bowe 1477fd3f40 Remove the constraint system from the alpha proving key. 2016-07-19 14:01:58 -06:00
Sean Bowe 1744fec274 Update the zkSNARK parameters. 2016-06-03 21:04:07 -06:00
Sean Bowe 6b5d608899 Update proving key and tests that depend on transaction structure changes 2016-05-24 11:09:17 -06:00
Alex 7e540a0b6f add sha256sum support for Mac OS X 2016-05-23 23:54:29 +02:00
Sean Bowe 3e0af61b86 Update zkSNARK proving/verifying keys. 2016-05-12 16:45:12 -06:00