Skip to content

Commit

Permalink
Merge pull request #137 from zama-ai/fix/load-on-verify
Browse files Browse the repository at this point in the history
fix: change proof optimization for prover
  • Loading branch information
immortal-tofu authored Nov 27, 2024
2 parents 1198179 + c5bfe78 commit 6e0b6b2
Show file tree
Hide file tree
Showing 18 changed files with 2,586 additions and 703 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: 🐛 fhevmjs Bug report
about: Use this template to report issues encountered while using the fhevmjs library for interacting with fhEVM smart contracts.
title: ""
title: ''
labels: bug, fhevmjs
assignees: ""
assignees: ''
---

### **Description**
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: 🚀 General feature request for fhEVM
about: Suggest an idea for this project
title: ""
title: ''
labels: enhancement
assignees: ""
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run prettier:check
- run: npm test
- run: npm run build
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run prettier:check
- run: npm test
- run: npm run build
# - uses: ArtiomTr/jest-coverage-report-action@v2
16 changes: 10 additions & 6 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createRequire } from 'node:module';
import OMT from '@surma/rollup-plugin-off-main-thread';

import copy from 'rollup-plugin-copy';
import json from '@rollup/plugin-json';
import url from '@rollup/plugin-url';
import { wasm } from '@rollup/plugin-wasm';
Expand All @@ -11,8 +12,6 @@ import nodePolyfills from 'rollup-plugin-polyfill-node';
import path from 'path';
import fs from 'fs';

const require = createRequire(import.meta.url);

const wasmBindgenRayon = fs.readdirSync(
path.resolve('node_modules/tfhe/snippets'),
)[0];
Expand Down Expand Up @@ -59,16 +58,21 @@ export default [
name: 'fhevm',
format: 'es',
},
plugins: [...webPlugins],
plugins: [
...webPlugins,
copy({
targets: [{ src: 'node_modules/tfhe/tfhe_bg.wasm', dest: 'lib/' }],
}),
],
},
{
input: `./node_modules/tfhe/snippets/${wasmBindgenRayon}/src/workerHelpers.worker.js`,
output: {
file: 'lib/workerHelpers.worker.js',
name: 'worker',
format: 'es',
format: 'esm',
},
plugins: [...webPlugins],
plugins: [OMT()],
},
{
input: 'src/node.ts',
Expand Down
10 changes: 8 additions & 2 deletions generateKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ const createTfheKeypair = () => {
.build();
let clientKey = TfheClientKey.generate(config);
let publicKey = TfheCompactPublicKey.new(clientKey);
fs.writeFileSync('src/test/keys/publicKey.bin', publicKey.safe_serialize(SERIALIZED_SIZE_LIMIT_PK));
fs.writeFileSync('src/test/keys/privateKey.bin', clientKey.safe_serialize(SERIALIZED_SIZE_LIMIT_PK));
fs.writeFileSync(
'src/test/keys/publicKey.bin',
publicKey.safe_serialize(SERIALIZED_SIZE_LIMIT_PK),
);
fs.writeFileSync(
'src/test/keys/privateKey.bin',
clientKey.safe_serialize(SERIALIZED_SIZE_LIMIT_PK),
);
const crs0 = CompactPkeCrs.from_config(config, 4 * 32);
fs.writeFileSync(
'src/test/keys/crs128.bin',
Expand Down
Loading

0 comments on commit 6e0b6b2

Please sign in to comment.