-
Notifications
You must be signed in to change notification settings - Fork 21
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
Problem with nightly and rustflags "+atomics" #6
Comments
With nightly + rustflags, reading and writing to the websocket results in an error. Steps to reproduceStep 0: Run notary and websockify as #6 (comment) Step 1: For extension, checkout to the branch
Step 2: Ensure
Step 3: Build and run. You should see "Error: Failed to write to websocket" in the console yarn build-and-start It works without rustflagsStep 4. Rename mv .cargo/config .cargo/config.bk
yarn build-and-start |
I've made a smaller example to reproduce: https://github.com/mhchia/test-ws-stream-wasm. Also, reported in najamelan/ws_stream_wasm#12 |
Thanks to the solution from @themighty1 to tlsnotary/tlsn-extension#6
Worked around by increasing wasm memory to 4GB |
Websocket error workaroundShout out again to @themighty1 for locating the issue in ws-stream-wasm and having a patch. With the patch, tlsn-extension can run without websocket errors, until prover is finalizing. Then, I encountered an error which looks an out-of-memory issue. I workaround it by increasing wasm memory to 4GB (4x the default value), and prover can work successfully. RayonBy adding back With 6~12 threads on my laptop ( Steps to reproduceStep 0: Run notary and websockify as #6 (comment) Step 1: For extension, checkout to the branch
Step 2: Ensure you're using nightly rust
Step 3: Change wasm memory to 4GB. Copy the following content and paste to
Step 4: Build and run yarn build-and-start You might see some warnings but it's fine Step 5: Open the browser (I've been using Chrome), visit http://localhost:8080/, and open the console. It should run successfully. ConcernsThis workaround only unblocks us to test if rayon can work in browser. Should try to find a better solution without increasing the memory, for example, a patch without oom happening. |
Now extension works with nightly and atomics. OOM issue is tracked in #13 . |
(Updated the instructions. Big thanks to @themighty1 for reproducing and finding the issues in these steps.)
What's wrong?
To bring back rayon, we need wasm-bindgen-rayon. It requires us to use nightly rust with rustflags for "+atomics,+bulk-memory,+mutable-globals"
Steps to Reproduce
Step 1: Open a new terminal. Build and run a websocket proxy
Step 2: Open a new terminal. Run a modified notary server in twitter example
Step 3: Clone the branch
mhchia/debugging-atomics-issue
from tlsnotary/tlsn-extension. Using this branch to debug so that we don't need to load the extension.Step 4: Use nightly rust by creating a file
rust-toolchain
with the contentnightly-2022-12-12
under tlsn-extension project root.Step 5: Add a file
.cargo/config
under tlsn-extension project root with the following content, as wasm-bindgen-rayon suggested.Step 6: Build the wasm and run the dev server
Step 7: Open the browser (I've been using Chrome), visit
http://localhost:8080/
, and open the console. You should seeand some logs, and then
You shouldn't be able to see
!@# 3
in the console.The text was updated successfully, but these errors were encountered: