Skip to content

Conversation

@johnathan79717
Copy link
Contributor

Summary

  • Adds Cloudflare R2 endpoint (crs.aztec-cdn.foundation) as primary CRS download source
  • Falls back to existing AWS S3 bucket (crs.aztec.network) on failure
  • Reduces costs (R2 has no egress fees) and improves reliability

Changes

  • C++: Added fallback logic in get_bn254_crs.cpp with HTTPS support for R2
  • TypeScript: Added fetchWithFallback helper in net_crs.ts
  • Shell: Added download_with_fallback function in bootstrap.sh and download_bb_crs.sh
  • Tests: Added fallback tests for both C++ (CrsFactory.Bn254Fallback) and TypeScript

Test plan

  • C++ srs_tests pass (including new Bn254Fallback test)
  • TypeScript net_crs.test.ts passes (tests primary download and fallback)
  • Shell script download verified manually

Resolves AztecProtocol/barretenberg#1609

Adds a new Cloudflare R2 endpoint (crs.aztec-cdn.foundation) as the primary
CRS download source with automatic fallback to the existing AWS S3 bucket
(crs.aztec.network) on failure. This improves reliability and reduces costs
since R2 has no egress fees.

Changes:
- C++: Added fallback logic in get_bn254_crs.cpp with HTTPS support
- TypeScript: Added fetchWithFallback helper in net_crs.ts
- Shell: Added download_with_fallback function in bootstrap.sh and download_bb_crs.sh
- Tests: Added fallback tests for both C++ and TypeScript

Resolves AztecProtocol/barretenberg#1609

// Use a bad primary URL that will fail, forcing fallback to the real S3 URL
std::string bad_primary = "http://nonexistent.invalid/g1.dat";
std::string good_fallback = "http://crs.aztec.network/g1.dat";
Copy link
Contributor

@charlielye charlielye Jan 31, 2026

Choose a reason for hiding this comment

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

you should now be able to change these labs fallback domains to crs.aztec-labs.com

@charlielye
Copy link
Contributor

Where's the terraform for this cloudflare bucket? It should be committed to iac-foundation repo.

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.

3 participants