-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle proving keys in dedicated package (#872)
- Loading branch information
1 parent
8f3c1c5
commit 90498a7
Showing
20 changed files
with
874 additions
and
1,117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,6 @@ lerna-debug.log* | |
*.sln | ||
*.sw? | ||
*.pem | ||
|
||
# large binary files | ||
*_pk.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
pnpm-lock.yaml | ||
packages/wasm/crate | ||
packages/wasm/wasm | ||
apps/extension/bin | ||
*_pk.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"delegatorVote": "delegator_vote_pk.bin", | ||
"output": "output_pk.bin", | ||
"spend": "spend_pk.bin", | ||
"swap": "swap_pk.bin", | ||
"swapClaim": "swapclaim_pk.bin", | ||
"undelegateClaim": "convert_pk.bin" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
set -e | ||
defaultKeysVersion="v0.71.0" | ||
|
||
usage() { | ||
echo "${1}" | ||
echo "Usage: $(basename ${0}) <output-path> [<git tag> <sha256 manifest>]" | ||
exit 64 # EX_USAGE | ||
} | ||
|
||
if [ -z "${PENUMBRA_KEYS_DIR}" ]; then | ||
[ -z "${1}" ] && usage "No output path specified." | ||
PENUMBRA_KEYS_DIR=$1 | ||
fi | ||
|
||
if [ -z "${PENUMBRA_KEYS_VERSION}"]; then | ||
if [ -z "${2}" ]; then | ||
PENUMBRA_KEYS_VERSION=$defaultKeysVersion | ||
else | ||
[ -z "${3}" ] && usage "No sha256 provided." | ||
PENUMBRA_KEYS_VERSION=$2 | ||
PENUMBRA_KEYS_SHA256=$(readlink -f "${3}") | ||
fi | ||
fi | ||
|
||
if [ -z "${SKIP_DOWNLOAD_KEYS}" ]; then | ||
keysUrl="https://github.com/penumbra-zone/penumbra/raw/${PENUMBRA_KEYS_VERSION}/crates/crypto/proof-params/src/gen/" | ||
keysGlob="{convert,delegator_vote,nullifier_derivation,output,spend,swap,swapclaim}_pk.bin" | ||
curl --output-dir "${PENUMBRA_KEYS_DIR}/${PENUMBRA_KEYS_VERSION}" --continue-at - \ | ||
--parallel --create-dirs --location --remote-name \ | ||
"${keysUrl}${keysGlob}" | ||
fi | ||
|
||
ln -vf "${PENUMBRA_KEYS_DIR}/${PENUMBRA_KEYS_VERSION}/"*_pk.bin "${PENUMBRA_KEYS_DIR}" | ||
|
||
shacmd=$(which sha256sum || which shasum) | ||
[ -z $shacmd ] && usage "No sha256sum or shasum tool available." | ||
|
||
cd "${PENUMBRA_KEYS_DIR}" | ||
if [ -f "${PENUMBRA_KEYS_SHA256}" ]; then | ||
${shacmd} -c "${PENUMBRA_KEYS_SHA256}" | ||
elif [ "${PENUMBRA_KEYS_VERSION}" = "${defaultKeysVersion}" ]; then | ||
${shacmd} -c <<EOF | ||
882527eb795af2819f8df4f6233d5844757768fb03d51a000f11b100eeea573f convert_pk.bin | ||
6712a90216c7c0cfb12ef2a37d48ffae666f8d2bd9a722836864d0a70064dce7 delegator_vote_pk.bin | ||
ac9568335c1c158edddb2a70212c7b98d7c7aeff633b485a088049ecc01cc0ef nullifier_derivation_pk.bin | ||
a8c5ccc9d6c74150a21a8411e90d523e6ebb0f2a2985327d9fb4ef690600461e output_pk.bin | ||
69694b15abd96fdbeba5bbe1ba982d2240129be05813a9693acce31a1b43b0fd spend_pk.bin | ||
3d75cac8a227cd8c6680cd40f94a436b89f10d9b9bb1a118cf4479f1aa9b3fef swap_pk.bin | ||
8501f1dad9ac85d80c6421b17b838f8c6478431babfa836d3d33b5398fa6b6ad swapclaim_pk.bin | ||
EOF | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "@penumbra-zone/keys", | ||
"version": "0.71.0", | ||
"description": "Tool to download proving keys for Penumbra", | ||
"type": "module", | ||
"files": [ | ||
"action-keys.json", | ||
"download-keys", | ||
"keys" | ||
], | ||
"exports": { | ||
".": "./action-keys.json", | ||
"./*_pk.bin": "./keys/*_pk.bin" | ||
}, | ||
"scripts": { | ||
"postinstall": "./download-keys ./keys" | ||
}, | ||
"bin": { | ||
"penumbra-download-keys": "./download-keys" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
crate/target | ||
crate/**/*.rs.bk | ||
crate/wasm-pack.log | ||
crate/wasm-pack.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.