Skip to content

fix: respect wasm load config params when instantiating sqlite - #24937

Merged
mverzilli merged 1 commit into
merge-train/fairies-v5from
martin/triage-200
Jul 23, 2026
Merged

fix: respect wasm load config params when instantiating sqlite#24937
mverzilli merged 1 commit into
merge-train/fairies-v5from
martin/triage-200

Conversation

@mverzilli

@mverzilli mverzilli commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The sqlite3mc we vendor clobbers config params used to find the sqlite wasm file to load.

As a result, the bundler-visible default wasm URL was silently discarded on the first call in a given env and wasmBinary was never honored at all.

We introduce an index.ts wrapper that takes care of ensuring options survive the first call and every call after. It honors locateFile, wasmBinary, and instantiateWasm, and it defaults to a static SQLITE3_WASM_URL that bundlers rewrite to their emitted asset.

(We need to follow this up with some simplification of aztec-kit)

Closes TRIAGE-200
Fixes #24895

@mverzilli
mverzilli requested a review from Thunkar July 23, 2026 11:56
@AztecBot AztecBot added the port-to-next Forward-port this merged PR into next label Jul 23, 2026
@mverzilli
mverzilli force-pushed the martin/triage-200 branch from 77b0c0f to c44762c Compare July 23, 2026 14:06
@mverzilli
mverzilli enabled auto-merge (squash) July 23, 2026 14:26
@mverzilli
mverzilli merged commit 6a70be2 into merge-train/fairies-v5 Jul 23, 2026
12 checks passed
@mverzilli
mverzilli deleted the martin/triage-200 branch July 23, 2026 14:32
@AztecBot

Copy link
Copy Markdown
Collaborator

❌ Failed to cherry-pick to next due to conflicts. (🤖) View backport run.

rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
…Protocol#24937)

The sqlite3mc we vendor clobbers config params used to find the sqlite
wasm file to load.

As a result, the bundler-visible default wasm URL was silently discarded
on the first call in a given env and wasmBinary was never honored at
all.

We introduce an index.ts wrapper that takes care of ensuring options
survive the first call and every call after. It honors `locateFile`,
`wasmBinary`, and `instantiateWasm`, and it defaults to a static
`SQLITE3_WASM_URL` that bundlers rewrite to their emitted asset.

(We need to follow this up with some simplification of aztec-kit)

Closes TRIAGE-200
Fixes AztecProtocol#24895
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
…ztecProtocol#24937) (AztecProtocol#24944)

## Summary

Port of AztecProtocol#24937 to
`next`.

The cherry-pick conflicted in `yarn-project/sqlite3mc-wasm/src/index.ts`
because `next` still had the simple sqlite3mc re-export while the source
PR replaced it with an init wrapper. I resolved the conflict by using
the wrapper from the source PR so `locateFile`, `wasmBinary`, and
`instantiateWasm` survive sqlite initialization, while retaining the
package's existing exported sqlite types.

`origin/port-to-next-staging` was not present after repeated fetches, so
this PR targets `next` directly instead of a missing staging base.

Fixes AztecProtocol#24895

## Tests

- `yarn install --immutable`
- `yarn workspace @aztec/foundation build`
- `yarn workspace @aztec/sqlite3mc-wasm test src/index.test.ts`
- `yarn workspace @aztec/sqlite3mc-wasm build`

Full `yarn build` was attempted, but this fresh checkout lacked
generated repo-wide artifacts such as `@aztec/l1-artifacts`; the
narrower sqlite workspace build passed after restoring the required
ignored local artifacts for testing.

Closes AztecProtocol#24895

---
*Created by
[claudebox](https://claudebox.work/v2/sessions/597504b9b3d7d66e/jobs/1)
· group: `slackbot` · [Slack
thread](https://aztecprotocol.slack.com/archives/C0AGN2WT3CP/p1784817938944179?thread_ts=1784817938.944179&cid=C0AGN2WT3CP)*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

port-to-next Forward-port this merged PR into next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants