Replies: 6 comments 4 replies
-
what parts do you want to use in wasm? |
Beta Was this translation helpful? Give feedback.
-
@mattsse Many things are possible, but an execution layer in wasm would be awesome. It may be a bit too heavy to run through a browser, but as wasm can function almost as an OSI (Docker) container, it would create a portable execution layer.
I'm sure there are more that I am missing... |
Beta Was this translation helpful? Give feedback.
-
revm (the EVM impl we use) supports WASM. I don't think making all of reth support WASM makes a lot of sense at this stage since the requirements for running a node in the first place are pretty immense (100s of GB of disk space, good chunk of RAM). Maybe once state expiry/history expiry etc is a thing it would make more sense if the resources required to sync are diminished. It might make sense to support WASM for some of the individual crates like P2P(?). In that case we should track this individually for each crate with a reasoning |
Beta Was this translation helpful? Give feedback.
-
revm supports wasm? Awesome. It might make sense for P2P and other crates. More discussion required. |
Beta Was this translation helpful? Give feedback.
-
It is not currently possible to do this without heavy changes to how reth is structured right now since our database required mmap files which is not a concept in wasm at all. I'm not sure what the particular gain is of supporting wasm?
I'm not entirely sure if I understand this, but if you mean serverless as in e.g. AWS lambdas, it doesn't really make sense since you need to be "always online" in order to be caught up with the latest block
Could gating RPC behind e.g. an auth service not be "good enough"?
I'd just use revm here, revm also has a built-in ethers-rs provider that fetches state required to execute a block or tx on the fly. We use this in Foundry
I think this is the one we can discuss the most, but running an Eth node in the browser does not make sense to me since it again requires 100s of GB of storage, a lot of memory, and threads. If running in an extension, I could imagine a pretty abysmal slowdown of the browser - if running in a tab, it won't sync if the tab is suspended Maybe I am just lacking imagination here, but in any case I think this is far out in the future (given above constraints for the DB cannot hold in WASM) and requires a lot more careful thought. Because of that I will convert this to a discussion instead (we're trying to keep the issue tracker actionable) |
Beta Was this translation helpful? Give feedback.
-
one of the limiting factors is: there's no filesystem in wasm. however if you're interested in running evm in wasm, this is already possible |
Beta Was this translation helpful? Give feedback.
-
Describe the feature
I would love to be able to compile reth to web assembly. I think that could enable some interesting future development courses.
Additional context
Does anyone else here know much about web assembly and about the feasibility of such an undertaking?
This is a very open-ended issue, feel free to ask questions.
Beta Was this translation helpful? Give feedback.
All reactions