Skip to content

fix(bb.js): cache compressed browser CRS - #25290

Open
Wondertan wants to merge 1 commit into
AztecProtocol:merge-train/barretenbergfrom
Wondertan:feat/bbjs-configurable-srs-size
Open

fix(bb.js): cache compressed browser CRS#25290
Wondertan wants to merge 1 commit into
AztecProtocol:merge-train/barretenbergfrom
Wondertan:feat/bbjs-configurable-srs-size

Conversation

@Wondertan

@Wondertan Wondertan commented Aug 22, 2026

Copy link
Copy Markdown

What

  • Persist compressed BN254 G1 data in IndexedDB immediately after download.
  • Reuse an exact cache entry or the prefix of a larger entry before fetching.

Why

Crs.new(size) can preload CRS without constructing the WASM prover, but the compressed browser path currently writes nothing to IndexedDB until srsInitSrs decompresses it. Navigation or reload after preload therefore repeats the large range request. This makes the existing CRS loader durable while leaving normal Barretenberg.new({ srsSize }) behavior unchanged.

Verification

  • Added focused cache reuse and larger-prefix tests.
  • cached_net_crs: 2/2 passing.
  • Prettier and ESLint pass on both changed files.

CI is awaiting a maintainer-added ci-external or ci-external-once label.

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.

1 participant