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

change to permanent urls #107

Merged
merged 2 commits into from
Sep 27, 2023
Merged

Conversation

0xnakai
Copy link
Contributor

@0xnakai 0xnakai commented Sep 23, 2023

#100

What's wrong?

Right now we're using a temporary resource, as mentioned in

rlnjs/src/resources.ts

Line 13 in 7a4a5af

How to fix

Problem

If you try "npm test", one test fails out of seven.
That's because the below wasm link produce a "r1cs" file.
Now, people in trusted setup team are researching the cause.

Test Error Meassage

nt@MacBook-Air rlnjs % npm test

> [email protected] test
> jest

 PASS  tests/field-artithmetics.test.ts
 PASS  tests/message-id-counter.test.ts
 PASS  tests/cache.test.ts (6.75 s)
 PASS  tests/circuit-wrapper.test.ts (6.959 s)
 PASS  tests/rln-registry.test.ts (27.872 s)
 PASS  tests/contract.test.ts (53.345 s)
 FAIL  tests/rln.test.ts (54.942 s)
  ● RLN › functionalities › should be able to create proof

    CompileError: WebAssembly.compile(): expected magic word 00 61 73 6d, found 72 31 63 73 @+0



A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                            
------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
All files               |   81.79 |    57.14 |   77.61 |   82.82 |                                                                                              
 src                    |   80.34 |    58.49 |   77.39 |   80.57 |                                                                                              
  cache.ts              |   94.23 |     87.5 |   88.88 |   93.47 | 154,161-162                                                                                  
  circuit-wrapper.ts    |   97.36 |    66.66 |     100 |   96.87 | 132                                                                                          
  common.ts             |     100 |      100 |     100 |     100 |                                                                                              
  contract-wrapper.ts   |   92.15 |       75 |   88.23 |    90.9 | 97-100,107,149,179-180                                                                       
  index.ts              |     100 |      100 |   15.38 |     100 |                                                                                              
  message-id-counter.ts |     100 |      100 |     100 |     100 |                                                                                              
  registry.ts           |   70.52 |     43.9 |   82.14 |   70.83 | 50,60,79-81,106,113,120,126-140,144-151,155-166,218,239,249,253,261-270                      
  resources.ts          |   82.35 |       25 |     100 |   97.36 | 36                                                                                           
  rln.ts                |   67.29 |    57.37 |   68.18 |   67.12 | ...9,212,381,386-387,404,455,468,475-476,486,497,507,529-543,556,562-585,595-597,601-603,614 
 tests                  |    87.5 |    47.82 |   78.94 |   92.12 |                                                                                              
  configs.ts            |      70 |        0 |     100 |     100 | 10-18                                                                                        
  factories.ts          |   94.25 |    66.66 |      80 |   92.85 | 36,43,64,103,112                                                                             
  utils.ts              |   86.04 |      100 |   71.42 |   86.11 | 18,42-45                                                                                     
------------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------
Test Suites: 1 failed, 6 passed, 7 total
Tests:       1 failed, 45 passed, 46 total
Snapshots:   0 total
Time:        55.898 s
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?

@0xnakai
Copy link
Contributor Author

0xnakai commented Sep 23, 2023

Is it ok to use main as the branch to merge into?

@mhchia
Copy link
Member

mhchia commented Sep 23, 2023

It's all good :) Thanks for the PR!

Copy link
Member

@mhchia mhchia left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and great work! I've asked our trusted setup team about the wasm files. Would you want to try supporting different tree depths? For example, right now we only support depth=20. With some changes we can support tree depths from 16 to 32, as the resources described in #100 (comment).

src/resources.ts Outdated
const verificationKeyURL = `${url}/verification_key.json`
const wasmFileURL = `${url}/RLN-20.wasm`
const finalZkeyURL = `${url}/contributions/rln-20_final.zkey`
console.log(url)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log(url)

Could you remove the console.logs?

src/resources.ts Outdated
const wasmFileURL = `${url}/RLN-20.wasm`
const finalZkeyURL = `${url}/contributions/rln-20_final.zkey`
console.log(url)
console.log(wasmFileURL)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log(wasmFileURL)

src/resources.ts Outdated
const finalZkeyURL = `${url}/contributions/rln-20_final.zkey`
console.log(url)
console.log(wasmFileURL)
console.log(finalZkeyURL)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log(finalZkeyURL)

@mhchia mhchia linked an issue Sep 25, 2023 that may be closed by this pull request
@mhchia
Copy link
Member

mhchia commented Sep 25, 2023

All the wasm files should be correct now :) I verified that they are all in wasm format

@0xnakai
Copy link
Contributor Author

0xnakai commented Sep 27, 2023

Thank you for checking!
I deleted "console.log" and pushed again.

Would you want to try supporting different tree depths? For example, right now we only support depth=20.

No, I wouldn't.

@mhchia mhchia merged commit 17a6a76 into Rate-Limiting-Nullifier:main Sep 27, 2023
2 of 3 checks passed
@mhchia
Copy link
Member

mhchia commented Sep 27, 2023

Merged it. Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use resources after trusted setup
2 participants