Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
34ed2b1
mina-verify-packaged-fork-config checks the hashes against a block fr…
emberian Mar 27, 2024
e1d3aea
runtime_genesis_ledger: output an 'oldhash' for input ledgers
emberian Mar 28, 2024
8bb1efc
verify-packaged-fork-config: use the new oldhash
emberian Mar 28, 2024
16fec5b
ensure packages have required $PATH constituents
emberian Mar 28, 2024
00a025c
gotta do the cooking by the book
emberian Mar 28, 2024
1f1a2b3
whoops
emberian Mar 28, 2024
7914260
Use ledger_depth=20 for old hash
georgeee Apr 1, 2024
cd20af0
Support v1 format for ledger hash generation
georgeee Apr 1, 2024
0664830
Revert "Support v1 format for ledger hash generation"
georgeee Apr 1, 2024
65823f8
Revert "Use ledger_depth=20 for old hash"
georgeee Apr 1, 2024
b2687fb
Revert changes to runtime_genesis_ledger
georgeee Apr 1, 2024
17e02fb
Update script with use of mina-create-legacy-genesis
georgeee Apr 1, 2024
2b7fabe
try this approach
emberian Apr 2, 2024
be5079c
Merge branch 'berkeley' into feat/verify-epoch-ledgers-too
georgeee Apr 2, 2024
e88c7e4
install mina-create-legacy-ledger from #15433
emberian Apr 2, 2024
377f5a7
cleanup extra stuff that happened differently already upstream
emberian Apr 2, 2024
84cf8b1
these are probably aesthetically unnecessary despite helping >1 person
emberian Apr 2, 2024
6441ccb
ok, mina-docker gets that one
emberian Apr 2, 2024
875c00c
typo
emberian Apr 2, 2024
1235243
use correct name in mina-create-legacy-genesis
dkijania Apr 3, 2024
263c7b6
Merge branch 'berkeley' into feat/verify-epoch-ledgers-too
dkijania Apr 3, 2024
2972ab4
Merge branch 'berkeley' into feat/verify-epoch-ledgers-too
georgeee Apr 3, 2024
e344310
Merge remote-tracking branch 'origin/compatible' into feat/verify-epo…
georgeee Apr 3, 2024
3d48ddd
Fix a typo
georgeee Apr 3, 2024
c1f7046
brace expansion only happens outside double quotes
emberian Apr 3, 2024
abc8253
Nits
georgeee Apr 4, 2024
84d4804
Split the jq-based check to two separate checks
georgeee Apr 4, 2024
4622105
Fix expression extracting info from precomputed block
georgeee Apr 4, 2024
45d56b0
Fix for "Assert corrupted packaged artifacts are unverifiable"
georgeee Apr 4, 2024
b733cf9
Silence noise in re-attempting to export staged ledger
georgeee Apr 4, 2024
34064ef
Merge branch 'berkeley' into feat/verify-epoch-ledgers-too
georgeee Apr 4, 2024
5ee02fa
Patch against a bug in 1.4 which is fixed by PR #15462
georgeee Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions scripts/mina-verify-packaged-fork-config
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,17 @@ export FORKING_FROM_CONFIG_JSON=${FORKING_FROM_CONFIG_JSON:-$(source_build_fallb

export MINA_LIBP2P_PASS=''

workdir=$3
mkdir -p "$workdir"
mkdir -p "$workdir/ledgers"
mkdir -p "$workdir/ledgers-backup"
mkdir -p "$workdir/keys"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not write above commands in one line?

mkdir -p "$workdir"/{ledgers,ledgers-backup,keys}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when there was only one .... the thought had yet to occur to me that there would be three.

chmod 700 "$workdir/keys"

fork_block_state_hash=$(jq -r '.proof.fork.state_hash' "$2")
fork_block_length=$(jq -r '.proof.fork.blockchain_length' "$2")

# Put the fork block where we want it, fetch it from gcloud if necessary
if [ ! -e "$PRECOMPUTED_FORK_BLOCK" ]; then
if [ "$PRECOMPUTED_FORK_BLOCK" = "" ]; then
"$GSUTIL" cp "gs://mina_network_block_data/$1-$fork_block_length-$fork_block_state_hash.json" "$workdir/precomputed_fork_block.json"
Expand All @@ -89,12 +97,6 @@ else
cp "$PRECOMPUTED_FORK_BLOCK" "$workdir/precomputed_fork_block.json"
fi

workdir=$3
mkdir -p "$workdir"
mkdir -p "$workdir/ledgers"
mkdir -p "$workdir/ledgers-backup"
mkdir -p "$workdir/keys"
chmod 700 "$workdir/keys"

if [ ! -e "$workdir/keys/p2p" ]; then
"$MINA_EXE" libp2p generate-keypair --privkey-path "$workdir/keys/p2p"
Expand Down Expand Up @@ -142,7 +144,7 @@ mv -t /var/lib/coda "$workdir/ledgers-backup"/*
echo "Performing final comparisons..." >&2
error=0

result=$(jq --slurpfile hashes "$workdir/hashes.json" --slurpfile a "$workdir/config-substituted.json" --slurpfile b "$PACKAGED_DAEMON_CONFIG" -n '
result=$(jq --slurpfile block "$workdir/precomputed_fork_block.json" --slurpfile hashes "$workdir/hashes.json" --slurpfile a "$workdir/config-substituted.json" --slurpfile b "$PACKAGED_DAEMON_CONFIG" -n '
($a[0].epoch_data.staking.hash == $b[0].epoch_data.staking.hash and
$a[0].epoch_data.next.hash == $b[0].epoch_data.next.hash and
$hashes[0].epoch_data.staking.oldhash == $block[0].protocol_state.body.consensus_state.staking_epoch_data.ledger.hash and
Expand Down