fix: respect wasm load config params when instantiating sqlite (port #24937)#24944
Draft
AztecBot wants to merge 1 commit into
Draft
fix: respect wasm load config params when instantiating sqlite (port #24937)#24944AztecBot wants to merge 1 commit into
AztecBot wants to merge 1 commit into
Conversation
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
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
Port of #24937 to
next.The cherry-pick conflicted in
yarn-project/sqlite3mc-wasm/src/index.tsbecausenextstill 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 solocateFile,wasmBinary, andinstantiateWasmsurvive sqlite initialization, while retaining the package's existing exported sqlite types.origin/port-to-next-stagingwas not present after repeated fetches, so this PR targetsnextdirectly instead of a missing staging base.Fixes #24895
Tests
yarn install --immutableyarn workspace @aztec/foundation buildyarn workspace @aztec/sqlite3mc-wasm test src/index.test.tsyarn workspace @aztec/sqlite3mc-wasm buildFull
yarn buildwas 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 #24895
Created by claudebox · group:
slackbot· Slack thread