From 381fbb5fe148269032c4eade0ebe46ee3a4e15f5 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 9 Jan 2024 18:01:20 +0000 Subject: [PATCH] fix: unnecessary env var --- .../cpp/src/barretenberg/bb/get_bn254_crs.cpp | 1 + .../src/barretenberg/bb/get_grumpkin_crs.cpp | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp b/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp index 5f181f117ac..ad1facc840e 100644 --- a/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp @@ -7,6 +7,7 @@ std::vector download_bn254_g1_data(size_t num_points) std::string url = "https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/flat/g1.dat"; + // IMPORTANT: this currently uses a shell, DO NOT let user-controlled strings here. std::string command = "curl -s -H \"Range: bytes=0-" + std::to_string(g1_end) + "\" '" + url + "'"; auto data = exec_pipe(command); diff --git a/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp b/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp index 2d3394a498d..86b4e032097 100644 --- a/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp @@ -1,28 +1,13 @@ #include "get_grumpkin_crs.hpp" -// Gets the transcript URL from the BARRETENBERG_GRUMPKIN_TRANSCRIPT_URL environment variable, if set. -// Otherwise returns the default URL. -namespace { -std::string get_grumpkin_transcript_url() -{ - const char* ENV_VAR_NAME = "BARRETENBERG_GRUMPKIN_TRANSCRIPT_URL"; - const std::string DEFAULT_URL = "https://aztec-ignition.s3.amazonaws.com/TEST%20GRUMPKIN/monomial/transcript00.dat"; - - const char* env_url = std::getenv(ENV_VAR_NAME); - - auto environment_variable_exists = ((env_url != nullptr) && *env_url); - - return environment_variable_exists ? env_url : DEFAULT_URL; -} -} // namespace - std::vector download_grumpkin_g1_data(size_t num_points) { size_t g1_start = 28; size_t g1_end = g1_start + num_points * 64 - 1; - std::string url = get_grumpkin_transcript_url(); + std::string url = "https://aztec-ignition.s3.amazonaws.com/TEST%20GRUMPKIN/monomial/transcript00.dat"; + // IMPORTANT: this currently uses a shell, DO NOT let user-controlled strings here. std::string command = "curl -s -H \"Range: bytes=" + std::to_string(g1_start) + "-" + std::to_string(g1_end) + "\" '" + url + "'";