Skip to content

Commit

Permalink
Merge pull request #389 from o1-labs/feature/snarkyjs-in-workers-release
Browse files Browse the repository at this point in the history
Make SnarkyJS run inside a web worker - RELEASES
  • Loading branch information
mitschabaude authored Sep 8, 2022
2 parents 5786ee1 + 6620b9a commit fdcd618
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
_Security_ in case of vulnerabilities.
-->

## [Unreleased](https://github.com/o1-labs/snarkyjs/compare/3461333...HEAD)
## [Unreleased](https://github.com/o1-labs/snarkyjs/compare/f2ad423...HEAD)

### Added

- `reducer.getActions` partially implemented for local testing https://github.com/o1-labs/snarkyjs/pull/327
- `gte` and `assertGte` methods on `UInt32`, `UInt64` https://github.com/o1-labs/snarkyjs/pull/349

## [0.5.4](https://github.com/o1-labs/snarkyjs/compare/3461333...f2ad423)

### Fixed

- Running snarkyjs inside a web worker https://github.com/o1-labs/snarkyjs/issues/378

## [0.5.3](https://github.com/o1-labs/snarkyjs/compare/4f0dd40...3461333)

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "snarkyjs",
"description": "JavaScript bindings for SnarkyJS",
"version": "0.5.3",
"version": "0.5.4",
"license": "Apache-2.0",
"main": "./dist/web/index.js",
"exports": {
Expand Down
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.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 fdcd618

Please sign in to comment.