What Is Parallelization (Parallel Transaction Execution)?
On the blockchain, parallelization involves structuring the network to process multiple transactions at the same time, instead of sequentially. This enables blockchain scaling, lower gas costs, and higher transaction processing speed.
Key Takeaways
-
Blockchain networks claim to achieve higher throughput by adopting parallel transaction execution (also known as parallelization).
-
Parallelization works by having the blockchain network sort transactions and execute them simultaneously, making use of all available network resources and routing the network through multiple states to arrive at a common state, agreed by the network nodes to maintain consensus. This is in contrast to sequential transaction execution used by older blockchain networks.
-
Parallel transaction execution is a growing trend amongst contemporary blockchain networks with the common goal of delivering higher transaction processing speed and overall enhanced efficiency. Some of these networks include Sui, Aptos, Monad, and Polygon.
Older blockchain networks process transactions in sequence, where each transaction is processed one after the other. However, as the adoption of blockchain technology spreads, the demand on regular blockchain networks grows proportionally, resulting in higher gas fees and congestion on the blockchain. To keep up with the demand, blockchain networks are experimenting with scaling solutions, such as parallelization, Layer 2s, and modularity.
In this article, we’ll look at parallelization and how it improves the overall agility of a blockchain network and works in synergy with these other solutions to deliver an efficient and scalable blockchain network.
Parallelization (Parallel Transaction Execution) and Blockchain Scaling
Parallelism is a concept in computing and computer programming, where it describes the concept of splitting tasks into pieces that can be handled at the same time. This is also the idea behind parallelization in blockchain technology.
Parallelization is also known as parallel transaction execution. This approach to transaction processing structures the network to process transactions simultaneously. That is, instead of processing transactions sequentially, it processes multiple transactions at the same time. Using the queue analogy again, parallelization gets rid of the queue and delivers a scenario where these transactions can be spread across the network’s nodes and get validated at the same time. It routes the network through different states, reflecting the effect of the simultaneously processed transactions. At the end of each run, the network attains a uniform state, reaching consensus across the different nodes.
Consider this simple scenario to understand the power of parallelization:
— Sei 🔴💨 (@SeiNetwork) January 30, 2024
It's a hot day, you want a Pepsi but you need to queue with these Fanta guys 🙁
Normally, you'd have to wait in the same long line to quench your thirst. But, if there were multiple machines serving one… pic.twitter.com/IHj0FzXD9J
Parallel transaction execution optimizes the utilization of the entire network's resources, thereby accelerating the processing speed by concurrently handling multiple transactions across network nodes or subgroups. This has been shown to improve the overall throughput of the network greatly. Networks that implement parallelization claim to achieve up to 100 times faster TPS than networks that process transactions in sequence.
How Parallel Transaction Execution Works
There are two models of Parallel transaction execution:
-
Optimistic parallelization
-
State access parallelization
Optimistic Parallelization
In the optimistic parallel execution model, the network skips the sorting stage and proceeds to process the transactions simultaneously. It assumes that the transactions in the queue are independent (unrelated) and goes back to make adjustments in the event of incorrect execution. In this case, where there are additional dependencies surrounding transactions, the transaction will be executed again with the correct data.
State Access Parallelization
The first step in the state access parallel execution model is sorting the transactions. The network groups the transactions according to the effect they have on the network’s state. The RPC feeds the consensus system with multiple transactions. The network sorts these transactions accordingly; for instance, into related and unrelated transactions.
Related transactions could include transactions that interact with the same smart contract or the same account on the network. Unrelated transactions could include unidirectional transactions that interact with different contracts. The network proceeds to execute unrelated transactions simultaneously, saving time and cost, while related transactions are re-coordinated before they are processed.
Another criterion that could be used in transaction sorting is the gas fees paid for each transaction. Higher fee transactions could be executed in parallel, giving the user a better experience in terms of processing speed.
Benefits of Parallelization
Now, let’s look at some of the benefits around parallel transaction execution.
Scalability
Blockchain networks face challenges with scaling, which is where parallelization comes in. By splitting tasks and distributing them across the network’s nodes, this not only enables the network to process them faster but also allows the network to scale horizontally. The network can increase the available resources by contracting more nodes during high-demand situations and also return to normalcy when the demand decreases. The ability to scale in and out in this way keeps the network in shape as demand conditions fluctuate.
Lower Gas Costs
Parallelization not only saves time but also other costs such as fees paid per transaction. As transactions are distributed to different subgroups of nodes, each transaction attracts a lower fee when compared to being validated by every node on the network, as seen in the sequential transaction processing model.
Also, the higher transaction speed means that there are less transactions in queue and less competition to get these transactions validated; therefore, a lower fee is charged for each transaction.
High Transaction Processing Speed (TPS)
By spreading the task across multiple nodes, the network saves a great deal of time when executing each transaction. Blockchain networks that implement parallelization claim to have achieved a TPS of up to 100 times higher than networks using the sequential processing model, where networks like Solana claim to offer over 50,000 TPS, although the recorded speed could differ based on the presiding demand conditions.
Complexity: The Main Challenge of Parallel Transaction Processing
While parallel transaction processing offers significantly improved network agility, it is more complex. The complexity challenge stems from the need to sort transactions and also resolve the multiple states that are created during each run.
In the case of optimistic parallelization, the network could run into issues while processing related transactions. For instance, there could be multiple transfers to and from the same account from different addresses. The network must resolve these transactions to ensure that the balances in each of these wallets are accurate. To get around this, networks that use the optimistic parallel transaction processing model may use schedulers to ensure dependent transactions are executed only when prerequisite transactions have been completed.
While the state access model tackles this from the start, the nodes have to deal with the quick flow of information and the need to regularly synchronize with the rest of the network.
Now, we’ll take a look at the different types of parallel processing networks.
Parallelized EVMs
The Ethereum Virtual Machine (EVM) is the first instance of a decentralized virtual machine, as we know it today. It is also the most popular virtual machine, as developers can port over popular dApps easily without having to build from scratch. Parallelized EVMs appeal to Ethereum developers by offering them a way to deploy their code on higher-throughput blockchains without needing to make any changes.
Here are some examples of parallelized EVMs.
Sei Network
Sei is a blockchain network developed specially for decentralized finance using Tendermint core and Cosmos SDK. It offers parallel order execution, where orders from independent markets can be processed simultaneously (although those from the same market are still processed sequentially). In a publication made in November 2023, Sei shared its plans for a v2 upgrade. The V2 upgrade will include a system redesign that introduces EVM compatibility and optimistic parallelization. On Sei v2, both EVM and non-EVM protocols will live on the same blockchain.
Monad
Monad is an EVM-compatible Layer 1 blockchain network. It boasts a transaction speed of up to 10,000 TPS and claims to tackle the major issues plaguing the performance of blockchain networks today. One of the ways Monad does this is through optimistic parallel execution. To overcome the possibility of incorrect executions, Monad uses a static code analyzer that predicts prerequisite transactions, which are executed first.
Polygon
Inspired by the efforts of the Aptos blockchain in transaction parallelization, Polygon shared its plans to introduce this concept to the Polygon POS chain as early as 2022. However, Polygon cited the sorting and execution of related transactions as one of the challenges of this concept. To overcome this, Polygon implemented a “minimal metadata approach,” which involved attaching metadata to discovered dependent transactions after parallel execution, which informs validators on how they should process these transactions and how they can fill blocks for maximum efficiency.
Neon EVM
Neon is the first parallelized EVM built on the Solana blockchain.This combines the strengths of the EVM and the high throughput of the Solana blockchain, thanks to Solana’s parallel transaction execution technology. This works by using a proxy to wrap Ethereum transactions to the Neon EVM hosted on Solana, and the transaction is parsed on the Solana blockchain via this setup.
Other Parallel Processing Networks
Beyond projects attempting to integrate parallel transaction execution into the Ethereum virtual machine, there are also other parallel processing networks, including:
Solana
Solana Network is one of the pioneers of the Parallel transaction execution concept. According to Solana co-founder Anatoly Yakovenko, parallelization is one of the eight key features that contributes to the high throughput of the Solana blockchain. Solana uses SeaLevel, a parallel smart contract runtime that can process tens of thousands of contracts, using as many cores as are available to the validator. This saves significant time as each transaction is validated as fast as possible.
Solana’s parallelization is enabled by the smart contracts structure and the accounts feature. Solana smart contracts are built to declare the states they intend to interact with. Each program declares the account it intends to interact with beforehand, which makes it easier to sort these transactions according to their state access. The virtual machine schedules non-overlapping (non-related) transactions to be executed in parallel.
Sui
Sui introduces the concept of objects and consensus bypass in addition to the state access parallelization model it operates. Smart contract transactions on Sui reference objects, which are assets on the Sui blockchain. Each transaction is categorized into simple and complex transactions. Simple transactions include regular transactions like asset transfers which do not involve a shared object, and these are executed instantly without contracting the consensus system.
Complex transactions require extensive smart contract interactions and involve a shared object. Such transactions are sorted according to their effect on the network’s states, where non-related transactions are executed in parallel. Related transactions are executed in sequence. Using this approach, Sui claims to achieve a transaction speed of about 10,000 TPS and up to 290,000 TPS depending on network demand and conditions.
Aptos
Aptos claims to run transactions at a speed of up to 160,000TPS. This is partly thanks to how it structured its parallel transaction execution system. Aptos uses the optimistic parallel execution model, where it executes transactions in parallel with the assumption that these transactions are not interlinked. While this speeds things up, one caveat of this method is that errors might lead to a transaction rerun.
However, Aptos claims that its system is built to automatically detect related transactions after the execution. It uses the Block-Software Transaction Memory (Block STM) method to keep track of the changes made by each reaction and where these changes were made. For each related transaction that was run in parallel that produces an inaccurate result, the results are wiped and repeated until accurate results are obtained.
Final Thoughts
Contemporary blockchain projects are focused on improving the speed at which decentralized networks process transactions without significant security tradeoffs. Layer 2 solutions and now parallelization are major developments in this area. Despite the complexity of its implementation, the idea behind parallelization is simple. In the sequential transaction method, the majority of the blockchain network’s resources lay dormant at a point as transactions are processed one after the other. Parallelization gets rid of this ‘queue’ system and makes for a more turbulent processing scenario, but this delivers more speed as discussed throughout the course of this article.
This article is for educational purposes only and looks at parallelization on technological grounds and should not be taken as financial advice. Always do your own research around any projects and ensure you understand the risks associated before investing any capital.
Subscribe to the CoinGecko Daily Newsletter!