From 796c7ee52fe792d22f0bf223e4252dc3bc74b2d5 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Mon, 3 Oct 2016 15:58:02 -0600 Subject: [PATCH] Update to `beta2` public parameters, remove `regtest`/`testnet3` parameters subdirectories. --- src/init.cpp | 4 ++-- src/util.cpp | 1 - src/zcbenchmarks.cpp | 4 ++-- zcutil/fetch-params.sh | 51 ++++++++++++++++-------------------------- 4 files changed, 23 insertions(+), 37 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 8c7a227b..54d6634a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -613,8 +613,8 @@ static void ZC_LoadParams() struct timeval tv_start, tv_end; float elapsed; - boost::filesystem::path pk_path = ZC_GetParamsDir() / "z9-proving.key"; - boost::filesystem::path vk_path = ZC_GetParamsDir() / "z9-verifying.key"; + boost::filesystem::path pk_path = ZC_GetParamsDir() / "beta2-proving.key"; + boost::filesystem::path vk_path = ZC_GetParamsDir() / "beta2-verifying.key"; pzcashParams = ZCJoinSplit::Unopened(); diff --git a/src/util.cpp b/src/util.cpp index 0b315317..b451b65a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -478,7 +478,6 @@ const boost::filesystem::path &ZC_GetParamsDir() return path; path = ZC_GetBaseParamsDir(); - path /= BaseParams().DataDir(); return path; } diff --git a/src/zcbenchmarks.cpp b/src/zcbenchmarks.cpp index 3a11095c..015b9320 100644 --- a/src/zcbenchmarks.cpp +++ b/src/zcbenchmarks.cpp @@ -52,8 +52,8 @@ double benchmark_sleep() double benchmark_parameter_loading() { // FIXME: this is duplicated with the actual loading code - boost::filesystem::path pk_path = ZC_GetParamsDir() / "z9-proving.key"; - boost::filesystem::path vk_path = ZC_GetParamsDir() / "z9-verifying.key"; + boost::filesystem::path pk_path = ZC_GetParamsDir() / "beta2-proving.key"; + boost::filesystem::path vk_path = ZC_GetParamsDir() / "beta2-verifying.key"; struct timeval tv_start; timer_start(tv_start); diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh index 7a3f7519..055eb3a8 100755 --- a/zcutil/fetch-params.sh +++ b/zcutil/fetch-params.sh @@ -4,19 +4,16 @@ set -eu PARAMS_DIR="$HOME/.zcash-params" -REGTEST_PKEY_NAME='z9-proving.key' -REGTEST_VKEY_NAME='z9-verifying.key' -REGTEST_PKEY_URL="https://z.cash/downloads/$REGTEST_PKEY_NAME" -REGTEST_VKEY_URL="https://z.cash/downloads/$REGTEST_VKEY_NAME" -REGTEST_DIR="$PARAMS_DIR/regtest" - -# This should have the same params as regtest. We use symlinks for now. -TESTNET3_DIR="$PARAMS_DIR/testnet3" +BETA2_PKEY_NAME='beta2-proving.key' +BETA2_VKEY_NAME='beta2-verifying.key' +BETA2_PKEY_URL="https://z.cash/downloads/$BETA2_PKEY_NAME" +BETA2_VKEY_URL="https://z.cash/downloads/$BETA2_VKEY_NAME" function fetch_params { local url="$1" local output="$2" local dlname="${output}.dl" + local expectedhash="$3" if ! [ -f "$output" ] then @@ -27,8 +24,18 @@ function fetch_params { --continue \ "$url" - # Only after successful download do we update the parameter load path: - mv -v "$dlname" "$output" + shasum -a 256 --check <