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

Semaphore package leaks handles, prevents node from exiting #318

Closed
dcposch opened this issue May 5, 2023 · 5 comments
Closed

Semaphore package leaks handles, prevents node from exiting #318

dcposch opened this issue May 5, 2023 · 5 comments
Labels
bug 🐛 Something isn't working good first issue Good for newcomers

Comments

@dcposch
Copy link
Contributor

dcposch commented May 5, 2023

Describe the bug

My Mocha unit tests hang unless I specify --exit to kill the test process after each suite.

It looks like this may be because Semaphore leaks some resources.

To Reproduce

Write any test or script that verifies a Semaphore proof. At the end, add:

const foo = (process as any)._getActiveHandles();
console.log(foo);

You'll see that this includes a bunch of mysterious MessagePort handles.

Expected behavior

Should show exactly two handles, corresponding to stdin/stdout.

Technologies (please complete the following information):

  • Node.js version 20
  • NPM version 9.6.4
  • Solidity version N/A
@dcposch dcposch added the bug 🐛 Something isn't working label May 5, 2023
@dcposch
Copy link
Contributor Author

dcposch commented May 5, 2023

Using @semaphore-protocol/{group,identity,proof} version 3.2.3

@vplasencia
Copy link
Member

Hello @dcposch! It seems to be related to snarkjs which is used in the @semaphore-protocol/proof package to generate and verify a proof.

@cedoor
Copy link
Member

cedoor commented Mar 29, 2024

#736 (comment)

This issue is related to snarkjs, but Semaphore could provide a function to "terminate" it.

@cedoor cedoor moved this from ♻️ Grooming to 🏗 In Progress in Semaphore Board Apr 26, 2024
@cedoor cedoor assigned cedoor and unassigned cedoor Apr 26, 2024
@cedoor cedoor moved this from 🏗 In Progress to ♻️ Grooming in Semaphore Board Apr 26, 2024
@cedoor cedoor added the good first issue Good for newcomers label Oct 3, 2024
@Chirag-S-Kotian
Copy link

is it solved or not?

@cedoor
Copy link
Member

cedoor commented Nov 20, 2024

Hi @Chirag-S-Kotian, we are actually going to close this issue. Devs can use ffjavascript to get the curve and terminate it:

curve = await getCurveFromName("bn128")

We'll add documentation to explain how to solve this issue.

Re: #897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working good first issue Good for newcomers
Projects
Status: ✔️ Done
Development

No branches or pull requests

4 participants