@@ -235,14 +235,29 @@ jobs:
235235 run : |
236236 cmake --preset wasm-threads
237237 cmake --build --preset wasm-threads --target ultra_honk_bench
238+ - name : Stage CRS for the wasm benchmark
239+ run : |
240+ # The bench calls init_file_crs_factory, which throws if the CRS
241+ # files are absent. http_download is unsupported under WASM
242+ # (throws "HTTP download not supported in WASM"), so the runtime
243+ # cannot self-fetch -- prefetch on the host before running.
244+ # 4 MiB of compressed g1 covers up to 2^17 points, well above the
245+ # 2^16 filter below.
246+ set -eu
247+ mkdir -p "$HOME/.bb-crs"
248+ curl -fsSL --range 0-4194303 \
249+ https://crs.aztec-cdn.foundation/g1_compressed.dat \
250+ -o "$HOME/.bb-crs/bn254_g1_compressed.dat"
251+ curl -fsSL https://crs.aztec-cdn.foundation/g2.dat \
252+ -o "$HOME/.bb-crs/bn254_g2.dat"
238253 - name : Run benchmark
239254 id : bench
240255 working-directory : barretenberg/cpp
241256 run : |
242257 # --benchmark_out writes a clean JSON to a file; google-benchmark
243258 # otherwise prints to stdout intermixed with BB_BENCH profiling
244259 # tree, which breaks `json.load`.
245- ./scripts/wasm-run --dir=. \
260+ ./scripts/wasm-run --dir="$HOME/.bb-crs" --dir= . \
246261 ./build-wasm-threads/bin/ultra_honk_bench \
247262 --benchmark_format=json \
248263 --benchmark_out=/tmp/bench.json \
0 commit comments