Recent Artilces

Virtual Machine Architecture

Virtual Machine Architecture

← All Topics

VMManager is at the core of V8VM. It has three main features:

  • VM Entrance. It interfaces external requests from other modules, including RPC requests, block validation, Tx validation, etc. The work is handed off to VMWorker after preprocessing and formatting.
  • VMWorker lifecycle management. The number of workers are set dynamically based on system load. It achieves reuse of workers. Within the workers, JavaScript hot launch and persistence of hotspot Sandbox snapshots help reduce frequent creation of VMs, and avoid heavy load in CPU and memory when the same code is loaded. This will increase the throughput of the system, allowing the IOST V8VM to breathe even when processing contracts with a massive user base, such as fomo3D.
  • Management of interface with State database. This ensures atomicity of each IOST transaction, denying the entire transaction when there is an error of insufficient funds. At the same time, two-level cache is achieved in the State database, before being flushed to RocksDB.

Next Virtual Machine Basics