Skip to content

change download url#320

Merged
niconiconi merged 1 commit intomainfrom
hc/fix_ci_download
Feb 6, 2026
Merged

change download url#320
niconiconi merged 1 commit intomainfrom
hc/fix_ci_download

Conversation

@hczphn
Copy link
Contributor

@hczphn hczphn commented Feb 5, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hczphn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the infrastructure for fetching external data files by changing their download source from GitHub releases to a dedicated R2 storage service. This change centralizes the download URLs and refines the download utility to be more efficient and robust.

Highlights

  • Download URL Migration: The primary download source for circuit, witness, and proof files has been migrated from GitHub Releases to a new R2 storage bucket, improving download reliability and potentially performance.
  • New URL Prefix Constant: A new constant, URL_PREFIX, has been introduced to centralize the base URL for all external data downloads.
  • Refactored Download Logic: The download_and_store function has been enhanced to include a check for existing files, preventing unnecessary re-downloads. It now constructs full URLs using the new URL_PREFIX and has simplified error handling by consolidating download_and_store_required.
  • Streamlined Data Setup: The dev_env_data_setup function has been updated to use the refactored download_and_store function with the new relative paths, consolidating the download calls and removing the previous distinction between 'required' and 'optional' downloads.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • gkr/src/utils.rs
    • Added URL_PREFIX constant for the new R2 storage base URL.
    • Removed old GitHub release-related constants (TESTDATA_TAG, GITHUB_RELEASE_BASE, and all *_URL constants).
    • Modified download_and_store function to accept a URL path, prepend the URL_PREFIX, and include a check to skip download if the file already exists.
    • Removed the download_and_store_required function, integrating its assertion logic into the main download_and_store function.
    • Updated all calls within dev_env_data_setup to use the new download_and_store function with the updated relative paths for keccak circuits, witnesses, proofs, and poseidon circuits.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request changes the download URL for test data and refactors the download logic. The new implementation consolidates two download functions into one, but this changes the error handling for optional files, which will now cause a panic on failure. I've also suggested an improvement to make the command execution safer by avoiding bash -c. Overall, the changes are straightforward but the change in error handling should be reviewed to ensure it's intended.

Comment on lines +37 to 52
fn download_and_store(url_path: &str, file: &str) {
// Skip download if file already exists
if std::path::Path::new(file).exists() {
println!("File already exists, skipping download: {}", file);
return;
}
}

fn download_and_store_required(url: &str, file: &str) {
let url = format!("{}{}", URL_PREFIX, url_path);
let download = Command::new("bash")
.arg("-c")
.arg(format!("wget -L {url} -O {file}"))
.arg(format!("wget {} -O {}", url, file))
.output()
.expect("Failed to execute wget");
.expect("Failed to download circuit");

assert!(download.status.success(), "Required file download failed: {url}");
assert!(download.status.success(), "Circuit download failure: {}", url)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new download_and_store function consolidates the logic of the previous download_and_store and download_and_store_required functions. However, this new implementation will panic on any download failure, which was previously the behavior only for required files. Files that were considered optional (like Goldilocks and BabyBear circuits) will now cause the setup to fail if they cannot be downloaded. If all files are now guaranteed to be available at the new URL, this change is acceptable. Otherwise, you might want to consider re-introducing a non-panicking download variant for optional files.

Comment on lines 45 to +47
let download = Command::new("bash")
.arg("-c")
.arg(format!("wget -L {url} -O {file}"))
.arg(format!("wget {} -O {}", url, file))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using bash -c with a formatted string to execute commands can be risky as it can lead to shell injection vulnerabilities if the arguments are not properly sanitized. Although the url and file variables seem to be from controlled sources in this case, it's a best practice to avoid invoking a shell when possible. Passing arguments directly to Command::new("wget") is safer and more robust.

Suggested change
let download = Command::new("bash")
.arg("-c")
.arg(format!("wget -L {url} -O {file}"))
.arg(format!("wget {} -O {}", url, file))
let download = Command::new("wget").arg(&url).arg("-O").arg(file)

@niconiconi niconiconi merged commit d51080b into main Feb 6, 2026
0 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants