Bitget App
Trade smarter
Buy cryptoMarketsTradeFuturesCopyBotsEarn

Parallel EVM: The Heart Surgery of High-Performance Layer 1

View original
律动BlockBeats律动BlockBeats2024/05/21 13:19
By:律动BlockBeats
Original Title: "Parallel EVM: The Heart Surgery of High-Performance Layer1"
Source: Xiaozhu Web3


EVM: The Core of Ethereum



The EVM (Ethereum Virtual Machine) is the core of Ethereum, responsible for running smart contracts and processing transactions.


Virtual machines are typically used for the virtualization of real computers, usually by a "hypervisor" (like VirtualBox) or an entire operating system instance (like Linux's KVM). They must provide software abstractions of actual hardware, system calls, and other kernel functions.


The EVM operates in a more limited domain: it is merely a computation engine, providing abstractions for computation and storage, similar to the Java Virtual Machine (JVM) specification. From a high-level perspective, the JVM aims to provide a runtime environment independent of the underlying host operating system or hardware, ensuring compatibility across various systems. Similarly, the EVM executes its own bytecode instruction set, typically compiled from Solidity.


The EVM is a quasi-Turing complete state machine, "quasi" because every execution step consumes a finite resource called Gas. Therefore, any given smart contract execution is limited to a finite number of computation steps, preventing potential infinite loops that could halt the entire Ethereum platform.


The EVM lacks scheduling capabilities; Ethereum's execution module extracts transactions from blocks, and the EVM is responsible for executing them sequentially. During execution, the latest world state is modified, and after a transaction is completed, the state is accumulated to the latest world state after the block is completed. The execution of the next block strictly depends on the world state after the previous block's execution, making it difficult to optimize Ethereum's linear transaction execution process for parallel execution.



In this sense, the Ethereum protocol stipulates that transactions are executed sequentially. While sequential execution ensures that transactions and smart contracts can be executed in a deterministic order, ensuring security, it can lead to network congestion and delays under high load, which is why Ethereum has significant performance bottlenecks and requires Layer2 Rollup scaling.


The Path to Parallelism in High-Performance Layer1



Most high-performance Layer1 solutions are designed to optimize the inability of Ethereum to process transactions in parallel. Here, we will only discuss optimizations at the execution layer, namely virtual machines and parallel execution.


Virtual Machines


The EVM is designed as a 256-bit virtual machine to facilitate Ethereum's hash algorithms, which explicitly produce 256-bit outputs. However, the actual computers running the EVM need to map these 256-bit bytes to the local architecture to execute smart contracts, making the entire system very inefficient and impractical. Therefore, high-performance Layer1 solutions often use virtual machines based on WASM, eBPF bytecode, or Move bytecode instead of the EVM.


WASM is a small, fast-loading, portable bytecode format based on sandbox security mechanisms. Developers can write smart contracts in various programming languages (C/C++, Rust, Go, AssemblyScript, JavaScript, etc.), compile them into WASM bytecode, and execute them. WASM has been adopted as a standard by many blockchain projects, including EOS, Dfinity, Polkadot (Gear), Cosmos (CosmWasm), Near, and Ethereum will also integrate WASM in the future to ensure a more efficient, simple execution layer suitable for a fully decentralized computing platform.


eBPF, originally BPF (Berkeley Packet Filter), was initially used for efficient filtering of network packets. It evolved into eBPF, providing a richer instruction set that allows dynamic intervention and modification of the operating system kernel's behavior without changing the source code. This technology later extended beyond the kernel, developing a user-space eBPF runtime with high performance, security, and portability. Smart contracts executed on Solana are compiled into SBF (based on eBPF) bytecode and run on its blockchain network.


Move is a new smart contract programming language designed by Diem, focusing on flexibility, security, and verifiability. The Move language aims to address security issues in assets and transactions, allowing assets and transactions to be strictly defined and controlled. The Move bytecode verifier is a static analysis tool that analyzes Move bytecode to determine whether it adheres to required type, memory, and resource safety rules, eliminating the need for runtime checks at the smart contract level. Aptos inherits Diem Move, while Sui uses a customized version of Sui Move to write its smart contracts.


Parallel Execution


Parallel execution in blockchain means processing unrelated transactions simultaneously. Unrelated transactions are considered independent events. For example, if two people trade tokens on different platforms, their transactions can be processed simultaneously. However, if they trade on the same platform, the transactions may need to be executed in a specific order.


The main challenge in achieving parallel execution is determining which transactions are unrelated and independent. Most high-performance Layer1 solutions rely on two methods: the state access method and the optimistic parallel model.


The state access method requires knowing in advance which part of the blockchain state each transaction can access, thereby analyzing which transactions are independent. Representative solutions include Solana and Sui.


In Solana, programs (smart contracts) are stateless because they cannot access (read or write) any state that persists throughout the transaction process. To access or maintain state, programs need to use accounts. Each transaction in Solana must specify which accounts will be accessed during transaction execution, allowing the transaction processing runtime to schedule non-overlapping transactions for parallel execution while ensuring data consistency.


In Sui Move, each smart contract is a module composed of functions and structures. Structures are instantiated within functions and can be passed to other modules through function calls. The runtime stores structure instances as objects, and there are three different types of objects in Sui: owner objects, shared objects, and immutable objects. Sui's parallelization strategy is similar to Solana's, with transactions also needing to specify which objects they operate on.


The optimistic parallel model operates under the assumption that all transactions are independent, only retrospectively verifying this assumption and making adjustments if necessary. A representative solution is Aptos.


Aptos uses the Block-STM (Block Software Transactional Memory) method to apply optimistic parallel execution. In Block-STM, transactions are first set up in a block in a certain order and then split among different processing threads for simultaneous execution. While processing these transactions, the system tracks the memory locations each transaction changes. After each round of processing, the system checks all transaction results. If it finds that a transaction touched a memory location changed by an earlier transaction, it erases its results and reruns it. This process continues until every transaction in the block is processed.


Parallel EVM



Parallel EVM (Parallel EVM) was proposed as early as 2021, referring to an EVM that supports processing multiple transactions simultaneously, aiming to improve the performance and efficiency of the existing EVM. Representative solutions include Polygon's parallel EVM based on Block-STM and the parallel EVM developed by BSC in collaboration with NodeReal.


However, by the end of 2023, Paradigm's CTO Georgios Konstantopoulos and Dragonfly's Haseeb Qureshi

Coincidentally, when looking ahead to the trends of 2024, parallel EVM was mentioned again, sparking interest in EVM-compatible Layer1s that have adopted parallel execution technology, including Monand and Sei V2.



Nowadays, EVM-compatible solutions on Solana like Neon, Ethereum SVM (Solana Virtual Machine) Layer2 Rollup Eclipse, Ethereum Move Virtual Machine Layer2 Rollup Lumio, and the modular execution layer Layer1 Fuel are all labeled as parallel EVM, creating a dazzling array of options.


I believe that only the following three categories can be reasonably defined as parallel EVM:


1. Parallel execution upgrades for EVM-compatible Layer1s that did not originally adopt parallel execution technology, such as BSC and Polygon;


2. EVM-compatible Layer1s that have adopted parallel execution technology, such as Monand, Sei V2, and Artela;


3. EVM-compatible solutions for non-EVM-compatible Layer1s that have adopted parallel execution technology, such as Solana Neon.


BSC and Polygon, as the most mainstream EVM-compatible Layer1s, need no further introduction. Here is a brief introduction to Monand, Sei V2, Artela, and Solana Neon.


Monad is a high-performance EVM-compatible Layer1 that uses a PoS mechanism, aiming to significantly enhance scalability and transaction speed through parallel execution. Monad Labs was founded by Keone Hon, former head of research at Jump Trading. Monad allows transactions to be executed in parallel within a block to improve efficiency. It uses an optimistic parallel model, starting new transactions before the previous step is completed. To address incorrect results, Monad tracks inputs/outputs and re-executes inconsistent transactions. A static code analyzer can predict dependencies, avoid invalid parallelism, and revert to a simple mode when uncertain. This parallel execution increases throughput while reducing the likelihood of transaction failures.


Sei is a Layer1 developed based on the Cosmos SDK, designed specifically for DeFi. The Sei team members have backgrounds in both technology and traditional finance, having worked at companies like Robinhood, Databricks, Airbnb, and Goldman Sachs. Sei V2 is a major upgrade to the Sei network, aiming to become the first fully parallel EVM. Like Monad, Sei V2 will use optimistic parallelization. This allows the blockchain to execute transactions simultaneously without developers needing to define any dependencies. When conflicts occur, the blockchain will track the storage parts touched by each transaction and re-run these transactions in order. This process will continue recursively until all unresolved conflicts are resolved.


Artela is a scalable blockchain network that enables developers to build feature-rich decentralized applications (dApps). Its core members come from AntChain. Artela's EVM++ represents high scalability + high performance parallel EVM, implemented in two phases. The first phase will be designed around parallel execution, ensuring network node computing power scalability through elastic computing, ultimately achieving elastic block space. Parallel execution will group transactions based on dependency conflict analysis to support parallel execution.


Solana Neon is a solution developed by Neon Labs for executing EVM transactions on Solana. Neon EVM is essentially a smart contract on Solana that implements an EVM interpreter compiled into SBF bytecode. Inside Neon EVM, an Ethereum transaction model and account model are implemented, allowing users to send transactions by paying EVM GAS fees. The Solana network fees are paid by Neon Proxy. Solana requires transactions to provide an account list, and wrapped transactions are no exception, so Neon Proxy's responsibilities include generating this account list, thereby gaining Solana's transaction parallel execution capability.



Additionally, similar to Solana Neon, there are other solutions like Near Aurora and EOS EVM+ that run EVM as a smart contract to achieve EVM compatibility. Theoretically, Aptos and Sui could also adopt this approach to achieve non-intrusive EVM compatibility, but I haven't found relevant information (perhaps Pontem is working on this?). If there are ongoing projects, feel free to contact me for updates. EVM compatibility allows developers to easily migrate their Ethereum applications to the chain without extensive modifications, making it a good direction for building the Aptos and Sui ecosystems.


Summary


Parallel technology in blockchain has been a recurring topic, with the narrative resurfacing periodically. However, most current developments are modifications and imitations of the optimistic execution model represented by Aptos' Block-STM mechanism, without substantial breakthroughs, making it difficult to sustain interest.


Looking ahead, more emerging Layer1 projects will join the competition for parallel EVM, and some older Layer1s will achieve parallel EVM upgrades or EVM-compatible solutions. Both directions lead to the same goal, and more new narratives related to performance improvements will emerge.


However, compared to the narrative of high-performance EVM, I still hope that blockchain can flourish with diverse narratives like WASM, SVM, and Move VM.


Original link


Welcome to join the official Rhythm BlockBeats community:

Telegram subscription group: https://t.me/theblockbeats

Telegram discussion group: https://t.me/BlockBeats_App

Twitter official account: https://twitter.com/BlockBeatsAsia

0

Disclaimer: The content of this article solely reflects the author's opinion and does not represent the platform in any capacity. This article is not intended to serve as a reference for making investment decisions.

PoolX: Stake to earn
APR up to 10%. Always on, always earning.
Stake now!

You may also like

The Daily: Binance launches pre-market spot trading, Caroline Ellison gets sentenced to two years in prison, Hamster Kombat teases roadmap and more

Binance has launched a pre-market spot trading service that uses “actual tokens.”Former Alameda CEO Caroline Ellison was sentenced to two years in prison for her role in the collapse of FTX.Hamster Kombat teased token buybacks, NFTs and the launch of a web app ahead of its highly-anticipated airdrop.The following article is adapted from The Block’s newsletter, The Daily, which comes out on weekday afternoons.

The Block2024/09/25 17:51

Friday's end-of-month bitcoin options expiry could trigger significant market volatility: Deribit

Friday’s end-of-month bitcoin options expiry could significantly impact market volatility, according to Deribit CEO Luuk Strijers.Major cryptocurrencies, such as bitcoin and ether, have traded flat over the past 24 hours.

The Block2024/09/25 16:44