Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"@coral-xyz/anchor": "^0.32.1",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@cryptkeeperzk/snarkjs": "^0.7.2",
"snarkjs": "^0.7.5",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Search for singleThread usage in the codebase
rg -i "singlethread" --type json --type js --type ts -B 2 -A 2

Repository: kynesyslabs/sdks

Length of output: 2637


🏁 Script executed:

# Also check the package.json for the exact versions
fd package.json -x cat -n {} | head -200

Repository: kynesyslabs/sdks

Length of output: 10900


🌐 Web query:

snarkjs 0.7.5 release notes singleThread prover option fullProve

💡 Result:

In snarkjs v0.7.5 (released Oct 18, 2024), the release notes include “Support for wtns calc and prover options” (PR #517). This change adds the ability for fullProve/fullprove to pass options through to:

  • the witness calculator (e.g. memorySize), and
  • the prover, including a single-thread mode option (spelled singleThread in the API; the PR text contains a minor typo). [1][2]

Where it shows up: the v0.7.5 release notes list the PR, and the PR description explicitly says it “Pass[es] … singleTread option to prover” and adds an options parameter to groth16FullProve (and similarly for PLONK/FFLONK full prove). [1][2]

Sources:
[1] snarkjs v0.7.5 release notes (GitHub Releases) (github.com)
[2] PR #517 “Support for wtns calc and prover options” (github.com)

Citations:


🌐 Web query:

@types/snarkjs 0.7.9 type definitions groth16 fullProve singleThread

💡 Result:

In @types/snarkjs 0.7.9, groth16.fullProve is typed as:

  • fullProve(input, wasmFile, zkeyFileName, logger?) (no “options” parameter), so singleThread can’t be passed without a TS error. [1]

In snarkjs itself, the documented way to force single-threaded proving is not fullProve, but:

  • snarkjs.groth16.prove(zkeyFinal, wtns, undefined, { singleThread: true }) [2]

So in TS, the practical options are:

  1. Use wtns.calculate(...) + groth16.prove(..., { singleThread: true }) (instead of fullProve). [2]
  2. Override the typing (cast to any or add module augmentation) to allow a 4th/5th parameter—because the published DT types don’t include it. [1][2]

Sources: [1] [2]


Fix @types/snarkjs version mismatch with runtime API.

[email protected] supports singleThread in fullProve proverOptions (added Oct 2024, PR #517), but @types/[email protected] type definitions do not include the proverOptions parameter. This causes TypeScript compilation errors despite runtime compatibility. Either upgrade @types/snarkjs to a version that includes proverOptions, or refactor to use separate groth16.prove(..., { singleThread: true }) calls instead of fullProve.

🤖 Prompt for AI Agents
In `@package.json` at line 99, The TypeScript types for snarkjs are out of sync
with the runtime: you use snarkjs.fullProve with proverOptions (e.g.,
singleThread) but `@types/snarkjs` lacks that overload; either update the
`@types/snarkjs` package to a release that includes the proverOptions type, or
change calls to avoid fullProve with options by switching to groth16.prove (call
groth16.prove(..., { singleThread: true }) where you currently call
snarkjs.fullProve(..., { singleThread: true })) and adjust imports/usages
accordingly (references: snarkjs, fullProve, groth16.prove, proverOptions,
`@types/snarkjs`).

"@kynesyslabs/demosdk": "^2.8.22",
"@metaplex-foundation/js": "^0.20.1",
"@multiversx/sdk-core": "^13.17.2",
Expand Down Expand Up @@ -166,6 +166,7 @@
"@types/jest": "^29.5.14",
"@types/node": "^20.19.13",
"@types/node-forge": "^1.3.14",
"@types/snarkjs": "^0.7.9",
"jest": "^29.7.0",
"resolve-tspaths": "^0.8.23",
"ts-jest": "^29.4.1",
Expand Down
Loading