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

feat(wasm): Run Lumina in a Shared Worker #265

Merged
merged 40 commits into from
Jun 25, 2024

Conversation

fl0rek
Copy link
Member

@fl0rek fl0rek commented Apr 9, 2024

This PR introduces several features:

  • either SharedWorker or Worker is spawned for the lumina instance, so that we no longer run in main "GUI" thread.
  • NodeDriver replaces WasmNode and is responsible for steering actual lumina node running inside a Worker. Multiple tabs from the same context can access the same lumina instance. After spawning the shared worker, NodeDriver establishes a request-response communication channel over JS primitives.
  • Node inside the SharedWorker has server-like infrastructure. onconnect event means that a new connection happened and we're supposed to use event.port[0] to communicate with a newly connected NodeDriver by responding with results of the command we're sent.
  • Node inside Worker has simplified architecture, since it doesn't need to handle new tabs connecting, but otherwise works the same

@zvolin zvolin requested review from aaadamgo, oblique and zvolin April 9, 2024 10:08
@fl0rek fl0rek force-pushed the feat/wasm-node-in-worker branch from ddb3ea8 to ac8c77e Compare April 11, 2024 08:10
@fl0rek fl0rek marked this pull request as ready for review April 15, 2024 07:51
node-wasm/src/node.rs Outdated Show resolved Hide resolved
node-wasm/src/worker/channel.rs Outdated Show resolved Hide resolved
cli/static/worker.js Outdated Show resolved Hide resolved
node-wasm/src/worker.rs Outdated Show resolved Hide resolved
node-wasm/src/node.rs Outdated Show resolved Hide resolved
node-wasm/src/worker/channel.rs Outdated Show resolved Hide resolved
node-wasm/src/worker/channel.rs Outdated Show resolved Hide resolved
node-wasm/src/utils.rs Outdated Show resolved Hide resolved
node-wasm/src/node.rs Outdated Show resolved Hide resolved
node/src/p2p.rs Outdated Show resolved Hide resolved
node-wasm/src/utils.rs Outdated Show resolved Hide resolved
node-wasm/src/worker.rs Outdated Show resolved Hide resolved
node-wasm/src/worker.rs Outdated Show resolved Hide resolved
node-wasm/src/worker.rs Outdated Show resolved Hide resolved
node-wasm/src/worker.rs Outdated Show resolved Hide resolved
node-wasm/src/worker.rs Outdated Show resolved Hide resolved
@zvolin zvolin force-pushed the feat/wasm-node-in-worker branch from d9b19f6 to 0495d05 Compare May 10, 2024 13:38
node-wasm/src/worker/channel.rs Outdated Show resolved Hide resolved
node-wasm/src/worker/channel.rs Show resolved Hide resolved
@fl0rek fl0rek force-pushed the feat/wasm-node-in-worker branch from 7fe0397 to d3a2c92 Compare May 16, 2024 11:56
node-wasm/js/worker.js Outdated Show resolved Hide resolved
node-wasm/src/node.rs Show resolved Hide resolved
node-wasm/Cargo.toml Outdated Show resolved Hide resolved
node-wasm/Cargo.toml Outdated Show resolved Hide resolved
node-wasm/Cargo.toml Outdated Show resolved Hide resolved
node-wasm/Cargo.toml Show resolved Hide resolved
node-wasm/Cargo.toml Outdated Show resolved Hide resolved
node-wasm/src/node.rs Outdated Show resolved Hide resolved
node-wasm/src/worker/channel.rs Outdated Show resolved Hide resolved
node-wasm/src/utils.rs Outdated Show resolved Hide resolved
node-wasm/src/utils.rs Show resolved Hide resolved
node-wasm/src/utils.rs Outdated Show resolved Hide resolved
fl0rek and others added 3 commits June 22, 2024 13:06
node-wasm/src/utils.rs Outdated Show resolved Hide resolved
@fl0rek fl0rek force-pushed the feat/wasm-node-in-worker branch from 2a09295 to d93a126 Compare June 24, 2024 06:40
Copy link
Member

@zvolin zvolin left a comment

Choose a reason for hiding this comment

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

🚀

@zvolin zvolin merged commit e932d3e into eigerco:main Jun 25, 2024
6 checks passed
@zvolin zvolin mentioned this pull request Jun 25, 2024
@zvolin zvolin mentioned this pull request Jul 5, 2024
@zvolin zvolin mentioned this pull request Jul 25, 2024
@zvolin zvolin mentioned this pull request Aug 13, 2024
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.

3 participants