Ten thousand words to interpret parallel EVM: How to break through the blockchain performance bottleneck?

All articles11个月前发布 wyatt
71 0 0
Parallel EVM is a new narrative that emerges when on-chain transaction volume develops to a certain level.

Written by: @leesper6

Instructor: @CryptoScott_ETH

TL;DR

  1. Parallel EVM is a new narrative that emerges after the on-chain transaction volume develops to a certain extent. Parallel EVM is mainly divided into singleBlockchainand modularityBlockchain.monomerBlockchainIt is divided into L1 and L2 . Parallel L1 public chains are divided into two camps: EVM and non-EVM. Currently, the parallel EVM narrative is in the early stages of development;

  2. 拆解并行 EVM 的技术实现路径,主要包含虚拟机和并行执行机制两大方面。在区块链的语境下,虚拟机是指对分布式状态机进行虚拟的进程虚拟机,用于执行contract;

  3. Parallel execution means taking advantage of multi-core processors to execute multiple transactions at the same time as much as possible, while ensuring that the final state is consistent with the result of serial execution;

  4. Parallel execution mechanisms are divided into three categories: message passing, shared memory, and strict state access lists. Shared memory is further divided into memory lock model and optimistic parallelization. Either mechanism increases the complexity of the technology;

  5. The parallel EVM narrative has both intrinsic driving factors for industry growth and the need for practitioners to pay close attention to its possibleSafetyquestion;

  6. Each target project of Parallel EVM provides parallel execution ideas in different ways, with both common technologies and unique achievements.

1. Industry Overview

1.1 Historical evolution

Performance has become a bottleneck for further development of the industry.Blockchain networks create a new, decentralized foundation of trust for individuals and businesses to conduct transactions.

The first generation of blockchain networks represented by Bitcoin pioneered a new decentralized electronic currency transaction model through distributed accounting, revolutionizing a new era. The second generation of blockchain networks represented by Ethereum gave full play to imagination and proposed to realize decentralized applications (dApp) through distributed state machines.

Since then, the blockchain network has started its own rapid development history of more than a decade, from Web3 infrastructure to various tracks represented by DeFi, NFT, social networks and GameFi, and countless innovations in technology or business models have been born. The booming development of the industry requires constantly attracting new users to participate in the ecological construction of decentralized applications, which in turn puts higher requirements on product experience.

As a new product form that is unprecedented in history, Web3 must not only innovate in meeting user needs (functional needs), but also consider how toSafetyA balance between safety and performance (non-functional requirements). Since its inception, people have proposed various solutions to try to solve the performance problem.

These solutions can be roughly divided into two categories: one is on-chain expansion solutions, such as sharding and directed acyclic graphs (DAG); the other is off-chain expansion solutions, such as Plasma, Lightning Network, side chains and Rollups, etc. However, this is far from keeping up with the rapid growth of on-chain transactions.

Especially after the DeFi Summer in 2020 and the continued explosion of inscriptions in the Bitcoin ecosystem at the end of 2023, the industry urgently needs new performance improvement solutions to meet the requirements of "high performance and low fees". Parallel blockchain was born in this context.

万字解读并行 EVM :如何突破区块链性能瓶颈?

1.2 Market size

The parallel EVM narrative marks the formation of a two-horse race in the parallel blockchain space.Ethereum processes transactions serially, and transactions must be executed one by one in order, which results in low resource utilization. Changing the serial processing method to parallel processing will greatly improve performance.

Ethereum competitors such as Solana, Aptos, and Sui all have built-in parallel processing capabilities, and their ecosystems are also developing very well.TokenThe market capitalizations of the two companies reached 45 billion, 3.3 billion and 1.9 billion US dollars respectively, formingParallel non-EVM campFaced with the challenge, the Ethereum ecosystem is not to be outdone and has stepped forward to empower EVM.Parallel EVM Camp.

Sei has made a high-profile claim in its v2 upgrade proposal that it will become the "first parallel EVM blockchain". Its current circulating market value is $2.1 billion, and it is expected to have greater development. Monad, the new parallel EVM public chain with the highest marketing popularity, is very popular with capital, and its potential should not be underestimated. Canto, the L1 public chain with a market value of $170 million and its own free public infrastructure, has also announced its own parallel EVM upgrade proposal.

In addition, a number of L2 The project is also providing cross-ecological performance improvements by integrating the capabilities of multiple L1 chains. Except for Neon, which has achieved a circulating market value of 69 million US dollars, other projects still lack relevant data. I believe that there will be more L1 and L2 The project joins the parallel blockchain battlefield.

万字解读并行 EVM :如何突破区块链性能瓶颈?

Not only does the parallel EVM narrative have a lot of room for market growth, but the parallel blockchain sector to which the parallel EVM narrative belongs also has a lot of room for market growth, so the market prospects are broad.

At present, the total market value of L1 and L2 is 752.123 billion US dollars, and the market value of parallel blockchain is 52.539 billion US dollars, accounting for only about 7%. Among them, the market value of parallel EVM narrative-related projects is 2.339 billion US dollars, accounting for only 4% of the market value of parallel blockchain.

万字解读并行 EVM :如何突破区块链性能瓶颈?

1.3 Industry Map

The industry generally divides blockchain networks into four layers:

  1. Layer 0 (Network):The underlying network of the blockchain handles basic network communication protocols

  2. Layer 1 (Infrastructure):A decentralized network that relies on various consensus mechanisms to verify transactions

  3. Layer 2 (Extended):Various Layer 2 protocols that rely on Layer 1 are designed to address various limitations of Layer 1, especially scalability

  4. Layer 3 (Application):Depends on Layer 2 or Layer 1 to build various decentralized applications (dApp)

Parallel EVM narrative projects are mainly divided into monolithic blockchains and modular blockchains, and monolithic blockchains are further divided into L1 and L2.Judging from the total number of projects and the development of several major tracks, the parallel EVM L1 public chain ecosystems still have a lot of room for development compared to the Ethereum ecosystem.

The DeFi track has the demand for "high speed and low fees", and the game track has the demand for "strong real-time interaction", both of which have certain requirements for execution speed. Parallel EVM will inevitably bring better user experience to these projects and promote the development of the industry into a new stage.

L1 is a new public chain with built-in parallel execution capabilities and a high-performance infrastructure. In the L1 camp, projects represented by Sei v2, Monad and Canto designed their own parallel EVM, which is compatible with the Ethereum ecosystem and provides high-throughput transaction processing capabilities.

L2 integrates the capabilities of other L1 chains to provide cross-ecological expansion capabilities, which is the mainstream of rollup. In the L2 school, Neon is an EVM simulator on the Solana network, and Eclipse uses Solana to execute transactions but settles on the EVM. Lumio is similar to Eclipse, but the execution layer is replaced by Aptos.

万字解读并行 EVM :如何突破区块链性能瓶颈?

In addition to the above-mentioned single blockchain solutions, Fuel has proposed its own modular blockchain idea. It will position itself asEthereum rollup operating system, providing more flexible and thorough modular execution capabilities.

Fuel focuses on executing transactions and outsources the rest to one or more independent layers of blockchains, allowing for a more flexible combination: it can be either L2, L1, or even a side chain or state channel. Currently, there are 17 projects in the Fuel ecosystem, mainly focusing on three areas: DeFi, NFT, and infrastructure.

However, only the Orally cross-chain oracle has been put into practical use.contractThe trading platform SPARK has been launched on the testnet, and other projects are still under development.

万字解读并行 EVM :如何突破区块链性能瓶颈?

2. Technical Implementation Path

To achieve decentralized transaction execution, a blockchain network must fulfill four responsibilities:

  • Execution: Execute and verify transactions

  • Data availability: Distribute new blocks to all nodes in the blockchain network

  • Consensus mechanism: verify blocks and reach consensus

  • Settlement: Settle and record the final status of the transaction

Parallel EVM mainly optimizes the performance of the execution layer.This can be divided into two types: Layer 1 (L1) solutions and Layer 2 (L2) solutions. The L1 solution introduces a transaction parallel execution mechanism to allow transactions to be executed in parallel as much as possible in the virtual machine. The L2 solution essentially uses the already parallelized L1 virtual machine to achieve a certain degree of "off-chain execution + on-chain settlement".

Therefore, to understand the technical principles of parallel EVM, we need to break it down: first understand what a virtual machine is and then understand what parallel execution is.

2.1 Virtual Machine

In computer science, a virtual machine refers to the virtualization or emulation of a computer system.

There are two types of virtual machines: one is called a system virtual machine, which can virtualize a physical machine into multiple machines and run multiple operating systems, thereby improving resource utilization. The other is called a process virtual machine, which provides abstraction for certain high-level programming languages, allowing computer programs written in these languages to run on different platforms in a platform-independent manner.

JVM is a process virtual machine designed for Java programming language. Programs written in Java language are first compiled into Java bytecode (an intermediate binary code), which is interpreted and executed by JVM: JVM sends the bytecode to the interpreter, which translates it into machine code on different machines and then runs it on the machine.

区块链虚拟机是进程虚拟机的一种。在区块链的语境下,虚拟机是指对分布式状态机进行的虚拟,用于分布式地执行contract,运行 dApp 。类比 JVM , EVM 就是一种为 Solidity 语言设计的进程虚拟机,智能合约首先被编译成 opcode 字节码,然后由 EVM 解释执行。

When implementing their own virtual machines, emerging public chains other than Ethereum tend to use virtual machines based on WASM or eBPF bytecode. WASM is a small, fast-loading, portable, and sandbox-based virtual machine.SafetyThe bytecode format of the mechanism allows developers to write smart contracts in a variety of programming languages (C, C++, Rust, Go, Python, Java, and even TypeScript, etc.), and then compile them into WASM bytecode and execute them. The smart contracts executed on the Sei public chain use this bytecode format.

The predecessor of eBPF was BPF (Berkeley Packet Filter), which was originally used for efficient filtering of network data packets. It later evolved into eBPF, providing a richer instruction set.

It is a revolutionary technology that allows dynamic intervention and modification of the operating system kernel without changing the source code. Later, this technology came out of the kernel and developed the user-mode eBPF runtime, which has high performance,SafetyAnd portability. Smart contracts executed on Solana are compiled into eBPF bytecode and run on its blockchain network.

Among other L1 public chains, Aptos and Sui use the Move smart contract programming language, which is compiled into a unique bytecode and executed on the Move virtual machine. Monad designed its own virtual machine that is compatible with the EVM opcode bytecode (Shanghai fork).

万字解读并行 EVM :如何突破区块链性能瓶颈?

2.2 Parallel Execution

Parallel execution is a technique that:

  1. Able to take advantage of multi-core processors to process multiple tasks simultaneously and increase system throughput;

  2. Ensure that the transaction results are exactly the same as when the transactions are executed serially.

Blockchain networks often use TPS (transactions per second) as a technical indicator to measure processing speed. The mechanism of parallel execution is relatively complex and also tests the technical level of developers. It is not easy to explain it clearly. Let's start with an example of a "bank" to explain what parallel execution is.

(1) First, what is serial execution?

Case 1: If we regard the system as a bank and the CPU that processes tasks as a counter, then the serial execution of tasks is like this bank having only one counter to handle business. At this time, customers (tasks) who come to the bank to handle business can only line up in a long queue and handle business one by one. For each customer, the counter staff must repeat the same action (execute instructions) to handle business for the customer. When it is not their turn, the customer can only wait, which prolongs the transaction time.

(2) So what is parallel execution?

Situation 2: Seeing that the bank was overcrowded, it opened a few more counters to handle business. With 4 tellers handling business at the same time, the speed was about 4 times faster than before. Then the customer's waiting time was reduced to about 1/4 of the original time, and the bank's business processing speed was improved.

(3) If no protection is provided, what errors may occur if two people transfer money to each other at the same time?

Case 3: A, B and C have 2 ETH, 1 ETH and 0 ETH in their accounts respectively. Now A and B want to transfer 0.5 ETH to C respectively. In a system where transactions are executed serially, there will be no problems (the left arrow "" indicates writing to the ledger, the same below):

万字解读并行 EVM :如何突破区块链性能瓶颈?

But parallel execution is not as simple as it seems. There are many subtle details that can lead toVery serious error.If A and B's transfer transactions to C are executed in parallel, inconsistent results may occur depending on the order in which each step is executed:

万字解读并行 EVM :如何突破区块链性能瓶颈?

Parallel task 1 performs a transfer from A to C, and parallel task 2 performs a transfer from B to C. The steps marked with * in the table are problematic: because the tasks are executed in parallel, the balance calculation done by parallel task 1 in step 2 has not been written into the ledger in time, and task 2 reads C's account balance (still 0 at this time) in step 3, and performs an incorrect balance calculation based on the balance of 0 in step 5, and then in the ledger update operation in step 6, the account balance of 0.5 that has been updated in step 4 is incorrectly updated to 0.5 again. As a result, although A and B both transferred 0.5 ETH to C at the same time, after the transaction is completed, C's account balance is only 0.5 ETH, and the other 0.5 ETH is missing.

(4) If no protection is provided, two tasks without dependencies can be executed in parallel without error.

Case 4: Parallel Task 1 executes A (balance 2 ETH) to transfer 0.5 ETH to C (balance 0 ETH), and Parallel Task 2 executes B (balance 1 ETH) to transfer 0.5 ETH to D (balance 0 ETH). You can see that there is a huge difference between the two transfer tasks.No dependencies.Then no matter how the steps of the two tasks are interleaved, there will be no above problems:

万字解读并行 EVM :如何突破区块链性能瓶颈?

From the comparison of the two scenarios, it can be analyzed that as long as there isrely, when executed in parallel, state update errors may occur, otherwise no errors will occur. If one of the following two conditions is met, the tasks (transactions) are said to be dependent on each other:

  1. The output address written by one task is the input address read by another task;

  2. Both tasks output to the same address.

This is not unique to decentralization. Any scenario involving parallel execution will result in data inconsistency due to unprotected access to shared resources (the "ledger" in the bank example, shared memory in a computer system, etc.) between multiple dependent tasks, which is called data inconsistency.Data races.

The industry has proposed three execution mechanisms to solve the race condition problem of parallel execution:Message passing mechanism, shared memory mechanism and strict state access list mechanism.

2.3 Message Passing Mechanism

Situation 5: Assume that a bank has 4 counters that handle business for customers at the same time. Now each of the 4 counter tellers is given a dedicated account book, which only they can modify. The account book records the account balances of the customers they serve.

When each teller is handling business for a customer, if the customer's information can be found in his or her account book, then he or she will handle it directly; otherwise, he or she will call out to other tellers to inform them of the business the customer wants to handle, and the other tellers will handle it after hearing it.

This is how the message passing model works.Actor ModelIt is a kind of message passing model. Each executor responsible for processing transactions is an actor (teller). They all have access to their own private data (exclusive ledger). If they want to access other people's private data, they can only do so by sending messages.

万字解读并行 EVM :如何突破区块链性能瓶颈?

The advantage of the Actor model is that each actor can only access its own private data, so there will be no race condition problems.

It has two disadvantages. First, each actor can only be executed serially, and in some scenarios it does not take advantage of parallelism (for example, tellers 2, 3, and 4 simultaneously send messages to teller 1 asking what the account balance of customer A is. In such a model, teller 1 can only process messages one by one, which could have been processed in parallel).

Second, there is no global information about the current system status. If the system business is complex, it will be difficult to understand the overall picture, locate and fix bugs.

2.4 Shared Memory Mechanism

2.4.1 Memory Lock Model

Scenario 6: Suppose a bank has only one large ledger that records the account balances of all customers. There is only a signature pen next to the ledger that can be used to modify the ledger.

In this scenario, when the four tellers are handling business, it depends on who runs faster: one teller grabs the signature pen (locked) first and starts to handle business and modify the account book, and the other three tellers can only wait. Until the teller puts down the pen (unlocked) after using it, the other three tellers will compete for the right to use the signature pen, and the cycle continues. This isMemory lock model (memory locks).

Memory lock is to make parallel tasks perform a lock operation when accessing shared resources. After locking, they can access the shared resources. At this time, other tasks must wait for it to be modified and unlocked before they can lock and access again.

read-write lockThe processing is more refined, and shared resources can beRead lockorWrite lockThe difference is that multiple parallel tasks can add multiple read locks and read shared resource data, and modifications are not allowed at this time; while only one write lock can be added, and after adding it, it can only be accessed exclusively by the lock holder.

万字解读并行 EVM :如何突破区块链性能瓶颈?

Solana, Sui, and Sei v1 use a shared memory model based on memory locks. This mechanism looks simple, but it is complex to implement and tests the developer's ability to master multi-threaded programming. If you are not careful, you will leave behind various bugs:

  1. Case 1: The task locks the shared resource, but crashes and exits due to an error during execution, and the shared resource is locked and cannot be accessed;

  2. Case 2: The task has been locked, but during execution, it is locked again due to nested business logic, causing it to wait for itself.

The memory lock model is most likely to appearDead lock, live lock, and starvationAnd other questions:

(1) Multiple parallel tasks compete for multiple shared resources. Each task occupies a part of them and waits for the other to release the resources, which will cause deadlock.

(2) When parallel tasks detect that other parallel tasks are active, they proactively give up the shared resources they occupy, resulting in a live lock.

(3) Parallel tasks with high priority can always obtain access to shared resources, while other low-priority tasks have to wait for a long time, resulting in "starvation".

万字解读并行 EVM :如何突破区块链性能瓶颈?

2.4.2 Optimistic Parallelism

Situation 7: Each of the four tellers in a bank can independently check and modify the account book when handling business, regardless of whether other tellers are using the account book. When using the account book, the teller will put a personal exclusive label on the content that he has checked and modified. After each business is completed, he will review it again. If he finds that the label is not his own, it means that the record has been modified by other tellers, and the business will be invalidated and re-handled.

This isOptimistic ParallelismThe core idea of optimistic parallelization isAssume that all tasks are independent of each other.. First execute the tasks in parallel, then verify each task. If the verification fails, execute the task again until all tasks are completed. Assume that there are 8 parallel tasks executed in an optimistic parallelization manner, and they need to access 2 shared resources A and B during the process.

When executing phase 1, Task 1, Task 2, and Task 3 are executed in parallel. However, Task 2 and Task 3 access shared resource B at the same time, which creates a conflict. Therefore, Task 3 is rescheduled for execution in the next phase. When executing phase 2, Task 3 and Task 4 access shared resource B at the same time. At this time, Task 4 is rescheduled for execution, and so on, until all tasks are executed. It can be seen that the conflicting tasks will be repeatedly executed throughout the process.

万字解读并行 EVM :如何突破区块链性能瓶颈?

The optimistic parallelization model adopts aMulti-version in-memory data structureUsed to record each written value and its version information (similar to a bank teller sticking a label).

The operation of each parallel task is divided into two phases: execution and validation. In the execution phase, all data read and write behaviors are recorded to form read sets and write sets. In the validation phase, the read sets and write sets are compared with the multi-version data structure. If the comparison finds that they are not the latest, the validation fails.

The optimistic parallelization model originated fromSoftware Transaction Memory (STM), which is a mechanism for lock-free programming in the database field. Since the blockchain network naturally has a certain order in processing transactions, this concept was introduced and evolved into the Block-STM mechanism. Aptos and Monad use Block-STM as their parallel execution mechanism.

It is worth mentioning that the Sei public chain has abandoned the original memory lock model in the upcoming v2 version and adopted an optimistic parallelization model. Block-STM has an extremely fast execution speed. In the experimental environment, the Aptos transaction execution speed reached an astonishing 160k tps, which is 18 times faster than sequential execution of transactions.

Block-STM leaves complex transaction execution and verification to the core team that implements the underlying mechanism, allowing developers to effortlessly write smart contracts like writing sequentially executed programs.

2.5 Strict Stateful Access List

The message passing and shared memory mechanisms are based onAccount/BalanceThe data model is implemented, which records the balance information of each account on the chain. Just like the bank's account book records that customer A has a balance of 1,000 yuan and customer B has a balance of 600 yuan, each time a transaction is processed, only the account balance status needs to be modified.

If we change our thinking, we can also record only the specific content of each transaction to form a transaction flow, and we can also calculate the user's account balance through the transaction flow. For example, there is the following transaction flow:

  1. Customer A opens an account and deposits 1,000 yuan;

  2. Customer B opens an account (0 yuan);

  3. Customer A transfers 100 yuan to Customer B.

By reading the transaction records and performing calculations, we can know that the current balance in customer A's account is 900 yuan; the balance in customer B's account is 100 yuan.

UTXO (unspent tx output, unspent transaction output)This is a transaction flow data model, which is a way for the first generation of blockchain Bitcoin to represent digital currency. Every transaction has input (how it is obtained) and output (how it is spent), and UTXO can be simply understood as the receipt that has not been spent.

For example, customer A has 6 BTC, and he transfers 5.2 BTC to customer B, leaving 0.8 BTC. From the perspective of UTXO, it can be seen as: A's 6 UTXOs worth 1 BTC are destroyed, B obtains 1 newly generated UTXO worth 5.2 BTC, and gives A a newly generated UTXO worth 0.8 BTC as change. That is, 6 UTXOs are destroyed and 2 new UTXOs are generated.

The input and output of the transaction are strung together into a chain, and the ownership information is recorded using digital signatures, forming the UTXO model. A blockchain that adopts this data model needs to sum all UTXOs of a certain account address to know the current account balance.strict state access listBased on the UTXO model, parallel execution is achieved. It calculates the account addresses to be accessed by each transaction in advance to form an access list.

Access lists have two functions:

(1) Judging transactionsSafetyProperty: If an address that is not in the access list is accessed during transaction execution, the execution will fail.

(2) Parallel execution of transactions: Multiple sets of transactions are formed based on the access list. There is no intersection (no dependency) between each transaction set in the access list, so multiple transaction sets can be executed in parallel.

3. Industry growth drivers

From the perspective of internal laws, the development of any thing will go through the process of "from nothing to something" to "from something to excellence", and human beings' pursuit of faster speed is eternal. In order to solve the problem of block network execution speed, various solutions have been born, either on-chain or off-chain. Off-chain solutions represented by rollup have been fully discovered, while there is still a lot of room for exploration of parallel EVM narratives.

From a historical perspective, with the SEC's approval of the spot Bitcoin ETF and the upcoming Bitcoin halving, coupled with the Fed's possible interest rate cuts,cryptocurrencyIt is expected that there will be a big bull market, and the booming development of the industry requires a blockchain network infrastructure with greater throughput as a solid foundation.

From the perspective of resource management, traditional blockchain networks process transactions serially. Although this processing method is simple, it is also a waste of processor resources. Parallel blockchains make full use of computing resources, fully "drain" the performance of multi-core processors, and improve the overall performance of blockchain networks.

From the perspective of industry development, although various technologies and business models are constantly being innovated, the growth potential of Web3 still needs to be tapped. Centralized networks can push more than 50,000 messages per second, send 3.4 million emails, complete 100,000 Google searches, and allow thousands of players to be online at the same time, but decentralization cannot do this for the time being. Decentralization must compete with centralization and take its own half of the market. Continuously optimizing the parallel execution mechanism and increasing transaction throughput are also the only way to development.

From the perspective of the development of decentralized applications, in order to attract more users, efforts must be made to improve the user experience. Performance optimization is one of the directions to improve user experience. For DeFi users, it is necessary to meet the needs of high transaction speed and low fees. For GameFi users, it is necessary to meet the needs of real-time interaction. All of these require parallel execution as support.

4. Problems

Decentralization, security and scalability can only meet two of the three.The Impossible Triangle of BlockchainSince "decentralization" is an unshakable principle, the improvement of "scalability" means the reduction of "security". Code is written by people, and it is easy to make mistakes. The technical complexity brought by parallel computing provides a breeding ground for security risks.

Multithreaded programming is prone to race conditions due to improper operation of complex concurrent control. It is also prone to crashes due to access to invalid memory addresses, and even buffer overflow vulnerabilities that can be easily exploited by attackers.

The security of a project can be evaluated from at least three perspectives.Team background.The team with system programming experience has rich experience in multi-threaded programming and has seen and handled the difficult problems of 80%. System programming generally involves the following areas:

  • operating system

  • Various device drivers

  • File System

  • database

  • Embedded devices

  • Cryptography

  • Multimedia Codec

  • Memory Management

  • network

  • Virtualization

  • game

  • High-level programming languages

Second lookCode maintainability,There are rules to follow when writing maintainable code, such as clear architectural design, reasonable use of design patterns to achieve code reusability, use of test-driven development techniques to write enough unit test code, eliminate duplicate code through reasonable refactoring, etc.

Three LooksThe programming language used,Some cutting-edge programming languages are designed to emphasize high concurrency with memory safety. The compiler will check the code, and once it finds that the code has concurrency problems or may access invalid memory addresses, the compilation will fail, thus forcing developers to write sufficiently robust code.

Rust is an outstanding language, which is why we see that most parallel blockchain projects are developed in Rust. Some projects even borrow the design of Rust to implement their own smart contract language, such as Fuel's Sway language.

5. Target sorting

5.1 Based on the optimistic parallelization model

5.1.1 From memory lock to optimistic parallelism: Sei v2

Sei is a general public chain based on open source technology, established in 2022. The two founders are from the University of California, Berkeley, and other members of the team also have backgrounds in prestigious overseas universities.

Sei has received three rounds of financing, including a seed round of $5 million, a first round of strategic financing of $30 million, and a second round of strategic financing of undisclosed amounts. Sei Network has also raised a total of $100 million in funds to support the development of its ecosystem.

In August 2023, Sei was launched on the mainnet. It is known as the fastest L1 public chain, which can execute 12,500 transactions per second, with finality in just 380 ms. The current market value is nearly US$2.2 billion.

Currently, Sei Ecosystem has 118 projects, mainly focusing on DeFi, infrastructure, NFT, games andwalletWaiting for the track.CommunityThere are currently 650,000, 600,000 and 40,000 members on Twitter, Discord and Telegram respectively.

万字解读并行 EVM :如何突破区块链性能瓶颈?

At the end of November 2023, Sei announced on its official blog that it would launch the biggest version upgrade after the mainnet launch in the first half of 2024: Sei v2.The first parallel EVM blockchain, this version upgrade will bring the following new features:

  • Backward compatibility with EVM smart contracts: Developers can migrate and deploy EVM smart contracts without modifying the code

  • Reuse of common tools/apps like Metamask

  • Optimistic parallelization: Sei v2 will abandon the shared access mechanism of memory locks and adopt optimistic parallelization instead

  • SeiDB: Optimization of the storage layer

  • Supports seamless interoperability between Ethereum and other chains

The original parallel execution of transactions in the Sei network was implemented based on a memory lock model. Before execution, the dependencies between all pending transactions were parsed and a DAG was generated, and then the execution order of the transactions was precisely arranged based on the DAG. This method increased the mental burden of contract developers because they had to write the logic into the code when developing the contract.

As described in the technical principle section above, after the new version adopts optimistic parallelization, developers can develop smart contracts like writing sequential programs. A series of complex mechanisms such as transaction scheduling, execution and verification are all handled by the underlying modules. The core team also introduced a design to further improve the parallel execution capability by pre-filling dependencies in the optimized proposal design.

Specifically, a dynamic dependency generator is introduced to analyze the write operations of the transaction before execution and pre-fill them into the multi-version memory data structure to optimize potential data contention. After analysis, the core team concluded that although such an optimization mechanism is not conducive to transaction processing in the best case, it will significantly improve the execution efficiency in the worst case.

万字解读并行 EVM :如何突破区块链性能瓶颈?

5.1.2 Potential disruptor in the L1 track: Monad

If you have missed the development of the above public chains, you must not miss Monad, because it is hailed as a potential disruptor of the L1 track.

Monad was founded in 2022 by two senior engineers from Jump Crypto. The project completed a $19 million seed round of investment in February 2023. In March 2024, Paradigm negotiated to lead a round of financing of more than $200 million for Monad. If successful, this will be the largest investment since the beginning of the year.cryptocurrencyFinancing.

The project has successfully achieved the milestone of launching the internal test network and is working towards the next step of opening the public test network.

There are two prominent reasons why Monad is favored by investors: one is its strong technical background, and the other is its good marketing hype. The core members of the Monad Labs team are 30 people, all of whom have been deeply involved in high-frequency trading, kernel drivers and financial technology for decades and have rich development experience in the field of distributed systems.

The daily operation of the project is also very "down to earth": it continues to carry out "magic marketing" to its 200,000 followers on Twitter and 150,000 members on Discord. For example, it holds a meme contest every week andCommunityCollect all kinds of weird purple animal emoticons or videos,CommunityCarry out "spiritual communication".

万字解读并行 EVM :如何突破区块链性能瓶颈?

Monad's vision is to become a smart contract platform for developers, bringing extreme performance improvements to the Ethereum ecosystem. Monad introduces two mechanisms to the Ethereum virtual machine:Superscalar Pipeline Technology, secondlyImproved optimistic parallelism.

Superscalar pipelining parallelizes the execution phase of a transaction.The official document gives a very vivid example. Laundry is like blockchain's processing of transactions, which is also completed in multiple stages. The traditional way of processing is to wash, dry, fold and store each pile of dirty clothes before processing the next pile.

The superscalar assembly line starts washing the second pile of clothes while the first pile of clothes is drying. While the first pile of clothes is being folded, the second and third piles of clothes are already being dried and washed respectively, so each stage of processing is not idle.

Optimistic parallelism parallelizes the execution of transactions.Monad uses optimistic parallelism to achieve parallel execution. It also implements its own static code analyzer to predict the dependencies between transactions, and only schedules subsequent transactions to execute after the previous dependent transactions are executed, which greatly reduces the repeated execution of transactions caused by verification failures.

The current performance reaches 10,000 TPS and can produce blocks in 1 second. As the project progresses, the core team will continue to explore more optimization mechanisms.

万字解读并行 EVM :如何突破区块链性能瓶颈?

5.1.3 Highly decentralized L1 project: Canto

Founded in 2022, it has no official foundation, no pre-sale, no affiliation with any organization, no financing, and is completely community-driven. Even the core team is anonymous and works in a loosely organized manner. This is Canto, a highly decentralized L1 project built on the Cosmos SDK.

Although it is a general blockchain compatible with EVM, Canto's primary vision is to become an accessible, transparent, decentralized and free DeFi value platform. Through long-term research on the track, it is found that any healthy DeFi ecological project contains 3 basic elements:

  1. Decentralization like Uniswap and Sushiswapexchange(DEX);

  2. Lending platforms like Compound and Aave;

  3. Like DAI, USDC or USDTToken.

然而以往的 DeFi 生态最后都回到了同一个宿命:发行治理协议代币,代币的价值取决于生态能够从其未来用户那里抽取多少使用费,抽取越多则价值越大。这就好比每个 DeFi 协议就像一个按小时付费的私人停车场,用的人越多估值就越大。

Canto took a different approach:Building Free Public Infrastructure for DeFi, turning itself into a free parking lot for free use by its ecological projects.

The infrastructure includes 3 protocols: Decentralizationexchange Canto DEX, Canto Lending Market (CLM), a pooled lending platform forked from Compound v2, and the stablecoin NOTE that can be borrowed from CLM through collateral assets.

Canto DEX operates in perpetuity with a protocol that cannot be upgraded and does not require governance. It cannot issue tokens and does not charge additional fees. This prevents various rent-seeking behaviors of DeFi applications within the ecosystem from leading to a zero-sum game of the survival of the fittest.

The governance of the lending platform CLM is controlled by the pledgers, who fully enjoy the benefits brought by the ecological development, and in turn create the best environment for developers and DeFi users, motivating them to continue to invest. The interest generated by the lender's loan of NOTE will be paid to the borrower, and the agreement does not charge a penny.

For developers, Canto also introduces Contract Secured Revenue Contract revenue distribution model.It allows the fees generated by users interacting with contracts on the chain to be allocated to developers in a certain proportion. Canto's series of business model innovations have achieved the effect of "killing three birds with one stone". It creates a constructive foundation for ecological prosperity by providing an open and free financial infrastructure.

By giving benefits to developers and users of the ecosystem in various ways, we encourage them to join and continuously enrich the ecosystem. By firmly grasping the "coinage right" in our own hands, we can provide a variety of decentralized applications.Xiaobai NavigationIt creates the possibility of cross-application liquidity. The more prosperous the ecosystem, the more valuable the token. When the CSR proposal was approved by the community vote on January 26, 2024, Eastern Time, its token $CANTO ushered in a wave of increases.

万字解读并行 EVM :如何突破区块链性能瓶颈?

After completing this series of business model innovations, Canto announced its new round of technology iteration plan on its official blog on March 18, 2024.

In addition to adopting the new version of the Cosmos SDK and integrating new technologies to reduce storage access bottlenecks, Canto will also perform a parallel EVM upgrade: introducing optimistic parallelization by implementing the Cyclone EVM.

The Cosmos SDK used by Canto divides transaction processing into three stages: Proposal, Voting, and Finalization. The ProcessProposal subprocess in Voting is responsible for the parallel execution of transactions. The parallel execution engine is responsible for executing transactions, and the conflict detection engine is responsible for verifying the validity of transactions.

If it is invalid, it will be returned to the execution engine for re-execution; if it is valid, the transaction will be submitted to the subsequent processing flow. I believe that after this round of technical upgrades, Canto's tokens will have even more eye-catching performance.

万字解读并行 EVM :如何突破区块链性能瓶颈?

5.2 Strict state-based access list: Fuel

Fuel is a customized modular "Ethereum rollup operating system" consisting of the virtual machine FuelVM, the Rust-inspired contract development language Sway, and related tool chains. The Fuel project was founded in 2019. In December 2020, Fuel Labs launched the first optimistic rollup execution layer Fuel v1 on Ethereum. After more than three years of development, the project will finally be launched on the mainnet in the third quarter of 2024.

Fuel completed financing of US$1.5 million and US$80 million in 2021 and 2022 respectively. The core team has more than 60 engineers. The founder John Adler is the co-founder of Celestia Labs, a data availability solution, and one of the earliest proposers of the optimistic rollup solution. In terms of operations, the project has 270,000 and 390,000 members on Twitter and Discord respectively.

Executing transactions one by one on the chain requires paying gas fees and competing for precious block space, and the speed is slow. Therefore, various expansion solutions will naturally come to mind, such as batching the execution of transactions, and then packaging them together on the chain for settlement to speed up the execution speed.

Rollup is a scaling solution that runs outside of L1. It executes transactions in batches off-chain and then sends transaction data or proof of execution to L1, ensuring security and settling transactions through the DA layer. There are two main types of rollups: optimistic andZero knowledge proof(ZK).

Optimistic rollup assumes that the transaction is valid. Once a malicious or erroneous transaction is found, a fraud proof is generated and handed over to L1 for rollback. ZK rollup generates transaction validity proof through complex calculations without exposing transaction details, and publishes it to L1 to prove that rollup correctly executed the transaction. Therefore, rollup is a blockchain execution layer technology.

Although rollup speeds up transaction execution, existing implementations are mostly designed for single blockchains. Developers have to make various technical compromises, which limits rollup from fully utilizing its performance. And in response to the new trend of modular blockchains, the industry does not have a rollup solution that is suitable. Fuel was born to fill this gap.

Fuel uses UTXO as a data model. This data model has an advantage: its transaction output has only two states: either it has been spent and permanently recorded in the transaction history of the block; or it has not been spent and can be used in future transactions.Minimize storage state dataOn this basis, Fuel checks the account information accessed by each transaction, finds out the dependencies before executing the transaction, and schedules non-dependent transactions to execute in parallel, thereby improving the throughput of transaction processing.

万字解读并行 EVM :如何突破区块链性能瓶颈?

5.3 Cross-chain integration of L1 chain L2 solutions: Neon, Eclipse and Lumio

L2 solutions have one thing in common: they combine the capabilities of two virtual machines to increase the speed of transaction execution. Specifically, they use parallel L1 to execute transactions, but are compatible with other chains (dual virtual machine support). The difference is that different projects adopt different compatibility mechanisms. Neon, Eclipse and Lumio are quite representative in this regard.

Neon is known as the first parallel EVM project in the Solana ecosystem. Developers can use it to seamlessly migrate Ethereum ecosystem projects to the Solana ecosystem. Eclipse is another fastest second-layer protocol compatible with EVM in the Solana ecosystem, built with a modular architecture. Among the three projects, only Neon has issued its own tokens and has achieved a circulating market value of more than 78 million.

The other two projects are still in the early stages. Lumio combines Aptos and Ethereum to build an optimistic rollup layer 2 protocol that efficiently executes Ethereum applications at the speed of Move VM.

In terms of financing, Neon completed financing of US$40 million and US$5 million in November 2021 and June 2023, respectively, for a total of US$45 million. Eclipse completed financing of US$6 million, US$9 million and US$50 million in August 2022, September 2022 and March 2024, respectively, for a total of US$65 million. Lumio has not yet received any financing.

None of the three projects has formed a large-scale application ecosystem, but they have tens of thousands to hundreds of thousands of followers or members on major social media platforms, and have considerable community activity, as shown in the table below.

万字解读并行 EVM :如何突破区块链性能瓶颈?

From the implementation mechanism point of view, Neon is the EVM Simulator, running in the form of smart contracts. Developers can write dApp applications in languages such as Solidity and Vyper, and can use Ethereum tool chains such as MetaMask, Hardhat, Remix and compatible Ethereum RPC API, accounts, signatures and token standards. At the same time, they can enjoy the low fees, high transaction execution speed and parallel execution capabilities brought by Solana.

Ethereum transactions sent by the Ethereum dApp front end are converted into Solana transactions through the proxy, and then executed in the simulator to modify the on-chain status. Just like the game simulators we often use on PC, which allow us to play exclusive games on game platforms such as Switch and PS on desktop computers, Neon allows Ethereum developers to run Ethereum applications on the Solana network.

万字解读并行 EVM :如何突破区块链性能瓶颈?

Eclipse takes another approach:Transactions are executed through the SVM and settled through the EVM.Eclipse adopts a modular blockchain architecture, that is, it is only responsible for the execution of transactions, while other responsibilities are "outsourced" to form a unified solution through modular combination.

For example, Celestia is used to manage data availability, and Ethereum is used to execute transaction settlement. Eclipse uses SVM to ensure execution speed, and Ethereum's verification and settlement ensure security.

万字解读并行 EVM :如何突破区块链性能瓶颈?

Lumio adopts a design concept that is independent of the execution layer and the settlement layer. It can support a variety of virtual machines and is compatible with various L1/L2 networks: Ethereum, Aptos, Optimism, Avalanche, zkSync, and so on. Move VM executes transactions,passEVM Settlement Transactions, thus connecting the Ethereum ecosystem and the Aptos ecosystem.

However, Lumio's ambition does not stop there. Its vision is to provide cross-virtual machine calls.Realize the interconnection of multiple blockchain liquidity with the fastest speed and lowest rate.

The above are the main projects currently related to the parallel EVM narrative, as shown in the figure below.

万字解读并行 EVM :如何突破区块链性能瓶颈?

6. Conclusion and Outlook

People like to compare Bitcoin to a "distributed ledger" and Ethereum to a "distributed state machine." If all nodes running the blockchain network are regarded as a computer, then parallel blockchain is essentially a study of how to squeeze out the processor resources of this "computer" to maximize execution speed.

This is the historical inevitability of the continuous development of computing technology, just like the development of processors from single-core to multi-core, and the development of operating systems from single-user single-thread to multi-user multi-thread. This has extraordinary significance for promoting the continuous development of the industry.

The technical principle of parallel EVM can be broken down intoVirtual MachinesandParallel execution mechanismTwo components. In the context of blockchain, the virtual machine integrates a set of instructions for distributed execution of contracts and running dApps. The parallel execution mechanism mainly studies how to maximize the speed of transaction execution while ensuring the correctness of transaction results.

on the one hand,Parallel EVMs share common technical principles.first,The optimistic parallelization model is the consensus of the L1 public chainBut this does not mean that the memory lock model is useless. Because there is no difference between high and low technologies, only the level of developers is different.

Secondly,Projects such as Fuel firmly believe that the off-chain expansion mechanism can only achieve maximum performance after modularization.Finally, a number of L2 projects passedIntegrate parallel L1 public chains to increase transaction throughput, achieving cross-ecological expansion capabilities.

on the other hand,Parallel blockchain has its own unique technical achievements.Even if the same parallel execution model is used, different teams use different architectural design patterns, data models or preprocessing mechanisms. The exploration of technology is endless. Different projects will develop different technologies on the same basis based on different visions to promote the practice to a higher level.

Looking ahead,There will be more L1 and L2 projects joining the competition for parallel EVM.The L1 track will form a pattern of full competition between the parallel EVM and parallel non-EVM camps in processor resources, storage resources, network resources, file system resources and device resources, and more new narratives related to performance improvement will be born. The L2 track will develop in the direction of blockchain virtual machine simulators or modular blockchains.

In the future, infrastructure optimization will bring faster speed, lower costs and higher efficiency. Web3 entrepreneurs can boldly innovate business models, create better decentralized product user experience for the world, and further prosper the industry ecosystem. For Web3 investors, it is far from enough to just focus on technology.

When choosing investment targets, investors should not only look at the narrative, but also the market value and liquidity. They should choose projects with "good narrative", "low market value" and "high liquidity", and then study their business, team background, economic model, marketing, ecological projects and other aspects, so as to discover potential projects and find suitable investment channels.

Parallel EVM is in the early stages of development, and Neon, Monad, Canto, Eclipse, Fuel, and Lumio are still in the stage where their value has not been fully discovered. Especially Monad, Canto, and Fuel.

Judging from Monad's marketing style, not only is it worth paying attention to itself, but also the meme projects in its ecosystem in the future are also worth noting. There may be myths of getting rich quickly due to hype. Canto has met the conditions of "good narrative" and "low market value". Whether it is a good investment target requires in-depth research on its various indicators. Fuel represents a hot development direction for modular blockchains, and may also give rise to new investment opportunities. These are all directions worthy of our attention.

The article comes from the Internet:Ten thousand words to interpret parallel EVM: How to break through the blockchain performance bottleneck?

Related recommendation: Solana Final Research Report: Like Apple, but Different from Apple

Learn about Solana from all angles. Written by: Jay Translated by: Xiaobai Navigation Coderworld With the popularity of the Solana meme, Solana has received more and more attention in the market. Many people have already regarded Solana as a giant competing with Ethereum. This article is a comprehensive analysis of the Solana ecosystem, from the perspective of the Solana ecosystem…

share to
© 版权声明

相关文章