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

Generate script to patch receipt chain hashes and last VRF output #14419

Merged
merged 7 commits into from
Nov 2, 2023

Conversation

psteckler
Copy link
Member

@psteckler psteckler commented Oct 23, 2023

Generate a script to patch the receipt chain hashes in the zkapp_account_precondition table, and the last VRF output in the blocks table.

There are three pieces here:

  1. An app receipt_chain_hash_to_b58, a Unix-style filter that takes an Fp string as input and prints it as Receipt.Chain_hash.t in Base58Check format

  2. A similar app, last_vrf_output_to_b64, that takes a hex string as input, and prints it as a Base64 string

  3. A shell script that uses (1) and (2) to generate an SQL file that updates the archive db with the Base58Check hashes and Base64 string

These were tested against a local copy of the ITN archive db. After applying it, the replayer did not encounter the failures that were seen in the ITN replayer cron job.

Important:

  • the script can be run as many times as needed; already-patched hashes and last VRF output are left intact
  • make a backup of the archive data before running the SQL!

Part of #14417.

fi

ARCHIVE_DB=$1
HASHES_FILE=hashes_file.tmp
Copy link
Member

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 ?

Copy link
Member Author

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.

@psteckler
Copy link
Member Author

!ci-build-me

@psteckler psteckler marked this pull request as ready for review October 30, 2023 18:19
@psteckler psteckler requested review from a team as code owners October 30, 2023 18:19
@psteckler psteckler changed the title Generate script to patch receipt chain hashes Generate script to patch receipt chain hashes and last VRF output Oct 31, 2023
@psteckler
Copy link
Member Author

!ci-build-me

@psteckler
Copy link
Member Author

!ci-build-me

@deepthiskumar
Copy link
Member

!approved-for-mainnet

@deepthiskumar deepthiskumar merged commit a40412a into rampup Nov 2, 2023
24 of 25 checks passed
@deepthiskumar deepthiskumar deleted the feature/fix-receipt-chain-hashes branch November 2, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants