Skip to content

Commit

Permalink
Changed zokrates for compile and setup (#197)
Browse files Browse the repository at this point in the history
* feat: changed zokrates for compile and setup

* fix: fixed action test

* fix: fixed action test

* fix: fixed action test

* fix: fixed action test

* fix: fixed vk

* fix: modified action test

* fix: possible fix for zokrates-worker

* fix: added a fix for encrypted events

* chore : updated the readme

---------

Co-authored-by: Miranda Wood <[email protected]>
  • Loading branch information
SwatiEY and MirandaWood authored Jul 3, 2023
1 parent b7b681b commit a47a3cd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ jobs:

- name: run zapp npm apitest
run: npx mocha --exit --timeout 50000 --require @babel/register apitest.js

- name: disp logs on failure
if: failure()
run: |
docker logs assign_zokrates_1
docker logs if-statement_zokrates_1
docker logs internalFunctionCallTest1_zokrates_1
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ The configuration can be done during `./bin/setup` phase in the following way.

### Zokrates Worker

Starlight uses containerised zokrates from [zokrates-worker-starlight](https://github.com/EYBlockchain/starlight/pkgs/container/zokrates-worker-starlight) which is built from repo [zokrates-worker](https://github.com/EYBlockchain/zokrates-worker/tree/hari/starlight).
Starlight uses containerised zokrates from [zokrates-worker-starlight](https://github.com/EYBlockchain/starlight/pkgs/container/zokrates-worker-starlight).
Here we have use two zokrates container, zokrates -version:0.7.12 to compile the circuits and zokrates -version:0.8.1 to do the setup and generate-proof to improve the key and proof generation time.

### Contributing

Expand Down
2 changes: 1 addition & 1 deletion src/boilerplate/common/generic-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('FUNCTION_NAME', async function () {
console.log(`Merkle tree event returnValues:`);
console.log(tx.returnValues[0]);
}
if (encEvent.event) {
if (encEvent[0].event) {
encryption.msgs = encEvent[0].returnValues[0];
encryption.key = encEvent[0].returnValues[1];
console.log("EncryptedMsgs:");
Expand Down
7 changes: 6 additions & 1 deletion src/boilerplate/common/migrations/2_shield.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ CUSTOM_PROOF_IMPORT
const CONTRACT_NAME = artifacts.require("CONTRACT_NAME");
const functionNames = [FUNCTION_NAMES];
const vkInput = [];
let vk = [];
functionNames.forEach(name => {
const vkJson = JSON.parse(
fs.readFileSync(`/app/orchestration/common/db/${name}_vk.key`, 'utf-8'),
);
const vk = Object.values(vkJson).flat(Infinity);
if (vkJson.scheme) {
vk = Object.values(vkJson).slice(2).flat(Infinity);
} else {
vk = Object.values(vkJson).flat(Infinity);
}
vkInput.push(vk);
});

Expand Down
2 changes: 1 addition & 1 deletion src/boilerplate/common/zokrates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const generateProof = async (functionName, inputs) => {
*/
export const generateKeys = async circuitFileName => {
const filepath = `${circuitFileName}`;
// logger.info('Generating Keys for Circuit: ', circuitFileName);
//logger.info('Generating Keys for Circuit: ', circuitFileName);
try {
const axiosConfig = {
method: 'post',
Expand Down

0 comments on commit a47a3cd

Please sign in to comment.