Parallel EVM
Parallelising execution to accelerate blockchain throughput has gained popularity thanks to Aptos, Sui, and Solana. Early adaptations of Block-STM by Polygon and Sei have shown limited speedup due to the lack of EVM-specific optimisations and implementation limitations. Both Polygon and Sei use Go, a garbage-collected language unsuitable for optimisations at the micro-second scale. Parallel execution in Go is mostly slower than sequential execution in Rust and C++ for Ethereum mainnet blocks today.
RISE parallel EVM (pevm) is a groundbreaking parallel execution engine for EVM transactions, designed to address the performance limitations of current Ethereum Layer 2 solutions.
Why pevm?
The need for a parallel EVM aRISEs from the current performance gap between Ethereum rollups and competitors like Solana:
- Ethereum and its rollups combined are processing around only 200-300 TPS across 50+ rollups.
- In contrast, Solana consistently produces 1000-2000 TPS, about 10 times larger than that of all rollups combined.
With recent innovations like EIP4844 and external DA options addressing the data availability bottleneck, the new frontier for improving performance is execution. RISE pevm aims to process EVM blocks faster, directly tackling this challenge.
What is pevm?
pevm is EVM execution on steroids. It is a parallel EVM implementation compatible with Reth, allowing the execution of transactions to be split across many CPU cores while maintaining a deterministic outcome. Key features include:
- Optimistic execution of transactions in parallel.
- Detection of transaction dependencies and conflicts to ensure deterministic outcomes.
- Compatibility with existing sequential executors for easy integration and performance boosts.
Design
Blockchain execution must be deterministic so that network participants agree on blocks and state transitions. Therefore, parallel execution must arrive at the same outcome as sequential execution. Having race conditions that affect execution results would break consensus.
pevm sets to address this problem by designing an EVM-specialized parallel executor and implementing it in Rust to minimise runtime overheads. pevm is built upon the foundation of Block-STM's optimistic execution. We also use a collaborative scheduler and a multi-version data structure to detect state conflicts and re-execute transactions accordingly. RISE pevm also enables new parallel dApp designs for EVM like Sharded AMM.
Lazy Updates
All EVM transactions in the same block read and write to the same beneficiary account for gas payments, making all transactions interdependent by default. pevm addresses this by utilizing lazy updates for this account. We mock the balance on gas payment reads to avoid registering a state dependency and only evaluate it at the end of the block or when there is an explicit read. We apply the same technique to other common scenarios such as raw ETH or ERC20 transfers. This enables the ability to parallelize transfers from and to the same address, with only a minor post-processing latency for lazy evaluations.
Mempool Preprocessing
Unlike previous rollups that ordered transactions by first-come-first-served or gas auctions, RISE innovates a new mempool structure that balances latency and throughput. The goal is to pre-order transactions to minimise shared states and maximise parallel execution. This has a relatively similar effect as the local fee market on Solana, where congested contracts & states are more expensive regarding gas & latency. Since the number of threads to execute transactions is much smaller than our intended TPS, we can still arrange dedicated threads to execute high-traffic contract interactions sequentially and others in parallel in other threads.
Performance Benchmarks
Early benchmarks show promising results:
- For large blocks with few dependencies, Uniswap swaps saw a 22x improvement in execution speed.
- On average, pevm is around 2x faster than typical sequential execution for a variety of Ethereum blocks.
- The max speed-up is around 4x for a block with few dependencies.
- For L2's with large blocks, pevm is expected to consistently surpass 5x improvement in execution speed.
Current Status and Future Development
pevm is currently in pre-alpha stage but already shows significant potentials such as it passes the Ethereum General State Tests and can execute Ethereum mainnet blocks. The team expects to improve performance by another 3-5x with further optimisations, including:
- Optimizing concurrent data structures.
- Implementing more granular memory locations.
- Adding pre-provided metadata from statically analyzed mempools.
- Writing custom memory allocators.
- Supporting multiple EVM executors.
The ultimate goal is to achieve 10 Gigagas/s and beyond, making RISE pevm the fastest EVM execution engine available. By implementing pevm, RISE aims to significantly boost its transaction throughput, moving closer to its target of 1+ Gigagas/s and setting a new standard in blockchain technology.