Skip to content

Commit

Permalink
Merge pull request #15927 from MinaProtocol/sai/snark-keys-develop
Browse files Browse the repository at this point in the history
swapping out the s3 bucket link for snark-keys
  • Loading branch information
svv232 authored Aug 21, 2024
2 parents 0669b46 + a6212a6 commit e37a744
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions buildkite/scripts/build-hardfork-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ _build/default/src/app/runtime_genesis_ledger/runtime_genesis_ledger.exe --confi
echo "--- Create hardfork config"
FORK_CONFIG_JSON=config.json LEDGER_HASHES_JSON=hardfork_ledger_hashes.json scripts/hardfork/create_runtime_config.sh > new_config.json

existing_files=$(aws s3 ls s3://snark-keys.o1test.net/ | awk '{print $4}')
existing_files=$(aws s3 ls s3://snark-keys-ro.o1test.net/ | awk '{print $4}')
for file in hardfork_ledgers/*; do
filename=$(basename "$file")

if echo "$existing_files" | grep -q "$filename"; then
echo "Info: $filename already exists in the bucket, packaging it instead."
oldhash=$(openssl dgst -r -sha3-256 "$file" | awk '{print $1}')
aws s3 cp "s3://snark-keys.o1test.net/$filename" "$file"
aws s3 cp "s3://snark-keys-ro.o1test.net/$filename" "$file"
newhash=$(openssl dgst -r -sha3-256 "$file" | awk '{print $1}')
sed -i "s/$oldhash/$newhash/g" new_config.json
else
aws s3 cp --acl public-read "$file" s3://snark-keys.o1test.net/
aws s3 cp --acl public-read "$file" s3://snark-keys-ro.o1test.net/
fi
done

Expand Down
3 changes: 1 addition & 2 deletions scripts/mina-verify-packaged-fork-config
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ for file in "$workdir"/ledgers/*.tar.gz; do
mkdir -p "$tardir"/{packaged,generated,web}
tar -xzf "$file" -C "$tardir/generated"
tar -xzf "$GENESIS_LEDGER_DIR/$tarname.tar.gz" -C "$tardir/packaged"
curl "https://s3-us-west-2.amazonaws.com/snark-keys.o1test.net/$tarname.tar.gz" | tar -xz -C "$tardir/web"

curl "https://s3-us-west-2.amazonaws.com/snark-keys-ro.o1test.net/$tarname.tar.gz" | tar -xz -C "$tardir/web"
$ldb_cmd --hex --db="$tardir/packaged" scan > "$workdir/packaged.scan"
$ldb_cmd --hex --db="$tardir/web" scan > "$workdir/web.scan"
$ldb_cmd --hex --db="$tardir/generated" scan > "$workdir/generated.scan"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cache_dir/fake/cache_dir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let autogen_path = "/tmp/coda_cache_dir"
let s3_install_path = "/tmp/s3_cache_dir"

let s3_keys_bucket_prefix =
"https://s3-us-west-2.amazonaws.com/snark-keys.o1test.net"
"https://s3-us-west-2.amazonaws.com/snark-keys-ro.o1test.net"

let manual_install_path = "/var/lib/coda"

Expand Down
4 changes: 2 additions & 2 deletions src/lib/cache_dir/native/cache_dir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let s3_install_path = "/tmp/s3_cache_dir"
let s3_keys_bucket_prefix =
Option.value
(Sys.getenv "MINA_LEDGER_S3_BUCKET")
~default:"https://s3-us-west-2.amazonaws.com/snark-keys.o1test.net"
~default:"https://s3-us-west-2.amazonaws.com/snark-keys-ro.o1test.net"

let manual_install_path = "/var/lib/coda"

Expand Down Expand Up @@ -55,7 +55,7 @@ let load_from_s3 s3_bucket_prefix s3_install_path ~logger =
@@ Monitor.try_with ~here:[%here] (fun () ->
let each_uri (uri_string, file_path) =
let open Deferred.Let_syntax in
[%log trace] "Downloading file from S3"
[%log trace] "Downloading file from S3: $url to $local_file_path"
~metadata:
[ ("url", `String uri_string)
; ("local_file_path", `String file_path)
Expand Down

0 comments on commit e37a744

Please sign in to comment.