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

PM-859 update networks with mina-daemon:2.0.0rampup7-4a0fff9 #96

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 35 additions & 0 deletions scripts/update_mina.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# This script is used to update the mina daemon and archive node version in the project.
# Usage:
# 1. Update the variables below to the desired versions
# 2. ./scripts/update_mina.sh

daemon_old="gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley"
daemon_new="gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley"

archive_old="gcr.io/o1labs-192920/mina-archive:2.0.0rampup6-4061884-bullseye"
archive_new="gcr.io/o1labs-192920/mina-archive:2.0.0rampup7-4a0fff9-bullseye"

commit_old="4061884"
commit_new="4a0fff9"

escape_slashes() {
echo "$1" | sed 's_/_\\/_g'
}

daemon_old_escaped=$(escape_slashes "$daemon_old")
daemon_new_escaped=$(escape_slashes "$daemon_new")
archive_old_escaped=$(escape_slashes "$archive_old")
archive_new_escaped=$(escape_slashes "$archive_new")

# Function to generate the sed command
generate_sed_command() {
echo "sed -i 's|$1|$2|g;s|$3|$4|g;s|$5|$6|g' \$1"
}

# Generate the sed command
sed_command=$(generate_sed_command "$daemon_old_escaped" "$daemon_new_escaped" "$archive_old_escaped" "$archive_new_escaped" "$commit_old" "$commit_new")

# Apply replacements in files under 'src' and 'tests' directories
find "./src" -type f -exec bash -c "$sed_command" bash {} \;
find "./tests" -type f -exec bash -c "$sed_command" bash {} \;
10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ const LEAST_COMPOSE_VERSION: &str = "2.21.0";

// Hardcoded daemon image for default network
const DEFAULT_DAEMON_DOCKER_IMAGE: &str =
"gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley";
"gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley";

// Hardcoded archive image for default network
const DEFAULT_ARCHIVE_DOCKER_IMAGE: &str =
"gcr.io/o1labs-192920/mina-archive:2.0.0rampup6-4061884-bullseye";
"gcr.io/o1labs-192920/mina-archive:2.0.0rampup7-4a0fff9-bullseye";

const IMAGE_COMMIT_HASH: &str = "4a0fff9";

// Timeout in seconds for waiting operations
const TIMEOUT_IN_SECS: u16 = 180;
Expand Down Expand Up @@ -889,8 +891,8 @@ fn generate_default_topology(
peers: Some(vec![peer]),
archive_docker_image: Some(docker_image_archive.into()),
archive_schema_files: Some(vec![
"https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/zkapp_tables.sql".into(),
"https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/create_schema.sql".into(),
format!("https://raw.githubusercontent.com/MinaProtocol/mina/{IMAGE_COMMIT_HASH}/src/app/archive/zkapp_tables.sql"),
format!("https://raw.githubusercontent.com/MinaProtocol/mina/{IMAGE_COMMIT_HASH}/src/app/archive/create_schema.sql"),
simisimis marked this conversation as resolved.
Show resolved Hide resolved
]),
archive_port: Some(3086),
..Default::default()
Expand Down
22 changes: 11 additions & 11 deletions tests/data/large_network/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"pk": "B62qqYWdCfrjEznYNc7fsve5Rk5wuho9KwZa2bntKZBdshz1M6RsBna",
"sk": "EKERBeqQE7GLuD9xtCBCGYNAyXpYX8UnXBTkg6rbvwT2LKPYiDdF",
"role": "Snark_coordinator",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"worker_nodes": 2,
"snark_worker_fee": "0.0001",
Expand All @@ -26,12 +26,12 @@
"pk": "B62qjw6nhuPRERVeUwwEdT7KAcEg7D8pUiKdDmf7Ny1W7utcq9UKw1q",
"sk": "EKFbpuwm2ALsgDXy7NSpmEaDF62W6ULMSzdV8haSCaHeizFCHcDm",
"role": "Archive_node",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"archive_image": "gcr.io/o1labs-192920/mina-archive:2.0.0rampup6-4061884-bullseye",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"archive_image": "gcr.io/o1labs-192920/mina-archive:2.0.0rampup7-4a0fff9-bullseye",
"git_build": null,
"schema_files": [
"https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/create_schema.sql",
"https://raw.githubusercontent.com/MinaProtocol/mina/4061884b18137c1182c7fcfa80f52804008a2509/src/app/archive/zkapp_tables.sql"
"https://raw.githubusercontent.com/MinaProtocol/mina/4a0fff9/src/app/archive/create_schema.sql",
"https://raw.githubusercontent.com/MinaProtocol/mina/4a0fff9/src/app/archive/zkapp_tables.sql"
],
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/archive_node.json",
Expand All @@ -53,7 +53,7 @@
"sk": "EKF4pbSdHbXjSXJLWhcgqH3gLzcihNH7uxhxpsoB74JabufNT2p2",
"privkey_path": "./tests/data/large_network/block_producer_keys/receiver.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/receiver.json",
Expand All @@ -75,7 +75,7 @@
"sk": "EKEDFANcgihUz6X8kkZKoB1VNr38zJUaCDYbtbaarKbpMKzCKuH1",
"privkey_path": "./tests/data/large_network/block_producer_keys/empty_node-1.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/empty_node-1.json",
Expand All @@ -97,7 +97,7 @@
"sk": "EKEDFANcgihUz6X8kkZKoB1VNr38zJUaCDYbtbaarKbpMKzCKuH1",
"privkey_path": "./tests/data/large_network/block_producer_keys/empty_node-2.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/empty_node-2.json",
Expand All @@ -119,7 +119,7 @@
"sk": "EKEDFANcgihUz6X8kkZKoB1VNr38zJUaCDYbtbaarKbpMKzCKuH1",
"privkey_path": "./tests/data/large_network/block_producer_keys/observer.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/observer.json",
Expand All @@ -141,7 +141,7 @@
"sk": "EKEmQoyTKdFqKuAz58jA7iAM8UKAzuyfPFKcjFQavCBVgYWC8y2Y",
"privkey_path": null,
"role": "Seed_node",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/seed-0.json",
Expand All @@ -163,7 +163,7 @@
"sk": "EKDmEM9PvTrwD2AwB1qsSqWwyzf7ZVawzVxk4xwXG5XYRxhGiQdy",
"privkey_path": null,
"role": "Seed_node",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/large_network/libp2p_keys/seed-1.json",
Expand Down
4 changes: 2 additions & 2 deletions tests/data/small_network/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"sk": "EKFFrQVB9tmtHVxAGBqvZYUy9Wm2e5ERwNh4dgZpjyLsT6nfpmPS",
"privkey_path": "./tests/data/small_network/block_producer_keys/receiver.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/small_network/libp2p_keys/receiver.json",
Expand All @@ -26,7 +26,7 @@
"sk": "EKDyUS6K9wkVGiYrvJhtZHSMjeW4JEMiWCXGNco4ZEkbMN9qSeQk",
"privkey_path": null,
"role": "Seed_node",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/small_network/libp2p_keys/seed-0.json",
Expand Down
10 changes: 5 additions & 5 deletions tests/data/uptime_service_network/topology.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"pk": "B62qjwzawZqMmm27zwDg5xF8XtrH1TcQedsS3EVStct8wr1FcpRZFbm",
"sk": "EKFBPN3My4Y5GqaYj9pMYvtfzvrzuSQyvTEgxTZmCx4QZg7vJePB",
"role": "Snark_coordinator",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"worker_nodes": 1,
"snark_worker_fee": "0.0001",
Expand All @@ -27,7 +27,7 @@
"sk": "EKF83r3ibZ8eCC1PwcgrTAVLVoA3dKXt2iSGxb6vDnofs9nKUY3V",
"privkey_path": "./tests/data/uptime_service_network/block_producer_keys/node-a.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/node-a.json",
Expand All @@ -49,7 +49,7 @@
"sk": "EKF5AkJQX1B6CgmmaXgsyw4tZFp1M27TRcJrzw67Mtnp7o45rEvv",
"privkey_path": "./tests/data/uptime_service_network/block_producer_keys/node-b.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/node-b.json",
Expand All @@ -71,7 +71,7 @@
"sk": "EKF44LaJVQKTT1iuSJ3XifSFFtBndMb741kHPzVcYAtYEyJbZ11s",
"privkey_path": "./tests/data/uptime_service_network/block_producer_keys/node-c.json",
"role": "Block_producer",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/node-c.json",
Expand Down Expand Up @@ -99,7 +99,7 @@
"sk": "EKEFB6NduHXqgGUkSSe1TFf1SCpn1SDrJtAcRJiHd4zaks4X5GrD",
"privkey_path": null,
"role": "Seed_node",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup6-4061884-bullseye-berkeley",
"docker_image": "gcr.io/o1labs-192920/mina-daemon:2.0.0rampup7-4a0fff9-bullseye-berkeley",
"git_build": null,
"libp2p_pass": "naughty blue worm",
"libp2p_keyfile": "./tests/data/uptime_service_network/libp2p_keys/default-seed.json",
Expand Down