FAFO is a blockchain transaction scheduler that optimizes transaction execution by reordering transactions before block formation for maximum concurrency.
- Over 1 million Merkleized EVM-Compatible transactions per second while maintaining state verifiability
- Near-linear throughput scaling up to 96 cores and beyond on a single machine
- 91% cheaper than sharded execution
Read the full FAFO paper here: https://layerzero.network/publications/FAFO_Whitepaper.pdf
FAFO is ongoing research. Designed for high performance and practical use, some features are still evolving. We invite feedback and contributions from the community.
FAFO has three key components:
- ParaLyze preprocesses each transaction in the mempool to approximate the addresses of every storage slot it reads and writes.
- ParaFramer uses our cache-friendly data structure, ParaBloom, to group non-conflicting (parallel-executable) transactions into frames. Frames are groups of transactions that do not have data conflicts and thus can be run in parallel.
- ParaScheduler extracts even more parallelism out of the stream by computing a collection of precedence graphs for each storage slot accessed by each transaction.
To get started, clone the repository and install the dependencies:
git clone https://github.com/LayerZero-Labs/fafo.git
cd fafo
./install-dependencies
Run a quick benchmark:
# No contention
./bench-sendeth/run.sh --size fast --generator none
# Contention
./bench-sendeth/run.sh --size fast --generator hotn
See bench-sendeth/readme.md for more benchmark details.
- Docker Desktop with the following recommended settings:
- Virtual disk size: At least 256GB
- Memory limit: At least 32GB
- Visual Studio Code
- Dev Containers extension
Due to the complexities of software versions and environments on your host, it can be challenging to resolve issues related to these factors.
We strongly recommend using Dev Containers for development to ensure a consistent and isolated development environment and avoid common setup issues, and that will be helpful to reproduce the issues also.
Setup steps:
- Install Visual Studio Code (VSCode)
- Install the "Dev Containers" extension in VSCode
- Use VSCode's "Dev Containers: Clone Repository in Named Container Volume..." command to clone the repository
- Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Type and select "Dev Containers: Clone Repository in Named Container Volume..."
- Enter repository URL when prompted
- Choose a meaningful name for the volume
This setup ensures optimal performance and consistent development environment.
For more details, see Dev Containers in VS Code
See CONTRIBUTING.md for our full development workflow.
Please raise a GitHub issue. For vulnerabilities, please report them privately via GitHub security page per our security policy.
This project is dual licensed under the MIT License and the Apache License 2.0.
- QMDB: FAFO builds on top of QMDB, our fast Merkleized database.
- vApps: FAFO enables lights clients and stateless validation for ZK-based vApps. Read more about vApps in the paper: vApps: A Unified Rust-Based DSL for Verifiable Blockchain Computing Applications.
If you use FAFO in a publication, please cite it as:
FAFO: Over 1 million TPS on a single node running EVM while still Merkleizing every block
Ryan Zarick, Isaac Zhang, Daniel Wong, Thomas Kim, Bryan Pellegrino, Mignon Li, Kelvin Wong
https://layerzero.network/research/fafo
@article{zarick2025fafo,
title={FAFO: Over 1 million TPS on a single node running EVM while still Merkleizing every block},
author={Zarick, Ryan and Zhang, Isaac and Wong, Daniel and Kim, Thomas and Pellegrino, Bryan and Li, Mignon and Wong, Kelvin},
journal={Under submission},
year={2025}
}
QMDB is a product of LayerZero Labs Research.
Homepage | Docs | Developers