zkparty / trusted-setup-frontend

The KZG Ceremony web browser implementation
https://ceremony.ethereum.org
229 stars 66 forks source link

Computation does not complete in Tor browser. #106

Closed glamperd closed 1 year ago

glamperd commented 1 year ago

Reported by Joseph C. 'Seems to get stuck on Bind Your Contribution'

NicoSerranoP commented 1 year ago

I just ran a contribution using the Tor feature with Brave and it worked fine. I have a feeling that the "Bind Your Contribution" might have been broken today because in the morning we decided to purge the Infura node that we were using. This might have caused some issues with different wallet providers in the "Bind Your Contribution"

How could we contact Joseph C. to ask him to contribute again and see if the issue got fixed?

glamperd commented 1 year ago

I tried using Tor v12.0. It failed at Bind Your Contribution (COOP/COEP header issue) but the root cause is that the service worker was not allowed to load. image

glamperd commented 1 year ago

Tor v12 is based on Firefox 102.5, which does support service workers.

glamperd commented 1 year ago

The default config for Tor does not allow service workers. Go to about:config, set dom.serviceWorkers.enable to true. Also, don't start in private mode, which is the default. https://firefox-source-docs.mozilla.org/devtools-user/about_colon_debugging/index.html#service-workers-not-compatible

Problems remain even after this: Worker registration failed DOMException: The operation is insecure.

glamperd commented 1 year ago

The above error is removed when this setting is cleared: Delete cookies and site data when Tor Browser is closed.

New error: DataCloneError: Worker.postMessage: The WebAssembly.Memory object cannot be serialized. The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers can be used to enable this.

NicoSerranoP commented 1 year ago

Sorry I was closing the completed issues. Should we close this one? I think Tor has too many security restrictions to allow us to run WASM and service workers

glamperd commented 1 year ago

I was going to give it 1 more try. In theory Tor is Firefox, so it should work if the config is just right.

glamperd commented 1 year ago

Tried a few more options, but haven't found anything to move past this. Won't fix.