fix: always store uncompressed CRS on disk in C++ native path#21972
Open
AztecBot wants to merge 6 commits into
Open
fix: always store uncompressed CRS on disk in C++ native path#21972AztecBot wants to merge 6 commits into
AztecBot wants to merge 6 commits into
Conversation
…ed format Instead of renaming to bn254_g1_compressed.dat (which breaks cached CRS), keep the original bn254_g1.dat filename and auto-detect the format on read by checking the first element against known uncompressed/compressed constants. Bootstrap scripts now replace old uncompressed files when re-downloading.
…+ native path only C++ native path: downloads compressed g1_compressed.dat (50% bandwidth savings), decompresses, and stores as uncompressed bn254_g1.dat (64 bytes/point). JS/WASM path: reverted to download uncompressed g1.dat directly. srs_init_srs accepts uncompressed 64-byte points (reverted). Bootstrap scripts download uncompressed g1.dat as before. On-disk format is always uncompressed - no decompression on every load.
…avior) Only the C++ native path and bootstrap scripts change: - C++ downloads compressed, decompresses, stores uncompressed bn254_g1.dat - Bootstrap scripts download uncompressed g1.dat directly - JS/WASM path unchanged from PR #21112 (compressed throughout)
ludamad
approved these changes
Mar 25, 2026
CI machines may have bn254_g1_compressed.dat (from PR #21112) but not bn254_g1.dat. Check both filenames: uncompressed first, then compressed. New downloads still store as uncompressed bn254_g1.dat.
AztecBot
added a commit
that referenced
this pull request
Mar 25, 2026
… compress method)
federicobarbacovi
pushed a commit
that referenced
this pull request
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #21112 renamed the CRS file from
bn254_g1.dattobn254_g1_compressed.datand stored compressed data on disk. This broke machines with cachedbn254_g1.dat— tests usinginit_file_crs_factory(no download) would fail.This PR fixes the C++ native path to always store uncompressed
bn254_g1.daton disk:g1_compressed.datfrom CDN (50% bandwidth savings)bn254_g1.dat(64 bytes/point)The JS/WASM path is unchanged from PR #21112 (compressed throughout —
srs_init_srsdecompresses in C++).Changes
get_bn254_crs.cpp: Download compressed, decompress, store uncompressedbn254_g1.datcrs_factory.test.cpp: Simplified to read uncompressed format; removed chunk hash tests (those test compressed-on-disk which we no longer do)chonk.bench.cpp: Updated decompression benchmark to compress from uncompressed filecrs/bootstrap.sh,scripts/download_bb_crs.sh: Download uncompressedg1.datrelease-image/bootstrap.sh: Usebn254_g1.dat"