Parallel EVM emerges as a standout solution for enhancing EVM execution speeds. By leveraging parallel program execution and data read/write operations, it taps into the concurrency capabilities of modern computers, which are typically equipped with 4-8 CPU cores and boast high-bandwidth I/O.
There are two main approaches to implementing Parallel EVM:
Of these strategies, parallel I/O has garnered considerable interest within the Ethereum community for its simplicity and potential to significantly enhance performance. As shown in the below graph, reading data using SLOAD and CALL opcodes in the EVM accounts for approximately 70% of EVM execution time.
Graph from https://collective.flashbots.net/t/speeding-up-the-evm-part-1/883
A key milestone in exploiting parallel I/O's advantages is EIP-2930: Optional Access Lists, which marks a pioneering step by integrating optional access lists into transactions. This approach allows for the parallel preloading of data from access lists, enhancing I/O speed and reducing gas costs per transaction. Despite these advantages, access lists remain underutilized on the mainnet, with only about 1.45% of transactions including them, as noted in a study from https://arxiv.org/abs/2312.06574.
This article delves into two promising strategies to further harness parallel I/O's benefits:
Before delving into parallel I/O in the EVM, it's crucial to understand the capabilities of modern storage devices regarding parallel I/O operations. To shed light on this, we conducted tests on a Western Digital SN850x 4TB NVMe disk, priced at approximately $300, to evaluate how it handles varying numbers of parallel I/O requests and the impact on latency per I/O. In these tests, a single I/O operation represents a sequential workload, akin to the current EVM approach. Our findings revealed that executing four parallel I/O operations yields latency figures comparable to a sequential execution. Moreover, increasing the parallelism to twelve I/O operations results in a latency increase of roughly 12% (from 54.25 to 60.79), when compared to the sequential execution.
This data highlights the potential for leveraging parallel I/O in environments like the EVM, where enhancing storage access efficiency can significantly increase overall EVM performance.
Parallel IOs | Latency | Bandwidth |
---|---|---|
1 | 54.25 us | 71.6 MiB/s |
2 | 52.26 us | 149 MiB/s |
4 | 54.30 us | 286 MiB/s |
8 | 59.58 us | 521 MiB/s |
12 | 60.79 us | 767MiB/s |
16 | 62.64 us | 992MiB/s |
32 | 64.00 us | 1942MiB/s |
In response to the incredible low adoption of EIP-2930: Optional Access List, EIP-7650: Programmable Access Lists has been introduced, aiming to maximize the sustained benefits of using access lists. This proposal enables smart contract developers to define an access list when a contract is called at the early beginning. For instance, consider the swap()
method in Uniswap V2. Each swap operation necessitates reading specific storage slots, including: