Skip to content

Commit

Permalink
Merge pull request #15486 from MinaProtocol/georgeee/patch-build-hard…
Browse files Browse the repository at this point in the history
…fork-package.sh

[Draft] Patch build-hardfork-package.sh against a bug in 1.4
  • Loading branch information
deepthiskumar authored Apr 9, 2024
2 parents e7d7fff + b69d7ea commit dc6bf78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions buildkite/scripts/build-hardfork-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ echo "--- Download and extract previous network config"
curl -o config.json.gz $CONFIG_JSON_GZ_URL
gunzip config.json.gz

# Patch against a bug in 1.4 which is fixed by PR #15462
mv config.json config_orig.json
jq 'del(.ledger.num_accounts) | del(.ledger.name)' config_orig.json > config.json

echo "--- Migrate accounts to new network format"
# TODO: At this stage, we need to migrate the json accounts into the new network's format.
# For now, this is hard-coded to the mainnet -> berkeley migration, but we need to select
Expand Down
7 changes: 6 additions & 1 deletion scripts/mina-verify-packaged-fork-config
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ GENESIS_TIMESTAMP=$(jq -r '.genesis.genesis_state_timestamp' "$PACKAGED_DAEMON_C

echo "exporting ledgers from running node ... (this may take a while)" >&2

override_file="$workdir/override-genesis-timestamp.json"
echo "{\"genesis\":{\"genesis_state_timestamp\":\"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\"}}" > "$override_file"

# export the packaged ledgers in a way where we know which one is which
function extract_ledgers() {
config_file=$1
ledger_dir=$2
json_prefix=$3
"$MINA_EXE" daemon --libp2p-keypair "$workdir/keys/p2p" --config-file "$config_file" --seed --genesis-ledger-dir "$ledger_dir" &
"$MINA_EXE" daemon --libp2p-keypair "$workdir/keys/p2p" \
--config-file "$config_file" --config-file "$override_file" \
--seed --genesis-ledger-dir "$ledger_dir" &

while ! "$MINA_EXE" ledger export staged-ledger | jq . 2>/dev/null >"$json_prefix-staged.json"; do
sleep 1m
Expand Down

0 comments on commit dc6bf78

Please sign in to comment.