Skip to content

Commit

Permalink
Merge pull request #377 from o1-labs/feature/snarkyjs-in-workers
Browse files Browse the repository at this point in the history
Make SnarkyJS run inside a web worker
  • Loading branch information
mitschabaude committed Sep 7, 2022
2 parents 91a4f51 + 1f5a827 commit 8123240
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 8123240

Please sign in to comment.