Home

Awesome

RISE Parallel EVM

CI

:warning: This repository is a work in progress and is not production ready :construction:

Banner

Problem

Parallelising execution to accelerate blockchain throughput has gained popularity thanks to Aptos and Solana. However, it is still unfruitful in the EVM land. Early adaptions 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.

Solution

RISE pevm sets to address this problem by designing an EVM-specialized parallel executor and implementing it in Rust to minimise runtime overheads. The result is the fastest EVM block executor, with a peak speedup of 22x and a raw execution throughput of 30 Gigagas/s on 32 AWS Graviton3 CPUs. RISE pevm also enables new parallel dApp designs for EVM like Sharded AMM.

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.

RISE pevm builds on 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.

Architecture

We made several contributions fine-tuned for EVM. For instance, all EVM transactions in the same block read and write to the beneficiary account for gas payment, making all transactions interdependent by default. RISE pevm addresses this by lazy-updating the beneficiary balance. 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 for common scenarios like raw ETH and ERC-20 transfers. Lazy updates help us parallelise transfers from and to the same address, with only a minor post-processing latency for evaluating the lazy values.

While others embed their parallel executor directly into their nodes, we built this dedicated repository to serve as a playground for further pevm R&D.

Goals

Development

$ cargo build

Alpha Done

Alpha TODO

Future Plans

Tooling

Fetch Real Blocks

We often want to fetch real blocks for testing and benchmarking. The pevm-fetch CLI snapshots everything needed to execute an Ethereum mainnet block to data. More networks will be supported in the future.

$ cargo run -p pevm-fetch <RPC_URL> <BLOCK_ID>

Where <BLOCK_ID> may be a hash or a number.

Testing

We have three test groups:

$ git submodule update --init
# Running our heavy tests in parallel would congest resources.
# Each test still executes parallelly anyway.
$ cargo test --workspace --release -- --test-threads=1

Benchmarks

See the dedicated doc here.