Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid proof when generating proofs concurrently in Zeto test #80

Closed
Chengxuan opened this issue Sep 24, 2024 · 2 comments
Closed

Invalid proof when generating proofs concurrently in Zeto test #80

Chengxuan opened this issue Sep 24, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Chengxuan
Copy link
Contributor

Chengxuan commented Sep 24, 2024

Example error log when running the test with 2 thread running in parallel:

  1) (Gas cost analysis) Zeto based fungible token with anonymity using nullifiers and encryption with KYC
       Transfer 20 tokens (half from deposit, half from mint) from single address to another
         Alice transfer 20 tokens to Bob in 10 txs:
     Error: VM Exception while processing transaction: reverted with reason string 'Invalid proof'
    at Zeto_AnonEncNullifierKyc.transfer (contracts/zeto_anon_enc_nullifier_kyc.sol:111)
    at <UnrecognizedContract>.<unknown> (0x2279b7a0a67db372996a5fab50d91eaa73d2ebe6)
    at EdrProviderWrapper.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:431:41)
    at async HardhatEthersSigner.sendTransaction (node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:125:18)
    at async send (node_modules/ethers/src.ts/contract/contract.ts:313:20)
    at async Proxy.transfer (node_modules/ethers/src.ts/contract/contract.ts:352:16)
    at async sendTx (test/gas_cost/zeto_anon_enc_nullifier_kyc_cost_analysis.ts:557:16)
    at async doTransfer (test/gas_cost/zeto_anon_enc_nullifier_kyc_cost_analysis.ts:452:22)
    at async /Users/cxing/go/src/github.com/hyperledger-labs/zeto/solidity/test/gas_cost/zeto_anon_enc_nullifier_kyc_cost_analysis.ts:362:13
    at async Promise.all (index 6)
    at async Context.<anonymous> (test/gas_cost/zeto_anon_enc_nullifier_kyc_cost_analysis.ts:388:9)
@Chengxuan Chengxuan added the bug Something isn't working label Sep 24, 2024
@Chengxuan Chengxuan self-assigned this Sep 24, 2024
@Chengxuan Chengxuan changed the title Invalid proof when generating groth16 proof concurrently in Zeto test Invalid proof when generating proofs concurrently in Zeto test Sep 24, 2024
@Chengxuan
Copy link
Contributor Author

Chengxuan commented Sep 24, 2024

The issue is related to concurrently generating witnesses is not multi-threads safe, added a lock as a workaround https://github.com/hyperledger-labs/zeto/pull/79/files#diff-d9c87e662d919b1fda426b303d12170fd15f677870092c06e8c3062aa8eae21bR518 while working on a solution for this

@Chengxuan
Copy link
Contributor Author

Chengxuan commented Sep 27, 2024

Closing this issue as it's being addressed by iden3/circom#299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant