diff --git a/automation/terraform/modules/testnet-alerts/templates/testnet-alert-rules.yml.tpl b/automation/terraform/modules/testnet-alerts/templates/testnet-alert-rules.yml.tpl index 71d1e4d07e8..357d948b9b4 100644 --- a/automation/terraform/modules/testnet-alerts/templates/testnet-alert-rules.yml.tpl +++ b/automation/terraform/modules/testnet-alerts/templates/testnet-alert-rules.yml.tpl @@ -193,7 +193,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/LongFork-e65e5ad7437f4f4dbac201abbf9ace81" - alert: OldBestTip - expr: min by (testnet) ((time() - 1609459200) - Coda_Transition_frontier_best_tip_slot_time_sec ${rule_filter}) >= 15 * 180 + expr: min by (testnet) ((time() - 1717545600) - Coda_Transition_frontier_best_tip_slot_time_sec ${rule_filter}) >= 15 * 180 labels: testnet: "{{ $labels.testnet }}" severity: critical @@ -203,7 +203,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/OldBestTip-8afa955101b642bd8356edfd0b03b640" - alert: NoNewSnarks - expr: min by (testnet) ((time() - 1609459200) - Coda_Snark_work_useful_snark_work_received_time_sec ${rule_filter}) >= 2 * 180 and max by (testnet) (Coda_Snark_work_pending_snark_work ${rule_filter}) != 0 + expr: min by (testnet) ((time() - 1717545600) - Coda_Snark_work_useful_snark_work_received_time_sec ${rule_filter}) >= 2 * 180 and max by (testnet) (Coda_Snark_work_pending_snark_work ${rule_filter}) != 0 labels: testnet: "{{ $labels.testnet }}" severity: critical @@ -213,7 +213,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/NoNewSnarks-f86d27c81af54954b2fb61378bff9d4d" - alert: NoNewTransactions - expr: min by (testnet) ((time() - 1609459200) - Coda_Transaction_pool_useful_transactions_received_time_sec ${rule_filter}) >= 2 * 180 + expr: min by (testnet) ((time() - 1717545600) - Coda_Transaction_pool_useful_transactions_received_time_sec ${rule_filter}) >= 2 * 180 labels: testnet: "{{ $labels.testnet }}" severity: warning @@ -269,7 +269,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/HighBlockGossipLatency-2096501c7cf34032b44e903ec1a4d79c" - alert: SomewhatOldBestTip - expr: count by (testnet) (((time() - 1609459200) - Coda_Transition_frontier_best_tip_slot_time_sec ${rule_filter}) >= 8 * 180) > 1 + expr: count by (testnet) (((time() - 1717545600) - Coda_Transition_frontier_best_tip_slot_time_sec ${rule_filter}) >= 8 * 180) > 1 labels: testnet: "{{ $labels.testnet }}" severity: warning @@ -580,7 +580,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/LongFork-e65e5ad7437f4f4dbac201abbf9ace81" - alert: OldBestTip - expr: min by (testnet) ((time() - 1609459200) - Coda_Transition_frontier_best_tip_slot_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 15 * 180 + expr: min by (testnet) ((time() - 1717545600) - Coda_Transition_frontier_best_tip_slot_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 15 * 180 labels: testnet: "{{ $labels.testnet }}" severity: critical @@ -590,7 +590,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/OldBestTip-8afa955101b642bd8356edfd0b03b640" - alert: NoNewSnarks - expr: min by (testnet) ((time() - 1609459200) - Coda_Snark_work_useful_snark_work_received_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 2 * 180 and max by (testnet) (Coda_Snark_work_pending_snark_work {${berkeley_testnet},${synced_status_filter}} ) != 0 + expr: min by (testnet) ((time() - 1717545600) - Coda_Snark_work_useful_snark_work_received_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 2 * 180 and max by (testnet) (Coda_Snark_work_pending_snark_work {${berkeley_testnet},${synced_status_filter}} ) != 0 labels: testnet: "{{ $labels.testnet }}" severity: critical @@ -600,7 +600,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/NoNewSnarks-f86d27c81af54954b2fb61378bff9d4d" - alert: NoNewTransactions - expr: min by (testnet) ((time() - 1609459200) - Coda_Transaction_pool_useful_transactions_received_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 2 * 180 + expr: min by (testnet) ((time() - 1717545600) - Coda_Transaction_pool_useful_transactions_received_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 2 * 180 labels: testnet: "{{ $labels.testnet }}" severity: warning @@ -650,7 +650,7 @@ groups: runbook: "https://www.notion.so/minaprotocol/HighBlockGossipLatency-2096501c7cf34032b44e903ec1a4d79c" - alert: SomewhatOldBestTip - expr: count by (testnet) (((time() - 1609459200) - Coda_Transition_frontier_best_tip_slot_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 8 * 180) > 1 + expr: count by (testnet) (((time() - 1717545600) - Coda_Transition_frontier_best_tip_slot_time_sec {${berkeley_testnet},${synced_status_filter}} ) >= 8 * 180) > 1 labels: testnet: "{{ $labels.testnet }}" severity: warning diff --git a/buildkite/scripts/rosetta-integration-tests.sh b/buildkite/scripts/rosetta-integration-tests.sh index 388c7e37f15..e9219071677 100755 --- a/buildkite/scripts/rosetta-integration-tests.sh +++ b/buildkite/scripts/rosetta-integration-tests.sh @@ -93,8 +93,8 @@ cat <"$MINA_CONFIG_FILE" { "genesis": { "genesis_state_timestamp": "$CURRENT_TIME" }, "proof": { "block_window_duration_ms": 20000 }, + "daemon": { "network_id": "${MINA_NETWORK}" }, "ledger": { - "name": "${MINA_NETWORK}", "accounts": [ { "pk": "${BLOCK_PRODUCER_PUB_KEY}", "balance": "1000000", "delegate": null, "sk": null }, { "pk": "${SNARK_PRODUCER_PK}", "balance": "2000000", "delegate": "${BLOCK_PRODUCER_PUB_KEY}", "sk": null }, diff --git a/buildkite/src/Command/RunInToolchain.dhall b/buildkite/src/Command/RunInToolchain.dhall index 9068bad4843..60c2b7444a1 100644 --- a/buildkite/src/Command/RunInToolchain.dhall +++ b/buildkite/src/Command/RunInToolchain.dhall @@ -37,7 +37,6 @@ let runInToolchainBuster : List Text -> Text -> List Cmd.Type = \(innerScript : Text) -> runInToolchainImage ContainerImages.minaToolchainBuster environment innerScript - let runInToolchain : List Text -> Text -> List Cmd.Type = \(environment : List Text) -> \(innerScript : Text) -> diff --git a/docs/upgrading-to-berkeley.md b/docs/upgrading-to-berkeley.md index 14e28e4547b..02fe4275262 100644 --- a/docs/upgrading-to-berkeley.md +++ b/docs/upgrading-to-berkeley.md @@ -63,6 +63,7 @@ done ## Verifying packaged configuration + A script is installed (from `./scripts/mina-verify-packaged-fork-config`) that automates this process. If you want to verify that an installed Mina package was generated from the same configuration as the one exported earlier, it is as easy as: ``` @@ -70,3 +71,65 @@ mina-verify-packaged-fork-config (mainnet|devnet) fork_config.json /tmp/mina-ver ``` Many of the script inputs are environment variables that default to the locations used by the debs. If you are building from source, inspect the script, determine what you need to change, and then run it. + +Here are some general instructions that should help you get most of the way there. + +### Package Verification + +#### Environment Setup +1. **Use a Debian Environment:** + - It is recommended to perform package verification in a Debian environment because macOS Intel emulation doesn’t support the required AVX instructions for libp2p. + +2. **Environment Preparation:** + - **Install mina-create-legacy-genesis** + ```bash + echo "deb [trusted=yes] http://packages.o1test.net bullseye stable" > /etc/apt/sources.list.d/o1.list + apt-get update + apt-get install mina-create-legacy-genesis=1.4.1-97f7d8c + + - **Direct Installation Script:** + - ***NOTE this currently needs to be run as root*** + ``` bash + #!/bin/bash + export CONFIG_JSON_GZ_URL="https://storage.googleapis.com/tmp-hardfork-testing/fork-config-3NLRTfY4kZyJtvaP4dFenDcxfoMfT3uEpkWS913KkeXLtziyVd15.json.gz" + export GENESIS_TIMESTAMP="2024-06-05T00:00:00Z" + export NETWORK_NAME="mainnet" + mkdir -p genesis_ledgers + cp /var/lib/coda/config_93e02797.json genesis_ledgers/mainnet.json + curl https://storage.googleapis.com/tmp-hardfork-testing/fork-config-3NLRTfY4kZyJtvaP4dFenDcxfoMfT3uEpkWS913KkeXLtziyVd15.json.gz > config.json.gz && gunzip config.json.gz && mina-verify-packaged-fork-config mainnet config.json /workdir/verification + ``` + +- **Prepare Environment Variables:** Set up the necessary environment variables manually to match the expected configuration for verification. +- **Create `genesis_ledgers` Directory:** Temporarily, create a new directory named `genesis_ledgers` in the working directory and place the daemon config for the required chain, typically `mainnet.json` there. Alternatively, make sure that `genesis_ledgers/mainnet.json` is present. The script assumes that it is running in a directory where this is present. + + +3. **Set Environment Variables:** + - **GSUTIL Path:** + ```bash + export GSUTIL=/usr/bin/gsutil + ``` + - **Download Block Data:** + - Example command to download the block data: + ```bash + gsutil cp gs://mina_network_block_data/mainnet-.json ./block_data.json + export PRECOMPUTED_FORK_BLOCK=./block_data.json + ``` + - **Verify Additional Variables:** + - Confirm the following variables are properly set: + ```bash + CONFIG_JSON_GZ_URL= ex: "https://storage.googleapis.com/fork-config-dryrun.json.gz" + GENESIS_TIMESTAMP= ex: "2024-05-03T00:00:00Z" + NETWORK_NAME= ex: mainnet + PRECOMPUTED_BLOCK_GS_PREFIX= ex: "gs://mina_network_block_data/mainnet" + ``` + +#### Verification Process +1. **Run the Verification Command:** + - If the fork config is not already on your machine, you can download it with a command similiar to: + ```bash + curl https://storage.googleapis.com/fork-config-dryrun.json.gz > config.json.gz && gunzip config.json.gz && mina-verify-packaged-fork-config mainnet config.json /workdir/verification gs://mina_network_block_data/mainnet-pre-hf-dry-run-2 + ``` + - If the fork config is already available locally, use: + ```bash + mina-verify-packaged-fork-config mainnet fork-config-dryrun.json /tmp/mina-verification + ``` diff --git a/scripts/hardfork/build-and-test.sh b/scripts/hardfork/build-and-test.sh index 122b227d825..37f12f99f15 100755 --- a/scripts/hardfork/build-and-test.sh +++ b/scripts/hardfork/build-and-test.sh @@ -93,10 +93,10 @@ if [[ $# -gt 0 ]]; then git submodule sync --recursive git submodule update --init --recursive fi -git apply "$SCRIPT_DIR"/localnet-patches/berkeley-{1,2}.patch +git apply "$SCRIPT_DIR"/localnet-patches/berkeley.patch nix "${NIX_OPTS[@]}" build "$INIT_DIR?submodules=1#devnet" --out-link "$INIT_DIR/fork-devnet" nix "${NIX_OPTS[@]}" build "$INIT_DIR?submodules=1#devnet.genesis" --out-link "$INIT_DIR/fork-devnet" -git apply -R "$SCRIPT_DIR"/localnet-patches/berkeley-{1,2}.patch +git apply -R "$SCRIPT_DIR"/localnet-patches/berkeley.patch if [[ "$NIX_CACHE_GCP_ID" != "" ]] && [[ "$NIX_CACHE_GCP_SECRET" != "" ]]; then mkdir -p $HOME/.aws diff --git a/scripts/hardfork/localnet-patches/berkeley-2.patch b/scripts/hardfork/localnet-patches/berkeley-2.patch deleted file mode 100644 index 6d86229a0a7..00000000000 --- a/scripts/hardfork/localnet-patches/berkeley-2.patch +++ /dev/null @@ -1,87 +0,0 @@ -From b417566203405ae0aca76cbbfbf5faf4f71395ef Mon Sep 17 00:00:00 2001 -From: georgeee -Date: Fri, 16 Feb 2024 19:39:22 +0100 -Subject: [PATCH 3/3] Cache loaded caches in Ledger.load - -Problem: when load of a ledger file is attempted twice, error comes from -Rocksdb locking mechanism - -Solution: use simple cache map when loading epoch ledgers, using -previously loaded ledgers. ---- - .../genesis_ledger_helper.ml | 21 +++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - -diff --git a/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml b/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml -index b98c35465d..7c44c9d3df 100644 ---- a/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml -+++ b/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml -@@ -411,6 +411,7 @@ module Ledger = struct - end) ) - - let load ~proof_level ~genesis_dir ~logger ~constraint_constants -+ ?(ledger_cache = String.Map.empty) - ?(ledger_name_prefix = "genesis_ledger") (config : Runtime_config.Ledger.t) - = - Monitor.try_with_join_or_error ~here:[%here] (fun () -> -@@ -424,6 +425,9 @@ module Ledger = struct - ~ledger_name_prefix config - in - match tar_path with -+ | Some tar_path when Map.mem ledger_cache tar_path -> -+ Deferred.Result.return -+ (Map.find_exn ledger_cache tar_path, config, tar_path) - | Some tar_path -> ( - match%map - load_from_tar ~genesis_dir ~logger ~constraint_constants -@@ -552,6 +556,7 @@ end - - module Epoch_data = struct - let load ~proof_level ~genesis_dir ~logger ~constraint_constants -+ ?(ledger_cache = String.Map.empty) - (config : Runtime_config.Epoch_data.t option) = - let open Deferred.Or_error.Let_syntax in - match config with -@@ -559,13 +564,13 @@ module Epoch_data = struct - Deferred.Or_error.return (None, None) - | Some config -> - let ledger_name_prefix = "epoch_ledger" in -- let load_ledger ledger = -+ let load_ledger ~ledger_cache ledger = - Ledger.load ~proof_level ~genesis_dir ~logger ~constraint_constants -- ~ledger_name_prefix ledger -+ ~ledger_name_prefix ~ledger_cache ledger - in -- let%bind staking, staking_config = -+ let%bind staking, staking_config, ledger_cache = - let%map staking_ledger, config', ledger_file = -- load_ledger config.staking.ledger -+ load_ledger ~ledger_cache config.staking.ledger - in - [%log trace] "Loaded staking epoch ledger from $ledger_file" - ~metadata:[ ("ledger_file", `String ledger_file) ] ; -@@ -573,7 +578,9 @@ module Epoch_data = struct - Genesis_ledger.Packed.t staking_ledger - ; seed = Epoch_seed.of_base58_check_exn config.staking.seed - } -- , { config.staking with ledger = config' } ) -+ , { config.staking with ledger = config' } -+ , Map.add ledger_cache ~key:ledger_file ~data:staking_ledger -+ |> function `Duplicate -> ledger_cache | `Ok m -> m ) - in - let%map next, next_config = - match config.next with -@@ -583,7 +590,9 @@ module Epoch_data = struct - epoch ledger" ; - Deferred.Or_error.return (None, None) - | Some { ledger; seed } -> -- let%map next_ledger, config'', ledger_file = load_ledger ledger in -+ let%map next_ledger, config'', ledger_file = -+ load_ledger ~ledger_cache ledger -+ in - [%log trace] "Loaded next epoch ledger from $ledger_file" - ~metadata:[ ("ledger_file", `String ledger_file) ] ; - ( Some --- -2.18.1 - diff --git a/scripts/hardfork/localnet-patches/berkeley-1.patch b/scripts/hardfork/localnet-patches/berkeley.patch similarity index 61% rename from scripts/hardfork/localnet-patches/berkeley-1.patch rename to scripts/hardfork/localnet-patches/berkeley.patch index 17446bbcf2b..843b52a6a0f 100644 --- a/scripts/hardfork/localnet-patches/berkeley-1.patch +++ b/scripts/hardfork/localnet-patches/berkeley.patch @@ -1,21 +1,29 @@ +From 6a234e647cc7fcbb8e29dc1ce7264b89b93d034f Mon Sep 17 00:00:00 2001 +From: ember arlynx +Date: Wed, 27 Mar 2024 23:21:59 -0400 +Subject: [PATCH] this combines two patches from georgee + From 4b7d18c23f5cd22c2e3e2d979a7fafe8df4b1d93 Mon Sep 17 00:00:00 2001 From: georgeee Date: Wed, 7 Feb 2024 11:35:27 +0100 Subject: [PATCH 2/3] Propagate logging settings to snark worker ---- - .../src/cli_entrypoint/mina_cli_entrypoint.ml | 7 +++-- - src/lib/mina_lib/config.ml | 3 ++ - src/lib/mina_lib/mina_lib.ml | 14 ++++++--- - src/lib/snark_worker/functor.ml | 31 +++++++++++++------ - src/lib/snark_worker/intf.ml | 4 +++ - 5 files changed, 41 insertions(+), 18 deletions(-) +From b417566203405ae0aca76cbbfbf5faf4f71395ef Mon Sep 17 00:00:00 2001 +From: georgeee +Date: Fri, 16 Feb 2024 19:39:22 +0100 +Subject: [PATCH 3/3] Cache loaded caches in Ledger.load + +Problem: when load of a ledger file is attempted twice, error comes from +Rocksdb locking mechanism + +Solution: use simple cache map when loading epoch ledgers, using +previously loaded ledgers. diff --git a/src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml b/src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml -index 92729756e5..88e30c7b4f 100644 +index 3349abd2e6..4cd717e25c 100644 --- a/src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml +++ b/src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml -@@ -1364,9 +1364,10 @@ Pass one of -peer, -peer-list-file, -seed, -peer-list-url.|} ; +@@ -1368,9 +1368,10 @@ Pass one of -peer, -peer-list-file, -seed, -peer-list-url.|} ; let%map mina = Mina_lib.create ~wallets (Mina_lib.Config.make ~logger ~pids ~trust_system ~conf_dir @@ -29,11 +37,85 @@ index 92729756e5..88e30c7b4f 100644 ~work_selection_method: (Cli_lib.Arg_type.work_selection_method_to_module work_selection_method ) +diff --git a/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml b/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml +index 20b64dcbf1..22fe459be9 100644 +--- a/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml ++++ b/src/lib/genesis_ledger_helper/genesis_ledger_helper.ml +@@ -433,8 +433,9 @@ module Ledger = struct + end) ) + + let load ~proof_level ~genesis_dir ~logger ~constraint_constants +- ?(ledger_name_prefix = "genesis_ledger") ?overwrite_version +- (config : Runtime_config.Ledger.t) = ++ ?(ledger_cache = String.Map.empty) ?overwrite_version ++ ?(ledger_name_prefix = "genesis_ledger") (config : Runtime_config.Ledger.t) ++ = + Monitor.try_with_join_or_error ~here:[%here] (fun () -> + let padded_accounts_opt = + padded_accounts_from_runtime_config_opt ~logger ~proof_level +@@ -446,6 +447,9 @@ module Ledger = struct + ~ledger_name_prefix config + in + match tar_path with ++ | Some tar_path when Map.mem ledger_cache tar_path -> ++ Deferred.Result.return ++ (Map.find_exn ledger_cache tar_path, config, tar_path) + | Some tar_path -> ( + match%map + load_from_tar ~genesis_dir ~logger ~constraint_constants +@@ -574,6 +578,7 @@ end + + module Epoch_data = struct + let load ~proof_level ~genesis_dir ~logger ~constraint_constants ++ ?(ledger_cache = String.Map.empty) + (config : Runtime_config.Epoch_data.t option) = + let open Deferred.Or_error.Let_syntax in + match config with +@@ -581,13 +586,13 @@ module Epoch_data = struct + Deferred.Or_error.return (None, None) + | Some config -> + let ledger_name_prefix = "epoch_ledger" in +- let load_ledger ledger = ++ let load_ledger ~ledger_cache ledger = + Ledger.load ~proof_level ~genesis_dir ~logger ~constraint_constants +- ~ledger_name_prefix ledger ++ ~ledger_name_prefix ~ledger_cache ledger + in +- let%bind staking, staking_config = ++ let%bind staking, staking_config, ledger_cache = + let%map staking_ledger, config', ledger_file = +- load_ledger config.staking.ledger ++ load_ledger ~ledger_cache config.staking.ledger + in + [%log trace] "Loaded staking epoch ledger from $ledger_file" + ~metadata:[ ("ledger_file", `String ledger_file) ] ; +@@ -595,7 +600,9 @@ module Epoch_data = struct + Genesis_ledger.Packed.t staking_ledger + ; seed = Epoch_seed.of_base58_check_exn config.staking.seed + } +- , { config.staking with ledger = config' } ) ++ , { config.staking with ledger = config' } ++ , Map.add ledger_cache ~key:ledger_file ~data:staking_ledger ++ |> function `Duplicate -> ledger_cache | `Ok m -> m ) + in + let%map next, next_config = + match config.next with +@@ -605,7 +612,9 @@ module Epoch_data = struct + epoch ledger" ; + Deferred.Or_error.return (None, None) + | Some { ledger; seed } -> +- let%map next_ledger, config'', ledger_file = load_ledger ledger in ++ let%map next_ledger, config'', ledger_file = ++ load_ledger ~ledger_cache ledger ++ in + [%log trace] "Loaded next epoch ledger from $ledger_file" + ~metadata:[ ("ledger_file", `String ledger_file) ] ; + ( Some diff --git a/src/lib/mina_lib/config.ml b/src/lib/mina_lib/config.ml -index 330d8c2a0b..6d35f16747 100644 +index 22d622d98b..1dce50970b 100644 --- a/src/lib/mina_lib/config.ml +++ b/src/lib/mina_lib/config.ml -@@ -60,5 +60,8 @@ type t = +@@ -61,5 +61,8 @@ type t = ; uptime_send_node_commit : bool [@default false] ; stop_time : int ; graphql_control_port : int option [@default None] @@ -43,7 +125,7 @@ index 330d8c2a0b..6d35f16747 100644 } [@@deriving make] diff --git a/src/lib/mina_lib/mina_lib.ml b/src/lib/mina_lib/mina_lib.ml -index 51554522f3..2b2d6b86ce 100644 +index 2f192f3835..cb25cae041 100644 --- a/src/lib/mina_lib/mina_lib.ml +++ b/src/lib/mina_lib/mina_lib.ml @@ -177,7 +177,8 @@ let log_snark_coordinator_warning (config : Config.t) snark_worker = @@ -155,6 +237,3 @@ index e36b146ab0..c71b22656a 100644 -> string list end --- -2.18.1 - diff --git a/src/lib/genesis_ledger_helper/lib/genesis_ledger_helper_lib.ml b/src/lib/genesis_ledger_helper/lib/genesis_ledger_helper_lib.ml index 9d8e16cfcab..6438ba26eba 100644 --- a/src/lib/genesis_ledger_helper/lib/genesis_ledger_helper_lib.ml +++ b/src/lib/genesis_ledger_helper/lib/genesis_ledger_helper_lib.ml @@ -634,6 +634,7 @@ let runtime_config_of_precomputed_values (precomputed_values : Genesis_proof.t) Some precomputed_values.genesis_constants.zkapp_cmd_limit_hardcap ; slot_tx_end = None ; slot_chain_end = None + ; network_id = None } ; genesis = Some diff --git a/src/lib/integration_test_cloud_engine/mina_automation.ml b/src/lib/integration_test_cloud_engine/mina_automation.ml index fe5a7bc45c9..a28e3cd961a 100644 --- a/src/lib/integration_test_cloud_engine/mina_automation.ml +++ b/src/lib/integration_test_cloud_engine/mina_automation.ml @@ -129,6 +129,7 @@ module Network_config = struct ; txpool_max_size ; slot_tx_end ; slot_chain_end + ; network_id } : Test_config.t ) = test_config @@ -242,6 +243,7 @@ module Network_config = struct ; zkapp_cmd_limit_hardcap = None ; slot_tx_end ; slot_chain_end + ; network_id } ; genesis = Some diff --git a/src/lib/integration_test_lib/test_config.ml b/src/lib/integration_test_lib/test_config.ml index a86c367d94c..017a517e25a 100644 --- a/src/lib/integration_test_lib/test_config.ml +++ b/src/lib/integration_test_lib/test_config.ml @@ -80,6 +80,7 @@ type t = ; txpool_max_size : int ; slot_tx_end : int option ; slot_chain_end : int option + ; network_id : string option } let proof_config_default : Runtime_config.Proof_keys.t = @@ -130,6 +131,7 @@ let default = ; txpool_max_size = 3000 ; slot_tx_end = None ; slot_chain_end = None + ; network_id = None } let transaction_capacity_log_2 (config : t) = diff --git a/src/lib/integration_test_local_engine/mina_docker.ml b/src/lib/integration_test_local_engine/mina_docker.ml index e5b4b24d6cb..6eaf4316e23 100644 --- a/src/lib/integration_test_local_engine/mina_docker.ml +++ b/src/lib/integration_test_local_engine/mina_docker.ml @@ -67,6 +67,7 @@ module Network_config = struct ; txpool_max_size ; slot_tx_end ; slot_chain_end + ; network_id ; _ } : Test_config.t ) = @@ -166,6 +167,7 @@ module Network_config = struct ; zkapp_cmd_limit_hardcap = None ; slot_tx_end ; slot_chain_end + ; network_id } ; genesis = Some diff --git a/src/lib/mina_graphql/mina_graphql.ml b/src/lib/mina_graphql/mina_graphql.ml index 3a450cb849a..ea9cd08a4fc 100644 --- a/src/lib/mina_graphql/mina_graphql.ml +++ b/src/lib/mina_graphql/mina_graphql.ml @@ -2569,8 +2569,8 @@ module Queries = struct let configured_name = let open Option.Let_syntax in let cfg = Mina_lib.runtime_config mina in - let%bind ledger = cfg.ledger in - ledger.name + let%bind daemon = cfg.daemon in + daemon.network_id in "mina:" ^ Option.value ~default:Mina_compile_config.network_id configured_name diff --git a/src/lib/mina_version/normal/gen.sh b/src/lib/mina_version/normal/gen.sh index ad34bfa5b6c..1e2442b10c0 100755 --- a/src/lib/mina_version/normal/gen.sh +++ b/src/lib/mina_version/normal/gen.sh @@ -9,7 +9,6 @@ root="${MINA_ROOT-$(git rev-parse --show-toplevel || echo ../../../../../..)}" pushd "$root" > /dev/null id="${MINA_COMMIT_SHA1-$(git rev-parse --verify HEAD || echo "")}" commit_id_short="$(printf "%s" "$id" | cut -c1-8)" - if [[ -e .git ]] && ! git diff --quiet; then id="[DIRTY]$id"; fi commit_date="${MINA_COMMIT_DATE-$(git show HEAD -s --format="%cI" || echo "")}" mina_submodule=$(git submodule status | grep "mina" || true) @@ -20,7 +19,6 @@ pushd "$root" > /dev/null fi marlin_commit_id="${MARLIN_COMMIT_ID-$(git rev-parse --verify HEAD || echo "")}" marlin_commit_id_short="$(printf '%s' "$marlin_commit_id" | cut -c1-8)" - if [[ -e .git ]] && ! git diff --quiet; then marlin_commit_id="[DIRTY]$marlin_commit_id"; fi marlin_commit_date="${MARLIN_COMMIT_DATE-$(git show HEAD -s --format="%cI" || echo "")}" popd > /dev/null popd > /dev/null diff --git a/src/lib/runtime_config/runtime_config.ml b/src/lib/runtime_config/runtime_config.ml index 56d3db0e972..697567340b7 100644 --- a/src/lib/runtime_config/runtime_config.ml +++ b/src/lib/runtime_config/runtime_config.ml @@ -473,6 +473,7 @@ module Json_layout = struct ; zkapp_cmd_limit_hardcap : int option [@default None] ; slot_tx_end : int option [@default None] ; slot_chain_end : int option [@default None] + ; network_id : string option [@default None] } [@@deriving yojson, fields] @@ -1220,6 +1221,7 @@ module Daemon = struct ; zkapp_cmd_limit_hardcap : int option [@default None] ; slot_tx_end : int option [@default None] ; slot_chain_end : int option [@default None] + ; network_id : string option [@default None] } [@@deriving bin_io_unversioned] @@ -1259,6 +1261,7 @@ module Daemon = struct ; slot_tx_end = opt_fallthrough ~default:t1.slot_tx_end t2.slot_tx_end ; slot_chain_end = opt_fallthrough ~default:t1.slot_chain_end t2.slot_chain_end + ; network_id = opt_fallthrough ~default:t1.network_id t2.network_id } let gen = @@ -1282,6 +1285,7 @@ module Daemon = struct ; zkapp_cmd_limit_hardcap = Some zkapp_cmd_limit_hardcap ; slot_tx_end = None ; slot_chain_end = None + ; network_id = None } end