DoraFactory / df-docs

Dora Factory Documentation
https://docs.dorafactory.org
MIT License
0 stars 2 forks source link

I meet error when run tally. #108

Closed johnnhatnguyen closed 7 months ago

johnnhatnguyen commented 7 months ago

root@john:/mnt/c/dorahacks/john/bounty-3/vota-operator-scripts-vota-v2# npm run tally

vota-operator-scripts@1.0.0 tally cp secret.env .env && node ./dist/operator.mjs tally

genInput operator get proof The keys folder already exists, need re-download it? (y/n): y % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 212M 100 212M 0 0 1511k 0 0:02:23 0:02:23 --:--:-- 1712k tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.macl' get contract logs and gen input max_vote_options: 2 { id: 'dora1e04k3ye2sksmh4awx3ynj0jaf9ldrhzkezlxp5mhendef3cckv6s3ssjx2', blockHeight: '1964092', txHash: 'FCF3D5872C2C6D2754DB05B0D7A5C596A937437FB07E4ECA89A4DA27D12DA952', operator: 'dora16c20s8el98dujw33m9emn8a5gcu9klv2pghuhk', contractAddress: 'dora1e04k3ye2sksmh4awx3ynj0jaf9ldrhzkezlxp5mhendef3cckv6s3ssjx2', circuitName: 'MACI-1P1V_2-1-1-5', timestamp: '1703531569684', votingStart: '1703532000000000000', votingEnd: '1703532600000000000', status: 'Tallying', period: 'Processing', actionType: 'op:deploy', roundId: '53', roundTitle: 'Deploy A MACI Round On Dora Vota', roundDescription: 'Mini Bounty - Deploy A MACI Round On Dora Vota Using A Quick GUI', roundLink: 'https://dorahacks.io/vi/mini-bounty/9', maciDenom: 'peaka', gasStationEnable: false, totalGrant: '0', baseGrant: '0', totalBond: '0', circuitType: '0', circuitPower: '2-1-1-5' } [ { idx: 0, balance: 50n, pubkey: [ 6396363459758610104738266651094412480513308567499683559014125958204900113026n, 16161151272422195756787406318828087346945347815263652135898916545499747745810n ] } ] [ { idx: 0, msg: [ 9168527567038783437347411469619254778063255703629830140794752238790416847404n, 4134055804064284398796206486727576200135701393143727464594112294237379785362n, 3608648424362531807891548344541020979676052805342375518220476840674103676206n, 6420736726397391119684282435752010031742935862051719550277859172094080189811n, 2112377921291954609481302086063082933827595412414414900825827084204363227152n, 12044183275141622147261170187441109539324728844231970888477023926335612774526n, 10173767881141228152511380705229944901618653117579527652782409325900824185n ], pubkey: [ 11258851757686259837061595742728855632725284573352779558123423937173545488123n, 5801402061487395301575523200169447109517527862988279180526418263728825615966n ] } ] [ '/root/.nvm/versions/node/v18.19.0/bin/node', '/mnt/c/dorahacks/john/bounty-3/vota-operator-scripts-vota-v2/js/genInputs.js', '10356811017528628091907289882420728698010368211944434190511528664109770047502' ]

init MACI ==============================

set State { idx: 0 } ===================

push Message { idx: 0 } ================

Vote End ===================================================

= Process message [0, 1) ===============

TypeError: Cannot read properties of undefined (reading 'soliditySha256') at MACI.processMessage (/mnt/c/dorahacks/john/bounty-3/vota-operator-scripts-vota-v2/js/maci.js:295:36) at Object. (/mnt/c/dorahacks/john/bounty-3/vota-operator-scripts-vota-v2/js/genInputs.js:60:21) at Module._compile (node:internal/modules/cjs/loader:1356:14) at Module._extensions..js (node:internal/modules/cjs/loader:1414:10) at Module.load (node:internal/modules/cjs/loader:1197:32) at Module._load (node:internal/modules/cjs/loader:1013:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) at node:internal/main/run_main_module:28:49

Node.js v18.19.0 11:19:24 start generate witness everything is ok 脚本成功执行 Some thing is wrong. root@john:/mnt/c/dorahacks/john/bounty-3/vota-operator-scripts-vota-v2#

99Kies commented 7 months ago

@johnnhatnguyen It seems that your local code for vota-operator-script is not up-to-date, you can update your local code to the main branch. https://github.com/DoraFactory/vota-operator-scripts/tree/main

And then re-execute:

npm run build
npm run tally
johnnhatnguyen commented 7 months ago

And I follow your new code link @99Kies:

root@john:/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main# npm run tally

vota-operator-scripts@1.0.0 tally cp secret.env .env && node ./dist/operator.mjs tally

The current MACI round is processing genInput (download zkey and MACI messages): Get MACI messages from the smart contract: max_vote_options: 2 { id: 'dora1e04k3ye2sksmh4awx3ynj0jaf9ldrhzkezlxp5mhendef3cckv6s3ssjx2', blockHeight: '1964092', txHash: 'FCF3D5872C2C6D2754DB05B0D7A5C596A937437FB07E4ECA89A4DA27D12DA952', operator: 'dora16c20s8el98dujw33m9emn8a5gcu9klv2pghuhk', contractAddress: 'dora1e04k3ye2sksmh4awx3ynj0jaf9ldrhzkezlxp5mhendef3cckv6s3ssjx2', circuitName: 'MACI-1P1V_2-1-1-5', timestamp: '1703531569684', votingStart: '1703532000000000000', votingEnd: '1703532600000000000', status: 'Tallying', period: 'Processing', actionType: 'op:deploy', roundId: '53', roundTitle: 'Deploy A MACI Round On Dora Vota', roundDescription: 'Mini Bounty - Deploy A MACI Round On Dora Vota Using A Quick GUI', roundLink: 'https://dorahacks.io/vi/mini-bounty/9', maciDenom: 'peaka', gasStationEnable: false, totalGrant: '0', baseGrant: '0', totalBond: '0', circuitType: '0', circuitPower: '2-1-1-5' } [ { idx: 0, balance: 50n, pubkey: [ 6396363459758610104738266651094412480513308567499683559014125958204900113026n, 16161151272422195756787406318828087346945347815263652135898916545499747745810n ] } ] [ { idx: 0, msg: [ 9168527567038783437347411469619254778063255703629830140794752238790416847404n, 4134055804064284398796206486727576200135701393143727464594112294237379785362n, 3608648424362531807891548344541020979676052805342375518220476840674103676206n, 6420736726397391119684282435752010031742935862051719550277859172094080189811n, 2112377921291954609481302086063082933827595412414414900825827084204363227152n, 12044183275141622147261170187441109539324728844231970888477023926335612774526n, 10173767881141228152511380705229944901618653117579527652782409325900824185n ], pubkey: [ 11258851757686259837061595742728855632725284573352779558123423937173545488123n, 5801402061487395301575523200169447109517527862988279180526418263728825615966n ] } ] ./operator.sh: line 15: jq: command not found Operator downloading zkey: % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 255 0 255 0 0 747 0 --:--:-- --:--:-- --:--:-- 747

gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now Generate input: [ '/root/.nvm/versions/node/v18.19.0/bin/node', '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/js/genInputs.js', '10356811017528628091907289882420728698010368211944434190511528664109770047502' ]

init MACI ==============================

set State { idx: 0 } ===================

push Message { idx: 0 } ================

Vote End ===================================================

= Process message [0, 1) ===============

10338401991090014706898010637868756990698199630880416615800516627277868779031

Process Finished ===========================================

= Process tally [0, 5) =================

18818562632550785580215006738388376383797016254240155301635424128425497876549

Tally Finished =============================================

14:11:48 start generate witness node:internal/modules/cjs/loader:1137 throw err; ^

Error: Cannot find module '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/zkeys/r1cs/msg_js/generate_witness.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15) at Module._load (node:internal/modules/cjs/loader:975:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) at node:internal/main/run_main_module:28:49 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v18.19.0 14:11:48 start generate proof [ERROR] snarkJS: [Error: ENOENT: no such file or directory, open 'build/wtns/msg_0000.wtns'] { errno: -2, code: 'ENOENT', syscall: 'open', path: 'build/wtns/msg_0000.wtns' } 14:11:54 start verify the msg proof [ERROR] snarkJS: Error: ENOENT: no such file or directory, open 'zkeys/verification_key/msg/verification_key.json' at Object.openSync (node:fs:596:3) at Object.readFileSync (node:fs:464:35) at Object.groth16Verify [as action] (file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/node_modules/snarkjs/cli.js:569:43) at clProcessor (file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/node_modules/snarkjs/src/clprocessor.js:74:37) at file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/node_modules/snarkjs/cli.js:348:1 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:336:24) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:106:12) { errno: -2, syscall: 'open', code: 'ENOENT', path: 'zkeys/verification_key/msg/verification_key.json' } 14:12:00 start transform the proof data format /mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main node:fs:596 handleErrorFromBinding(ctx); ^

Error: ENOENT: no such file or directory, open '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/zkeys/verification_key/msg/verification_key.json' at Object.openSync (node:fs:596:3) at Module.readFileSync (node:fs:464:35) at adaptToUncompressed (file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/prove/src/adapt_maci.js:19:43) at file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/prove/src/adapt_maci.js:89:1 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:336:24) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:106:12) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/zkeys/verification_key/msg/verification_key.json' }

Node.js v18.19.0 node:internal/modules/cjs/loader:1137 throw err; ^

Error: Cannot find module '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/zkeys/r1cs/tally_js/generate_witness.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15) at Module._load (node:internal/modules/cjs/loader:975:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) at node:internal/main/run_main_module:28:49 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v18.19.0 14:12:01 start generate proof [ERROR] snarkJS: [Error: ENOENT: no such file or directory, open 'build/wtns/tally_0000.wtns'] { errno: -2, code: 'ENOENT', syscall: 'open', path: 'build/wtns/tally_0000.wtns' } 14:12:08 start verify the tally proof [ERROR] snarkJS: Error: ENOENT: no such file or directory, open 'zkeys/verification_key/tally/verification_key.json' at Object.openSync (node:fs:596:3) at Object.readFileSync (node:fs:464:35) at Object.groth16Verify [as action] (file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/node_modules/snarkjs/cli.js:569:43) at clProcessor (file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/node_modules/snarkjs/src/clprocessor.js:74:37) at file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/node_modules/snarkjs/cli.js:348:1 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:336:24) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:106:12) { errno: -2, syscall: 'open', code: 'ENOENT', path: 'zkeys/verification_key/tally/verification_key.json' } 14:12:14 start transform the proof data format /mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main node:fs:596 handleErrorFromBinding(ctx); ^

Error: ENOENT: no such file or directory, open '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/zkeys/verification_key/tally/verification_key.json' at Object.openSync (node:fs:596:3) at Module.readFileSync (node:fs:464:35) at adaptToUncompressed (file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/prove/src/adapt_maci.js:19:43) at file:///mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/prove/src/adapt_maci.js:89:1 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:336:24) at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:106:12) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/zkeys/verification_key/tally/verification_key.json' }

Node.js v18.19.0 Successfully generated proof Tally script successfully executed.

Submitting on-chain transactions to verify zero-knowledge proofs. processMessage msg_0000 20385630237384996665507627766678842621071514951287336614216491568117236829580 Tally failed. ENOENT: no such file or directory, open '/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main/build/final_proof/msg_0000/proof_hex.json' root@john:/mnt/c/dorahacks/john/bounty-3/new/vota-operator-scripts-main#

99Kies commented 7 months ago

@johnnhatnguyen Good, You're close to being right, the problem now is because you're missing jq.

if in mac

brew install jq

if in linux

apt install jq

and then npm run tally

johnnhatnguyen commented 7 months ago

Yeah! And now the MACI is closed. Thanks @99Kies.

53 Deploy A MACI Round On Dora Vota

User logo

ID #53

Name Deploy A MACI Round On Dora Vota Description Mini Bounty - Deploy A MACI Round On Dora Vota Using A Quick GUI Website https://dorahacks.io/vi/mini-bounty/9 Circuit MACI-1P1V Zkey qv1p1v/power-2-1-1-5 Status Closed Block height 1,964,092 Round start 2023-12-26 02:20:00 Round end 2023-12-26 02:30:00 Operator dora16c20s8el98dujw33m9emn8a5gcu9klv2pghuhk Contract address dora1e04k3ye2sksmh4awx3ynj0jaf9ldrhzkezlxp5mhendef3cckv6s3ssjx2 Zero-knowledge proof save proof