Skip to content

Commit 2a0c526

Browse files
olomixOBrezhniev
andauthored
Pluggable witness calc (#14)
* Witness implementation using tetratelabs/wazero * fix lint errors * Update wazero to v1.0.3 * Removed unused constructor parameter sanityCheck from NewCircom2WitnessCalculator * Rename test_files directory to testdata. It's more goish. * Make witness calculator pluggable with wasm engine * Merge fixes * Upgrade wazero dependency to v1.1.0 * Upgrade wazero dependency to v1.1.0 * Put different wasm implementations into different modules * add linter and tests for witness calc * fix test commands * rename lint and test ci jobs * Increate timeout for testing witness * Simplify interface for witness calculator implamentation. Do all serialization and formatting logic in one place. * go mod tidy * Update dependencies * upgrade dependencies * refactor names * upgrade dependencies * go mod tidy * Dump v2 for witness * dump wasmer/wazero versions to v2 * fix wazero/wasmer versions --------- Co-authored-by: Oleksandr Brezhniev <[email protected]>
1 parent caf247d commit 2a0c526

File tree

22 files changed

+667
-688
lines changed

22 files changed

+667
-688
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: lint-witness
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-go@v4
15+
with:
16+
go-version: 1.20.4
17+
- name: lint witness
18+
uses: golangci/golangci-lint-action@v3
19+
with:
20+
version: v1.52.2
21+
working-directory: witness
22+
- name: lint witness/wazero
23+
uses: golangci/golangci-lint-action@v3
24+
with:
25+
version: v1.52.2
26+
working-directory: witness/wazero
27+
- name: lint witness/wasmer
28+
uses: golangci/golangci-lint-action@v3
29+
with:
30+
version: v1.52.2
31+
working-directory: witness/wasmer
32+
- name: lint witness/test_wasm_impls
33+
uses: golangci/golangci-lint-action@v3
34+
with:
35+
version: v1.52.2
36+
working-directory: witness/test_wasm_impls
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test-witness
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
containers:
14+
- 1.18.10-bullseye
15+
- 1.19.9-bullseye
16+
- 1.20.4-bullseye
17+
runs-on: ubuntu-20.04
18+
container: golang:${{matrix.containers}}
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cache/go-build
25+
/go/pkg/mod
26+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27+
restore-keys: |
28+
${{ runner.os }}-go-
29+
- run: cd witness && go test -race -timeout=60s -v ./...
30+
- run: cd witness/wazero && go test -race -timeout=60s -v ./...
31+
- run: cd witness/wasmer && go test -race -timeout=60s -v ./...
32+
- run: cd witness/test_wasm_impls && go test -race -timeout=300s -v ./...

witness/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Calculates witness, that can be passed to a prover ([snarkjs](https://github.com
55
## Installation
66

77
```
8-
go get github.com/iden3/go-rapidsnark/witness
8+
go get github.com/iden3/go-rapidsnark/witness/v2
99
```
1010

1111
## Dependencies

witness/circom2witnesscalc_test.go

Lines changed: 0 additions & 129 deletions
This file was deleted.

witness/circom2witnesscalc_wazero_test.go

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)