Skip to content
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ clean: ## Clean build artifacts
.PHONY: download-circuits
download-circuits: ## Download the circuits used by Mina from GitHub
@if [ ! -d "circuit-blobs" ]; then \
git clone --depth 1 https://github.com/openmina/circuit-blobs.git; \
git clone --depth 1 https://github.com/o1-labs/circuit-blobs.git; \
ln -s "$$PWD"/circuit-blobs/3.0.0mainnet ledger/; \
ln -s "$$PWD"/circuit-blobs/3.0.1devnet ledger/; \
else \
Expand Down
22 changes: 11 additions & 11 deletions ledger/src/proofs/circuit_blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This module handles circuit constraint extraction for the Mina Rust node.
//! Circuit constraints are sourced from the
//! [circuit-blobs](https://github.com/openmina/circuit-blobs) repository, which
//! [circuit-blobs](https://github.com/o1-labs/circuit-blobs) repository, which
//! contains pre-compiled circuit data generated by the OCaml implementation.
//!
//! ## Overview
Expand Down Expand Up @@ -45,15 +45,15 @@
//!
//! 1. **Environment Variable**: `MINA_CIRCUIT_BLOBS_BASE_DIR`
//! 2. **Cargo Manifest Directory**: Current project directory
//! 3. **Home Directory**: `~/.openmina/circuit-blobs/`
//! 4. **System Directory**: `/usr/local/lib/openmina/circuit-blobs`
//! 3. **Home Directory**: `~/.mina/circuit-blobs/`
//! 4. **System Directory**: `/usr/local/lib/mina/circuit-blobs`
//!
//! ### Remote Fetching
//!
//! If files are not found locally, the system automatically downloads them from:
//!
//! ```text
//! https://github.com/openmina/circuit-blobs/releases/download/<filename>
//! https://github.com/o1-labs/circuit-blobs/releases/download/<filename>
//! ```
//!
//! Downloaded files are cached locally for future use.
Expand All @@ -77,15 +77,15 @@
//! 2. **Local Search**: Searches in these locations (in order):
//! - `$MINA_CIRCUIT_BLOBS_BASE_DIR` (if set)
//! - Current project directory
//! - `~/.openmina/circuit-blobs/`
//! - `/usr/local/lib/openmina/circuit-blobs`
//! - `~/.mina/circuit-blobs/`
//! - `/usr/local/lib/mina/circuit-blobs`
//! 3. **Automatic Download**: If files aren't found locally, downloads from GitHub
//! 4. **Local Caching**: Saves downloaded files to `~/.openmina/circuit-blobs/`
//! 4. **Local Caching**: Saves downloaded files to `~/.mina/circuit-blobs/`
//! 5. **Ready to Use**: Circuit data is loaded and ready for proof generation
//!
//! ### Subsequent Runs
//!
//! - Uses cached files from `~/.openmina/circuit-blobs/`
//! - Uses cached files from `~/.mina/circuit-blobs/`
//! - No network requests needed
//! - Fast startup times
//!
Expand Down Expand Up @@ -117,12 +117,12 @@ use std::path::Path;
#[cfg(not(target_family = "wasm"))]
pub fn home_base_dir() -> Option<std::path::PathBuf> {
let mut path = std::path::PathBuf::from(std::env::var("HOME").ok()?);
path.push(".openmina/circuit-blobs");
path.push(".mina/circuit-blobs");
Some(path)
}

fn git_release_url(filename: &impl AsRef<Path>) -> String {
const RELEASES_PATH: &str = "https://github.com/openmina/circuit-blobs/releases/download";
const RELEASES_PATH: &str = "https://github.com/o1-labs/circuit-blobs/releases/download";
let filename_str = filename.as_ref().to_str().unwrap();

format!("{RELEASES_PATH}/{filename_str}")
Expand Down Expand Up @@ -152,7 +152,7 @@ pub fn fetch_blocking(filename: &impl AsRef<Path>) -> std::io::Result<Vec<u8>> {
.or_else(|| try_base_dir(std::env::var("MINA_CIRCUIT_BLOBS_BASE_DIR").ok()?, filename))
.or_else(|| try_base_dir(env!("CARGO_MANIFEST_DIR").to_string(), filename))
.or_else(|| try_base_dir(home_base_dir.clone()?, filename))
.or_else(|| try_base_dir("/usr/local/lib/openmina/circuit-blobs", filename));
.or_else(|| try_base_dir("/usr/local/lib/mina/circuit-blobs", filename));

if let Some(path) = found {
return std::fs::read(path);
Expand Down
2 changes: 1 addition & 1 deletion website/docs/developers/circuits.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ in the ledger crate.
### Overview

Circuit constraints for the Mina Rust node are sourced from the
[circuit-blobs](https://github.com/openmina/circuit-blobs) repository, which
[circuit-blobs](https://github.com/o1-labs/circuit-blobs) repository, which
contains pre-compiled circuit data generated by the OCaml implementation.

The Mina Rust node automatically handles downloading and caching these circuit
Expand Down
2 changes: 1 addition & 1 deletion website/docs/node-operators/webnode/local-webnode.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Download `circuit-blobs`, from the root of project run:

```sh
cd frontend/src/assets/webnode
git clone --depth 1 https://github.com/openmina/circuit-blobs.git
git clone --depth 1 https://github.com/o1-labs/circuit-blobs.git
```

And create `web-node-secrets.json` in `frontend/src/assets/webnode` it should be
Expand Down
Loading