From c8fe1ecefc28eb6961cf80b9591aafb45cd3872e Mon Sep 17 00:00:00 2001 From: Eric Semeniuc <3838856+esemeniuc@users.noreply.github.com> Date: Wed, 4 Oct 2023 20:05:28 -0700 Subject: [PATCH 1/2] Update autosnapshot_inner.sh --- mev-programs/scripts/autosnapshot_inner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mev-programs/scripts/autosnapshot_inner.sh b/mev-programs/scripts/autosnapshot_inner.sh index 04e5d5a..d522bf2 100755 --- a/mev-programs/scripts/autosnapshot_inner.sh +++ b/mev-programs/scripts/autosnapshot_inner.sh @@ -115,7 +115,7 @@ create_snapshot_for_slot() { # produces snapshot in $snapshot_dir # shellcheck disable=SC2012 - RUST_LOG=info solana-ledger-tool -l "$ledger_location" create-snapshot --enable-accounts-disk-index "$snapshot_slot" "$snapshot_dir" + RUST_LOG=info solana-ledger-tool -l "$ledger_location" create-snapshot "$snapshot_slot" "$snapshot_dir" # TODO: figure this out # for some reason solana-ledger-tool error doesn't cause this script to exit out, so check status here From 0db7023112b3ff885afc7da5235489ec5a089836 Mon Sep 17 00:00:00 2001 From: Eric Semeniuc <3838856+esemeniuc@users.noreply.github.com> Date: Tue, 10 Oct 2023 08:49:39 -0700 Subject: [PATCH 2/2] reorg --- mev-programs/scripts/autosnapshot_inner.sh | 84 +++++++++++----------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/mev-programs/scripts/autosnapshot_inner.sh b/mev-programs/scripts/autosnapshot_inner.sh index d522bf2..19d7e92 100755 --- a/mev-programs/scripts/autosnapshot_inner.sh +++ b/mev-programs/scripts/autosnapshot_inner.sh @@ -126,6 +126,35 @@ create_snapshot_for_slot() { fi } +get_gcloud_path() { + local solana_cluster=$1 + local epoch=$2 + local file_name=$3 + + local upload_path + + upload_path="gs://jito-$solana_cluster/$epoch/$(hostname)/$file_name" + + echo "$upload_path" +} + +get_filepath_in_gcloud() { + local upload_path=$1 + + local file_uploaded + + file_uploaded=$(gcloud storage ls "$upload_path" | { grep "$upload_path" || true; }) + + echo "$file_uploaded" +} + +upload_file_to_gcloud() { + local filepath=$1 + local gcloud_path=$2 + + gcloud storage cp "$filepath" "$gcloud_path" +} + generate_stake_meta() { local slot=$1 local snapshot_dir=$2 @@ -160,6 +189,20 @@ generate_merkle_trees() { --out-path "$merkle_tree_filepath" } +upload_merkle_roots() { + local merkle_root_path=$1 + local keypair_path=$2 + local rpc_url=$3 + local tip_distribution_program_id=$4 + + RUST_LOG=info \ + solana-merkle-root-uploader \ + --merkle-root-path "$merkle_root_path" \ + --keypair-path "$keypair_path" \ + --rpc-url "$rpc_url" \ + --tip-distribution-program-id "$tip_distribution_program_id" +} + claim_tips() { local merkle_trees_path=$1 local rpc_url=$2 @@ -173,28 +216,6 @@ claim_tips() { --keypair-path "$keypair_path" } -get_gcloud_path() { - local solana_cluster=$1 - local epoch=$2 - local file_name=$3 - - local upload_path - - upload_path="gs://jito-$solana_cluster/$epoch/$(hostname)/$file_name" - - echo "$upload_path" -} - -get_filepath_in_gcloud() { - local upload_path=$1 - - local file_uploaded - - file_uploaded=$(gcloud storage ls "$upload_path" | { grep "$upload_path" || true; }) - - echo "$file_uploaded" -} - prune_old_snapshots() { NUM_SNAPSHOTS_TO_KEEP=3 local to_delete_stake @@ -215,26 +236,7 @@ prune_old_snapshots() { rm -f -v $to_delete_snapshot } -upload_file_to_gcloud() { - local filepath=$1 - local gcloud_path=$2 - gcloud storage cp "$filepath" "$gcloud_path" -} - -upload_merkle_roots() { - local merkle_root_path=$1 - local keypair_path=$2 - local rpc_url=$3 - local tip_distribution_program_id=$4 - - RUST_LOG=info \ - solana-merkle-root-uploader \ - --merkle-root-path "$merkle_root_path" \ - --keypair-path "$keypair_path" \ - --rpc-url "$rpc_url" \ - --tip-distribution-program-id "$tip_distribution_program_id" -} find_previous_epoch_last_slot() { local slot_with_block=$1