Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SnarkyJS run inside a web worker #377

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/chrome_bindings/plonk_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function initSnarkyJS() {

let workersReady = new Promise((resolve) => (worker.onmessage = resolve));
await workersReady;
window.plonk_wasm = override_bindings(plonk_wasm, worker);
globalThis.plonk_wasm = override_bindings(plonk_wasm, worker);

// we have two approaches to run the .bc.js code after its dependencies are ready, without fetching an additional script:

Expand Down
2 changes: 1 addition & 1 deletion src/snarky/wrapper.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { initSnarkyJS } from '../chrome_bindings/plonk_init.js';

export { getSnarky, getWasm, snarky_ready, shutdown };

let getSnarky = () => window.__snarky;
let getSnarky = () => globalThis.__snarky;

function getWasm() {
return globalThis.plonk_wasm;
Expand Down