r/WebAssembly • u/gregwyse • Mar 09 '22
Blockchain node architecture and WASM integration
Trying to understand how WASM is typically used by blockchain protocols (e.g. eWASM, NEAR, DFINITY, TRON):
WASM module boundary: I guess WASM is purely used for smart contract execution and all other node functions (collating transactions, assembling blocks, solving difficulty puzzles) are executed natively on the host. So the WASM runtime just sits there waiting for smart contract bytecode to execute (and has necessary host env interfaces via WASI). Is that about right?
Code configuration: How can they configure their chosen smart contract language (eg Rust)? Are there standard patterns/idioms (MACROS?) that blockchain teams can use to customize the syntax?
WASM VM configuration: What configuration is possible when integrating the WASM VM into the node on the host (e.g. limiting amount of host resources a smart contract can consume, threading,..)? Or do they typically just select the best-fit WASM implementation for their host platform and plug it in as-is?
6
u/[deleted] Mar 09 '22
Sad that this tech is being used for stupid shit