-
Notifications
You must be signed in to change notification settings - Fork 548
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
Generate script to patch receipt chain hashes and last VRF output #14419
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
74be2a6
Generate scripts to fix receipt chain hashes
af5962b
Allow passing hashes_file and update_script names on command line
aa58750
Merge branch 'rampup' into feature/fix-receipt-chain-hashes
psteckler f7c4c3c
allow already-migrated hashes
142d260
Migrate last_vrf_output
5864b0a
Merge branch 'rampup' into feature/fix-receipt-chain-hashes
psteckler 1c8f089
Merge branch 'rampup' into feature/fix-receipt-chain-hashes
psteckler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
if [ ! $# -eq 1 ] ; then | ||
echo "Usage" $0 archive-db | ||
exit 0 | ||
fi | ||
|
||
ARCHIVE_DB=$1 | ||
HASHES_FILE=hashes_file.tmp | ||
UPDATE_SCRIPT=hashes_update.sql | ||
|
||
rm -f $HASHES_FILE | ||
rm -f $UPDATE_SCRIPT | ||
|
||
echo "select id,receipt_chain_hash from zkapp_account_precondition where receipt_chain_hash is not null;" | \ | ||
psql --csv -t -q $ARCHIVE_DB > $HASHES_FILE | ||
|
||
for line in `cat $HASHES_FILE` | ||
do ( | ||
ID=$(echo $line | awk -F , '{print $1}'); | ||
FP=$(echo $line | awk -F , '{print $2}'); | ||
B58=$(echo $FP | _build/default/src/app/receipt_chain_hash_to_b58/receipt_chain_hash_to_b58.exe); | ||
echo $ID "'"$B58"'" | awk '{print "UPDATE zkapp_account_precondition SET receipt_chain_hash=" $2 " WHERE id=" $1 ";"}' >> $UPDATE_SCRIPT) | ||
done | ||
|
||
echo "Done!" | ||
echo "Now run:" "psql -d" $ARCHIVE_DB "<" $UPDATE_SCRIPT |
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,19 @@ | ||
(executable | ||
(package receipt_chain_hash_to_b58) | ||
(name receipt_chain_hash_to_b58) | ||
(public_name receipt_chain_hash_to_b58) | ||
(libraries | ||
;; opam libraries | ||
;; local libraries | ||
mina_base | ||
kimchi_backend | ||
kimchi_backend.pasta | ||
kimchi_backend.pasta.basic | ||
pickles | ||
pickles.backend | ||
pickles_types | ||
snark_params | ||
) | ||
(preprocessor_deps ../../config.mlh) | ||
(instrumentation (backend bisect_ppx)) | ||
(preprocess (pps ppx_mina ppx_version))) |
5 changes: 5 additions & 0 deletions
5
src/app/receipt_chain_hash_to_b58/receipt_chain_hash_to_b58.ml
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,5 @@ | ||
let () = | ||
let s = Stdlib.read_line () in | ||
let fp = Kimchi_backend.Pasta.Basic.Fp.of_string s in | ||
let receipt_chain_hash : Mina_base.Receipt.Chain_hash.t = fp in | ||
Format.printf "%s@." (Mina_base.Receipt.Chain_hash.to_base58_check receipt_chain_hash) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't those be a parameters ?
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.
Made them optional command-line args.